Install Turtl Server in 10 minutes with Docker in Ubuntu

We already saw a tutorial about how to manually install your Turtl Server in Ubuntu, but there is a faster and lighter method to get at the same result, for this we have installed locally a turtl server in Ubuntu Server 16 LTS,

First : Install Ubuntu Server or Ubuntu (Both work, but as an unique server for turtl we will use the Ubuntu Server)

Second : Install Docker

Update apt and add the key and repo

The first thing to do is update apt. To do this, open a terminal window and issue the command sudo apt-get update. Once that finishes, a new GPG key must be added for the repository used to install Docker. To add the new key, issue the following command:

sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D

The next step is to add the Docker repository. From the terminal window, create the new file with the command sudo nano /etc/apt/sources.list.d/docker.list and add the following contents:

deb https://apt.dockerproject.org/repo ubuntu-xenial main

Save and close that file. Once again, update apt with the command sudo apt-get update.

Install the dependencies

Before we install Docker, there are a couple of dependencies that must be taken care of—these can all be handled with a single command. Go back to your terminal window and issue the following:

sudo apt-get install linux-image-extra-$(uname -r) linux-image-extra-virtual

You’re ready to install Docker.

Installing, starting, and testing Docker

Docker can now be installed with a single command. From the terminal, issue the following:

sudo apt-get install docker-engine

When the installation completes, you’ll want to add your user to the Docker group with the command:

sudo usermod -aG docker $USER

Once your user has been added, you can run the docker command as your standard user.

In order to run a Docker command, you must first fire up Docker with the command sudo service docker start. You can now test to make sure Docker is installed and running properly by downloading the hello-world test image. From the terminal window, issue the command docker run hello-world. The hello-world image will download and run.

Third : Download and Clone the Git TurtlServer at : https://github.com/ArthurGarnier/turtl-docker

Just do this command line :

sudo git clone https://github.com/ArthurGarnier/turtl-docker

After go to the main folder (turtl-docker)  :

cd turtl-docker/

Build the turtl docker (respect the space and .)  :

sudo docker build -t turtl_docker .
Wait a little bit, usually can take between 5 to 10 minutes, depending on your hardware,
When this process finish you’re done ! Turtl server is installed !
Final : Running and Configuring Turtl Server

How to run ?

sudo docker run -d -p 8181:8181 -v $(pwd)/volume:/var/lib/rethinkdb/instance1 -t turtl_docker

Configuration

The image supports the following environment variables that will be injected in the configuration at each restart of the container :

  • PIDFILE: defaults to ‘nil’
  • BINDADDR: defaults to ‘0.0.0.0’
  • BINDPORT: defaults to ‘8181’
  • PROD_ERR_HANDLING: defaults to ‘t’
  • FQDN: defaults to ‘turtl.local’
  • SITE_URL: defaults to ‘http://turtl.local
  • ADMIN_EMAIL: defaults to ‘[email protected]
  • EMAIL_FROM: defaults to ‘[email protected]
  • SMTP_USER: defaults to empty
  • SMTP_PASS: defaults to empty
  • DISPLAY_ERRORS: defaults to ‘t’
  • DEFAULT_STORAGE_LIMIT: defaults to 100
  • STORAGE_INVITE_CREDIT: defaults to 25
  • LOCAL_UPLOAD_URL: defaults to http://turtl.local
  • LOCAL_UPLOAD_PATH: defaults to “/opt/api/uploads”
  • AWS_S3_TOKEN: defaults to “(:token ” :secret ” :bucket ” :endpoint ‘https://s3.amazonaws.com‘)”

How to run behind an Apache proxy ? (safer)

First, listen only on localhost :

sudo docker run -d --name turtl -p 127.0.0.1:8181:8181 -v $(pwd)/volume:/var/lib/rethinkdb/instance1 -t turtl_docker

Secondly add your reverse proxy in Apache conf :

<VirtualHost *:443>
ServerName turtl.MYDOMAIN.com

SSLEngine on
SSLProtocol all -SSLv2 -SSLv3
SSLCipherSuite ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA
SSLHonorCipherOrder     on
SSLCompression          off
SSLOptions +StrictRequire
#If you're using let's encrypt
SSLCertificateFile /etc/letsencrypt/live/turtl.MYDOMAIN.com/cert.pem
SSLCertificateKeyFile /etc/letsencrypt/live/turtl.MYDOMAIN.com/privkey.pem
SSLCertificateChainFile /etc/letsencrypt/live/turtl.MYDOMAIN.com/chain.pem


ProxyPreserveHost On
ProxyRequests off
ProxyPass / http://127.0.0.1:8181/ Keepalive=On timeout=1600
ProxyPassReverse / http://127.0.0.1:8181/

    LogLevel info

    CustomLog ${APACHE_LOG_DIR}/turtl.log combined

</VirtualHost>

Now you can start your Turtl Client, and then enter in ‘Advanced Options’ the ip address of your Turtl server,
Please note, by default in this tutorial, my Ubuntu Server IP is set to 192.168.1.10, so i’ve put this :
http://192.168.1.10:8181 to communicate with my Turtl Server,

This tutorial is not finished yet, I’ve to resolve why the default domain name doesn’t work : http://turtl.local/

Thank you.

 

(Visited 37 times, 1 visits today)

Leave a comment

Your email address will not be published. Required fields are marked *