Note
This documentation is for OMERO 5.2. This version is now in maintenance mode and will only be updated in the event of critical bugs or security concerns. OMERO 5.3 is expected in the first quarter of 2017.
This is an example walkthrough for installing OMERO on Ubuntu, using a dedicated system user, and should be read in conjunction with OMERO.web deployment. 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.
These instructions assume your Linux distribution is configured with a UTF-8 locale (this is normally the default).
For convenience in this walkthrough 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 the following file:
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
OMERO_WEB_PORT=80
export OMERO_DB_USER OMERO_DB_PASS OMERO_DB_NAME OMERO_ROOT_PASS OMERO_DATA_DIR OMERO_WEB_PORT
export PGPASSWORD="$OMERO_DB_PASS"
The following steps are run as root.
Install Java 1.8, Ice 3.6 and PostgreSQL 9.4:
To install Java 1.8 and other dependencies:
apt-get update
# installed for convenience
apt-get -y install unzip wget bc
# install Java
apt-get -y install software-properties-common
add-apt-repository -y ppa:openjdk-r/ppa
apt-get update
apt-get -y install openjdk-8-jre
# install dependencies
apt-get update
apt-get -y install \
unzip \
wget \
python-{matplotlib,numpy,pip,scipy,tables,virtualenv}
# require to install Pillow
apt-get -y install \
libtiff5-dev \
libjpeg8-dev \
zlib1g-dev \
libfreetype6-dev \
liblcms2-dev \
libwebp-dev \
tcl8.6-dev \
tk8.6-dev
pip install --upgrade pip
# upgrade required since pillow is already installed
pip install --upgrade -r requirements.txt
To install Ice 3.6:
apt-get -y install db5.3-util
apt-get -y install libssl-dev libbz2-dev libmcpp-dev libdb++-dev libdb-dev
apt-key adv --keyserver keyserver.ubuntu.com --recv 5E6DA83306132997
apt-add-repository "deb http://zeroc.com/download/apt/ubuntu`lsb_release -rs` stable main"
apt-get update
apt-get -y install zeroc-ice-all-runtime zeroc-ice-all-dev
pip install "zeroc-ice>3.5,<3.7"
To install PostgreSQL 9.4:
# install Postgres
apt-get -y install apt-transport-https
add-apt-repository -y "deb https://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main"
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -
apt-get update
apt-get -y install postgresql-9.4
service postgresql start
See requirements.txt
Create an omero system user, and a directory for the OMERO repository:
useradd -m 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. As postgres who is the admin for a PostgreSQL installation, run:
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
The following steps are run as the omero system user.
Download, unzip and configure OMERO. The rest of this walkthrough assumes the OMERO.server is installed into the home directory of the omero system user.
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.
You will need to install the server corresponding to your Ice version.
Install server-ice36.zip:
cd ~omero
SERVER=http://downloads.openmicroscopy.org/latest/omero5.2/server-ice36.zip
wget $SERVER -O OMERO.server-ice36.zip
unzip -q OMERO.server*
Configure:
ln -s OMERO.server-*/ OMERO.server
OMERO.server/bin/omero config set omero.data.dir "$OMERO_DATA_DIR"
OMERO.server/bin/omero config set omero.db.name "$OMERO_DB_NAME"
OMERO.server/bin/omero config set omero.db.user "$OMERO_DB_USER"
OMERO.server/bin/omero config set omero.db.pass "$OMERO_DB_PASS"
OMERO.server/bin/omero db script -f OMERO.server/db.sql --password "$OMERO_ROOT_PASS"
psql -h localhost -U "$OMERO_DB_USER" "$OMERO_DB_NAME" < OMERO.server/db.sql
To deploy OMERO.web, you can use either Nginx or Apache. Follow the steps to install your chosen web server.
See also OMERO.web Nginx and Gunicorn deployment (Unix/Linux).
The following steps are run as root.
Install Nginx 1.8, copy the Nginx OMERO configuration file into the Nginx configuration directory, and disable the default configuration:
# require to install more recent version of nginx
# w/o the version installed is 1.4.6
add-apt-repository -y ppa:nginx/stable
apt-get update
apt-get -y install nginx
file=~omero/OMERO.server/share/web/requirements-py27-nginx.txt
pip install -r $file
#start-configure-nginx: As the omero system user, configure OMERO.web
OMERO.server/bin/omero config set omero.web.application_server wsgi-tcp
OMERO.server/bin/omero web config nginx --http "$OMERO_WEB_PORT" > OMERO.server/nginx.conf.tmp
#end-configure-nginx
cp ~omero/OMERO.server/nginx.conf.tmp /etc/nginx/sites-available/omero-web
rm /etc/nginx/sites-enabled/default
ln -s /etc/nginx/sites-available/omero-web /etc/nginx/sites-enabled/
service nginx start
See also DEPRECATED: OMERO.web Apache and mod_wsgi deployment (Unix/Linux).
As the omero system user, configure OMERO.web:
OMERO.server/bin/omero config set omero.web.application_server wsgi
OMERO.server/bin/omero web config apache24 --http "$OMERO_WEB_PORT" > OMERO.server/apache.conf.tmp
OMERO.server/bin/omero web syncmedia
The following steps are run as root.
Install Apache 2.4 and copy the Apache OMERO configuration file into the Apache configuration directory, and disable the default configuration:
apt-get -y install apache2 libapache2-mod-wsgi
# Install OMERO.web requirements
pip install -r ~omero/OMERO.server/share/web/requirements-py27-apache.txt
# Modify the default value set for the ``WSGISocketPrefix`` directive in ``apache.conf.tmp``
sed -i -r -e 's|(WSGISocketPrefix run/wsgi)|#\1|' -e 's|# (WSGISocketPrefix /var/run/wsgi)|\1|' ~omero/OMERO.server/apache.conf.tmp
cp ~omero/OMERO.server/apache.conf.tmp /etc/apache2/sites-available/omero-web.conf
a2dissite 000-default.conf
a2ensite omero-web.conf
service apache2 start
The following steps are run as the omero system user.
OMERO should now be set up. To start the server run:
OMERO.server/bin/omero admin start
If you deploy with Nginx, to start the OMERO.web client run:
OMERO.server/bin/omero web start
The last command is not necessary if you deploy with Apache.
Nginx or Apache should already be running so you should be able to log in as the OMERO root user by going to http://localhost/ in your web browser.
In addition some example init.d scripts are available should you wish to start OMERO and OMERO.web automatically:
cp omero-init.d /etc/init.d/omero
chmod a+x /etc/init.d/omero
cp omero-web-init.d /etc/init.d/omero-web
chmod a+x /etc/init.d/omero-web
update-rc.d -f omero remove
update-rc.d -f omero defaults 98 02
update-rc.d -f omero-web remove
update-rc.d -f omero-web defaults 98 02
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 ~omero/OMERO.server/etc ~omero/OMERO.server/var
# Optionally restrict access to the OMERO data directory
#chmod go-rwx "$OMERO_DATA_DIR"
The following steps are run as root.
The default OMERO.web session handler uses temporary files to store sessions which should be deleted at regular intervals, for instance by creating a cron job:
OMERO_USER=omero
OMERO_SERVER=/home/omero/OMERO.server
su - ${OMERO_USER} -c "${OMERO_SERVER}/bin/omero web clearsessions"
Copy the following commands into the appropriate location:
cp omero-web-cron /etc/cron.daily/omero-web
chmod a+x /etc/cron.daily/omero-web