In this article we are going to show to deploy taiga. The Taiga platform consists of three main components and each one has its own dependencies both at compile time and runtime. This component built with taiga make it very much eaiser to maintain taiga and to deploy them, additional it has some performance benefits since they can run saparetly, also you can have more than one component, in case one fails they other can tak off where they other left off.
Taiga's main components
- Taiga-back (backend/api)
- Taiga-front-dist (frontend)
- Taiga-events (websockets gateway) (optional)
Each component can be run on one unique machine or all of them can be installed to a different machine aswell. This type of setup should suffice for small/medium production environments. If you choose separate machine for for each component they probably you will have performance.
In this tutorial we are going to be using a clean, recently updated Ubuntu 19.04 from google compute engine. Due to the nature of the frontend, Taiga is used through a domain/public-ip, because the frontend application runs in your browser. The frontend must be able to communicate with the backend/API. Google compute engine gives you a public ip but you have be having a domain running for example taiga-api.nmmapper.com. The installation of taiga it is recommeneded to do it with a regular user and not with root previledges.
Before we continue ensure that you have the following information setup correctly.
- Public IP accessible from outside
- Hostname like nmmapper.com
- Username taiga(You have to create this user)
- System Ram > 1GB
- Working directory /home/taiga( This will be created automatically created when you create a taiga user)
- Subdomain name taiga-api.nmmapper.com( This is the one that we will use with the backend )
System Architecture( A must read )
Before you go any further in the installation, make sure you read this description to get a high-level overview. Taiga consists of 2 core (mandatory) modules as described earlier on that is taiga-backend and taiga-frontend.
Taiga-back is written in django, python3 and serves API endpoints for the frontend. Taiga-front is written mostly in angularjs and coffeescript and depends on the backend.
The backend which is entirely written in python, is managed by Gunicorn and runs on port 9001 localhost it's not exposed for public access, the process manager that handles and manages Gunicorn is systemd coordinate even the backend entirely. The backend then communicates with the database which is Postgresql and through the frontend. Thus the communicate between the backend and the frontend is done by API.
Since gunicorn which handles backend activity is not exposed publically on port 9001, the backend is publically exposed using Nginx which acts as a reverse-proxy for this case. The frontend is located in the
dist folder and is exposed publicly by nginx which acts as a static webserver for this case
Install all dependencies for all modules, including the optional modules and services
sudo apt-get update
sudo apt-get install -y build-essential binutils-doc autoconf flex bison libjpeg-dev
sudo apt-get install -y libfreetype6-dev zlib1g-dev libzmq3-dev libgdbm-dev libncurses5-dev
sudo apt-get install -y automake libtool curl git tmux gettext
sudo apt-get install -y nginx
sudo apt-get install -y rabbitmq-server redis-server
Run the following to install the latested version provided in ubuntu 19.04 which is version 11
sudo apt-get install -y postgresql
Python (3) and virtualenvwrapper must be installed along with a few third-party libraries:
sudo apt-get install -y python3 python3-pip python3-dev virtualenvwrapper
sudo apt-get install -y libxml2-dev libxslt-dev
sudo apt-get install -y libssl-dev libffi-dev
Create a user named Taiga and we shall give him root priledges.
sudo adduser taiga
sudo adduser taiga sudo
sudo su taiga
Configuring Taiga Dependencies
By now one of the most important things is to Configure postgresql with the initial user and database.
sudo -u postgres createuser taiga sudo -u postgres createdb taiga -O taiga --encoding='utf-8' --locale=en_US.utf8 --template=template0
Also Create a user named
taiga, and a virtualhost for RabbitMQ (taiga-events)
sudo rabbitmqctl add_user taiga PASSWORD_FOR_EVENTS sudo rabbitmqctl add_vhost taiga sudo rabbitmqctl set_permissions -p taiga taiga ".*" ".*" ".*"
Cloning Taiga-backend code
cd ~ git clone https://github.com/taigaio/taiga-back.git taiga-back cd taiga-back git checkout stable
Additional package to run mkvirtualenv
sudo apt-get install -y python3 python3-pip python3-dev virtualenvwrapper sudo apt-get install -y libxml2-dev libxslt-dev sudo apt-get install -y libssl-dev libffi-dev
Create Virtualen named taiga
virtualenv -p /usr/bin/python3 taiga
pip install -r requirements.txt