Server instance Setup

Step by step how-to instructions on installing and running KoBo Toolbox on a standalone server.
Jump to: navigation, search

Install Ubuntu Xenial on the target hosting server

The installation can be absolutely minimal; a few software packages that are required on the hosting server itself will be configured along the way. In most cases, this step will be performed by your ICT department, Internet Service Provider or the Support specialist.

Firstly, add the *nano* editor:

$ sudo apt-get install nano

Name the server and set the timezone

$ sudo nano /etc/hostname
$ sudo nano /etc/hosts       localhost  GATITUX.MSF.ORG GATITUX
$ sudo dpkg-reconfigure tzdata
$ sudo apt-get install ntp

Update DNS resolver, if necessary

$ sudo nano /etc/resolv.conf
search MSF.ORG

Local SMTP server

Different services running on the Host will attempt sending emails. Our own kobo-backup script, for example, will email its output through cron handler. Unattended OS upgrades will also try to email notifications, etc. A system-wide sendmail service, which is a commonplace on Unix/Linux installations, is required to handle all those.

Please note: The KoBo Toolbox itself does not require sendmail functions, it rather uses external SMTP service configured in Kobo Docker Setup.

A fully functional ESMTP server, like Postfix or Exim, can be installed on the Host. Configuring ESMTP server can be a daunting task even for a professional Unix admin, and is out of the scope of this manual. In short, challenges are

  • SMTP configuration: message headers, including security info, are the deciding factor for successful delivery (i.e. avoiding blacklists, rejections and spam filters)
  • Security configuration: SMTP servers are prone to unsolicited sending if not configured tightly, spamming en-masse using Host's resources and bandwidth.

Instead, we are going to use an SMTP server surrogate, which will provide sendmail services on the Host using an external Email service with a standard mailbox access. Since there is actually no SMTP server, security aspect mentioned above does not apply, while SMTP configuration aspect is handled by the external service, in this case

We will use package ssmtp, which is included in most Ubuntu Xenial images. If it is not pre-installed, you can add it with apt-get install ssmtp.

$ sudo nano /etc/ssmtp/ssmtp.conf
$ sudo nano /etc/ssmtp/revaliases

Try sending a test email:

$ echo "This is a test message" | sudo mail -s "Test subject"

Why sudo? The Linux user that initiates needs to be defined in revaliases above, and currently root is the only local user there.

Install Docker engine

The process is exceptionally straigh-forward; just a few short commands to get to the first test: hello-world container doing what it does best. For additional information, please refer to official Installation Guide for Ubuntu.

$ sudo apt-get install apt-transport-https ca-certificates
$ sudo apt-get install linux-image-extra-$(uname -r)
$ sudo apt-get install apparmor git docker-engine
$ sudo service docker start
$ sudo docker run hello-world
Unable to find image 'hello-world:latest' locally
latest: Pulling from library/hello-world
c04b14da8d14: Pull complete
Digest: sha256:0256e8a36e2070f7bf2d0b0763dbabdd67798512411de4cdcf9431a1feb60fd9
Status: Downloaded newer image for hello-world:latest

Hello from Docker!
This message shows that your installation appears to be working correctly.
$ sudo curl -L`uname -s`-`uname -m` > /usr/local/bin/docker-compose
$ docker-compose --version