In this tutorial I will install get Tryton using Docker, the fastest way to host Tryton for evaluation. The Tryton project provides a Docker container for use on Ubuntu Linux, which I will host a virtual machine on a FreeBSD host.
Create Virtual Machine
Install Ubuntu 20.04 using the Ubuntu distribution DVD ISO and using the startup wizard configure appropriately.
Copy your user ssh key to the new server and disable password login.
Configure vm port forwarding. Port forwarding with VirtualBox must be done with the vm powered off.
Name: ssh
Protocol: TCP
Host Port: 8000
Guest Port: 8000
Update Server OS
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get dist-upgrade
Install Docker
$ sudo apt install docker.io
Install Tryton
$ sudo docker pull tryton/tryton
Start a PostgreSQL instance
The Tryton image will be pulled from library/postgres
$ sudo docker run --name tryton-postgres -e POSTGRES_PASSWORD=mysecretpassword -e POSTGRES_DB=tryton -d postgres
Setup the database
$ sudo docker run --link tryton-postgres:postgres -e DB_PASSWORD=mysecretpassword -it tryton/tryton trytond-admin -d tryton --all
The script will prompt for:
- “admin” email for “tryton”
- “admin” password for “tryton”
Store the password in a key vault for safe future reference.
Start Tryton Instance
$ sudo docker run --name tryton -p 8000:8000 --link tryton-postgres:postgres -e DB_PASSWORD=mysecretpassword -d tryton/tryton
Start Tryton cron Instance
$ sudo docker run --name tryton-cron --link tryton-postgres:postgres -e DB_PASSWORD=mysecretpassword -d tryton/tryton trytond-cron -d tryton
Create bash Startup Script
Without further configuration the Docker container will not start automatically when the server starts. While it is possible to configure Tryton to automatically start, I have created a simple bash script for convenience to start Tryton manually.
dale@starlord:~$ cat start-tryton.sh
#!/bin/bash
# run using sudo
docker start tryton-postgres tryton tryton-cron
dale@starlord:~$
References
- Install: https://hub.docker.com/r/tryton/tryton/
- Setup: https://nextcloud.rollentausch.eu/index.php/s/SKZfnCFP4YKYZJE
One Reply to “Install Tryton using Docker on Ubuntu”