OMERO.server installation on Debian 9¶
This is an example walkthrough for installing OMERO on Debian 9, using a dedicated system user, and should be read in conjunction with OMERO.web administration. You can use this as a guide for setting up your own test server. For production use you should also read the pages listed under Optimizing Server Configuration. This guide will install Python 3.5.
This guide describes how to install using the recommended versions for Java, Ice, PostgreSQL. This should be read in conjunction with Version requirements.
This guide does not describe how to install OMERO.web. To deploy OMERO.web, please read OMERO.web installation on Debian 9 and IcePy 3.6.
These instructions assume your Linux distribution is configured with a UTF-8 locale (this is normally the default).
For convenience in this walkthrough we will use the omero system user and the main OMERO configuration options have
been defined as environment variables. When following this walkthrough you can
either use your own values, or alternatively source settings.env
:
OMERO_DB_USER=db_user
OMERO_DB_PASS=db_password
OMERO_DB_NAME=omero_database
OMERO_ROOT_PASS=omero_root_password
OMERO_DATA_DIR=/OMERO
# Location of the OMERO.server
OMERODIR=/opt/omero/server/OMERO.server
# Location of the virtual environment for omero-py
VENV_SERVER=/opt/omero/server/venv3
export OMERO_DB_USER OMERO_DB_PASS OMERO_DB_NAME OMERO_ROOT_PASS OMERO_DATA_DIR
export PGPASSWORD="$OMERO_DB_PASS"
export OMERODIR
PATH=$VENV_SERVER/bin:$PATH
export PATH
Installing prerequisites¶
The following steps are run as root.
Install Java 11, Ice 3.6.5 and PostgreSQL 11:
To install Java 11 and other dependencies:
apt-get update
apt-get -y install unzip wget bc
# to be installed if daily cron tasks are configured
apt-get -y install cron
# install Java
echo "deb http://ftp.debian.org/debian stretch-backports main" | tee /etc/apt/sources.list.d/linuxuprising-java.list
apt-get update -q
apt-get -t stretch-backports -y install openjdk-11-jre-headless
# install dependencies
apt-get -y install\
python3 \
python3-venv
# to be installed if recommended/suggested is false
apt-get -y install python3-setuptools python3-wheel
To install Ice 3.6.5:
apt-get -y install zeroc-ice-all-runtime
To make Ice available to all users, set the environment using omero-ice36.env
:
cat omero-ice36.env >> /etc/profile
As part of the installation of Ice, two new daemons are installed and automatically started. In order for the OMERO.server to start correctly, they both should be disabled by running the following command:
systemctl --now disable glacier2router icegridregistry
To install PostgreSQL 11:
apt-get install -y gnupg
echo "deb [arch=amd64] http://apt.postgresql.org/pub/repos/apt/ stretch-pgdg main" > /etc/apt/sources.list.d/pgdg.list
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
apt-get update
apt-get install -y postgresql-11
service postgresql start
Create an omero system user, and a directory for the OMERO repository:
useradd -mr omero
# Give a password to the omero user
# e.g. passwd omero
chmod a+X ~omero
mkdir -p "$OMERO_DATA_DIR"
chown omero "$OMERO_DATA_DIR"
Create a database user and initialize a new database for OMERO:
echo "CREATE USER $OMERO_DB_USER PASSWORD '$OMERO_DB_PASS'" | su - postgres -c psql
su - postgres -c "createdb -E UTF8 -O '$OMERO_DB_USER' '$OMERO_DB_NAME'"
psql -P pager=off -h localhost -U "$OMERO_DB_USER" -l
Installing OMERO.server¶
The following step is run as root.
We recommend to create a virtual environment and install the Ice Python binding using pip
:
# Create a virtual env and activate it
python3 -mvenv $VENV_SERVER
# Install the Ice Python binding
$VENV_SERVER/bin/pip install https://github.com/ome/zeroc-ice-py-debian9/releases/download/0.2.0/zeroc_ice-3.6.5-cp35-cp35m-linux_x86_64.whl
Install omero-py
:
# Install omero-py
$VENV_SERVER/bin/pip install "omero-py>=5.6.dev4"
Download and unzip OMERO.server:
cd /opt/omero/server
SERVER=https://downloads.openmicroscopy.org/omero/5.6/server-ice36.zip
wget -q $SERVER -O OMERO.server-ice36.zip
unzip -q OMERO.server*
Change the ownership of the OMERO.server directory and create a symlink:
# change ownership of the folder
chown -R omero OMERO.server-*
ln -s OMERO.server-*/ OMERO.server
The following steps are run as the omero system user.
The variable OMERODIR
set in settings.env
above must point to the location where OMERO.server is installed.
e.g. OMERODIR=/path_to_omero_server/OMERO.server
.
Note that this script requires the same environment variables that were set earlier in settings.env, so you may need to copy and/or source this file as the omero user.
Configure the server:
omero config set omero.data.dir "$OMERO_DATA_DIR"
omero config set omero.db.name "$OMERO_DB_NAME"
omero config set omero.db.user "$OMERO_DB_USER"
omero config set omero.db.pass "$OMERO_DB_PASS"
omero db script -f $OMERODIR/db.sql --password "$OMERO_ROOT_PASS"
psql -h localhost -U "$OMERO_DB_USER" "$OMERO_DB_NAME" < $OMERODIR/db.sql
Patching OMERO.server¶
Weaker ciphers like ADH are disabled by default in OpenSSL 1.1.0,
the version installed on Debian 9.
This means that it is not possible to connect to an OMERO.server
using any OMERO clients e.g. the Java Desktop client,
the OMERO.web client or the CLI.
The parameter @SECLEVEL=0
, enabling the weaker ciphers, needs to be
added in two files in order to allow connection.
omero config set omero.glacier2.IceSSL.Ciphers HIGH:ADH:@SECLEVEL=0
Running OMERO.server¶
The following steps are run as the omero system user.
OMERO should now be set up. To start the server run:
omero admin start
In addition omero-init.d
is available should you wish to start OMERO automatically.
Securing OMERO¶
The following steps are run as root.
If multiple users have access to the machine running OMERO you should restrict access to OMERO.server’s configuration and runtime directories, and optionally the OMERO data directory:
chmod go-rwx $OMERODIR/etc $OMERODIR/var
# Optionally restrict access to the OMERO data directory
# chmod go-rwx "$OMERO_DATA_DIR"