How to Install Taiga Project Management System on Ubuntu 20.04

Taiga is a free, open-source, simple yet powerful project management tool for startups, Agile developers, and designers. It supports teams that work Agile across both Scrum and Kanban frameworks. The frontend is written in JavaScript while the backend is written in Python and Django. It is very powerful and entirely customizable application and can handle both simple and complex projects for developers and teams. It can be integrated easily with many services including, Kanban, Scrum, Talky.io, and Appear.in.

In this tutorial, we will show you how to install the Taiga Project Management Tool on Ubuntu 20.04 server.

Prerequisites

  • A server running Ubuntu 20.04.
  • A valid domain name pointed with your server IP.
  • A root password is configured the server.

Getting Started

First, update your system packages to the latest version with the following command:

apt-get update -y

Once all the packages are updated, install other dependencies required for Taiga by running the following command:

apt-get install git gnupg2 pwgen automake wget curl gettext python3 virtualenvwrapper python3-dev python3-pip python3-dev libssl-dev tmux build-essential libgdbm-dev binutils-doc autoconf flex gunicorn bison libjpeg-dev libzmq3-dev libfreetype6-dev zlib1g-dev libncurses5-dev libtool libxslt-dev libxml2-dev libffi-dev

Next, you will need to set up a fully qualified hostname to your system. You can set it with the following command:

hostnamectl set-hostname taiga.example.com

Next, you will need to bind your hostname with your IP address. You can do it by editing the file /etc/hosts:

nano /etc/hosts

Add the following lines:

your-server-ip taiga.example.com

Save and close the file when you are finished.

Install Node.js

Next, you will need to install Node.js to your system. By default, the latest version of Node.js is not available in the Ubuntu 20.04 default repository. So you will need to add the Node.js repository to your system. You can add it with the following command:

curl -sL https://deb.nodesource.com/setup_12.x | bash -

Once the repository is added, install the latest version of Node.js with the following command:

apt-get install nodejs -y

After installing Node.js, verify the installed version of Node.js with the following command:

node -v

You should get the following output:

v12.19.0

Install and Configure PostgreSQL

Taiga uses PostgreSQL server as a database backend. So you will need to install it in your system. First, add the PostgreSQL GPG key with the following command:

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add -

Next, add the PostgreSQL repository with the following command:

echo "deb http://apt.postgresql.org/pub/repos/apt/ focal-pgdg main" | tee /etc/apt/sources.list.d/pgdg.list

Next, update the repository and install the latest version of PostgreSQL with the following command:

apt-get update -y
apt-get install postgresql -y

Next, change the PostgreSQL password with the following command:

passwd postgres

You should get the following output:

New password: 
Retype new password: 
passwd: password updated successfully

Next, switch the user to postgres and create a user for Taiga:

su - postgres
[email protected]:~$ createuser taiga

Next, login to PostgreSQL shell with the following command:

[email protected]:~$ psql

Output:

psql (13.0 (Ubuntu 13.0-1.pgdg20.04+1))
Type "help" for help.

Once login, create a user and database with the following command:

postgres=# ALTER USER taiga WITH ENCRYPTED password 'yourpassword';
postgres=# CREATE DATABASE taiga OWNER taiga;

Next, exit from the PostgreSQL shell and user with the following command:

postgres=# \q
[email protected]:~$ exit

Install RabbitMQ and Redis

Taiga uses RabbitMQ as a message broker and Redis for caching. So you will need to install both packages in your system. You can install both packages with the following command:

apt-get install rabbitmq-server redis-server -y

Next, create a new user and virtual host for RabbitMQ with the following command:

rabbitmqctl add_user taiga yourpassword
rabbitmqctl add_vhost taiga
rabbitmqctl set_permissions -p taiga taiga ".*" ".*" ".*"

Once you are finished, you can proceed to the next step.

Install and Configure Taiga Backend

First, create a separate user for Taiga with the following command:

adduser taiga

Next, add the Taiga user to the sudo group using the following command:

adduser taiga sudo

Next, change the user to taiga and create a directory to store taiga logs:

su - taiga
mkdir -p ~/logs

Next, download the Taiga backend from the Git repository with the following command:

git clone https://github.com/taigaio/taiga-back.git

Next, change the directory to the downloaded directory and check out the latest branch:

cd taiga-back
git checkout stable

Next, activate the mkvirtualenv command with the following command:

nano ~/.bashrc

Add the following line:

source '/usr/share/virtualenvwrapper/virtualenvwrapper.sh'

Activate the new profile with the following command:

source ~/.bashrc

Next, create a Python virtual environment for Taiga:

mkvirtualenv -p /usr/bin/python3 taiga_venv

Next, install all the required dependencies with the following command:

pip3 install -r requirements.txt

Next, migrate and load the data with the following command:

python3 manage.py migrate --noinput
python3 manage.py loaddata initial_user
python3 manage.py loaddata initial_project_templates
python3 manage.py compilemessages
python3 manage.py collectstatic --noinput

Next, you will need to edit local.py file and define your application and databse settings:

nano ~/taiga-back/settings/local.py

Add the following lines:

from .common import *

MEDIA_URL = "http://taiga.example.com/media/"
STATIC_URL = "http://taiga.example.com/static/"
SITES["front"]["scheme"] = "http"
SITES["front"]["domain"] = "taiga.example.com"

SECRET_KEY = "OQOEJNSJIQHDBQNSUQEJSNNANsqQPAASQLSMSOQND"

DEBUG = False
PUBLIC_REGISTER_ENABLED = True

DEFAULT_FROM_EMAIL = "[email protected]"
SERVER_EMAIL = DEFAULT_FROM_EMAIL

#CELERY_ENABLED = True

EVENTS_PUSH_BACKEND = "taiga.events.backends.rabbitmq.EventsPushBackend"
EVENTS_PUSH_BACKEND_OPTIONS = {"url": "amqp://taiga:[email protected]:5672/taiga"}

Save and close the file then start the Taiga backend server with the following command:

workon taiga_venv
python manage.py runserver

Once the server is started successfully, you should get the following output:

System check identified no issues (0 silenced).
November 02, 2020 - 09:24:41
Django version 2.2.16, using settings 'settings'
Starting development server at http://127.0.0.1:8000/
Quit the server with CONTROL-C.

Press CTRL + C to stop the server.

Next, deactivate the virtual environment with the following command:

deactivate

Install and Configure Taiga Forntend

First, change the user to Taiga and download the latest version of Taiga frontend from the Git repository:

su - taiga
git clone https://github.com/taigaio/taiga-front-dist.git

Change the directory to the downloaded directory and check out the latest stable branch with the following command:

cd taiga-front-dist
git checkout stable

Next, copy the sample configuration file with the following command:

cp ~/taiga-front-dist/dist/conf.example.json ~/taiga-front-dist/dist/conf.json

Next, edit the configuration file with the following command:

nano ~/taiga-front-dist/dist/conf.json

Change the following lines:

{
    "api": "http://taiga.example.com/api/v1/",
    "eventsUrl": "ws://taiga.example.com/events",
    "eventsMaxMissedHeartbeats": 5,
    "eventsHeartbeatIntervalTime": 60000,
    "eventsReconnectTryInterval": 10000,
    "debug": true,
    "debugInfo": false,
    "defaultLanguage": "en",
    "themes": ["taiga"],
    "defaultTheme": "taiga",
    "publicRegisterEnabled": true,
    "feedbackEnabled": true,
    "supportUrl": "https://tree.taiga.io/support",
    "privacyPolicyUrl": null,
    "termsOfServiceUrl": null,
    "GDPRUrl": null,
    "maxUploadFileSize": null,
    "contribPlugins": [],
    "tribeHost": null,
    "importers": [],
    "gravatar": true,
    "rtlLanguages": ["fa"]
}

Save and close the file when you are finished.

Install and Configure Taiga Event

Next, go to your home directory and download the latest version of Taiga event with the following command:

cd ~
git clone https://github.com/taigaio/taiga-events.git taiga-events

Next, change the directory to the downloaded directory and install all NPM modules with the following command:

cd taiga-events
npm install

Next, copy the sample configuration file with the following command:

cp config.example.json config.json

Next, edit the config.json file and set rabbitmq URL and the secret key::

nano config.json

Add / modify the following lines:

{
    "url": "amqp://taiga:[email protected]:5672/taiga",
    "secret": "OQOEJNSJIQHDBQNSUQEJSNNANsqQPAASQLSMSOQND",
    "webSocketServer": {
        "port": 8888
    }
}

Save and close the file then logout from the Taiga user with the following command:

exit

Create a Systemd Service File

Next, you will need to create a systemd service file for Taiga and Taiga event. First, create a systemd service file for Taiga event with the following command:

nano /etc/systemd/system/taiga_events.service

Add the following lines:

[Unit]
Description=taiga_events
After=network.target

[Service]
User=taiga
WorkingDirectory=/home/taiga/taiga-events
ExecStart=/bin/bash -c "node_modules/coffeescript/bin/coffee index.coffee"
Restart=always
RestartSec=3

[Install]
WantedBy=default.target

Save and close the file then reload the systemd service with the following command:

systemctl daemon-reload

Next, start the Taiga event service and enable it to start at system reboot with the following command:

systemctl start taiga_events
systemctl enable taiga_events

Next, create a systemd service file for Taiga with the following command:

nano /etc/systemd/system/taiga.service

Add the following lines:

[Unit]
Description=taiga_back
After=network.target

[Service]
User=taiga
Environment=PYTHONUNBUFFERED=true
WorkingDirectory=/home/taiga/taiga-back
ExecStart=/home/taiga/.virtualenvs/taiga_venv/bin/gunicorn --workers 4 --timeout 60 -b 127.0.0.1:8001 taiga.wsgi
Restart=always
RestartSec=3

[Install]
WantedBy=default.target

Save and close the file then reload the systemd service with the following command:

systemctl daemon-reload

Next, start the Taiga service and enable it to start at system reboot with the following command:

systemctl start taiga
systemctl enable taiga

Next, verify the status of the Taiga event and Taiga service with the following command:

systemctl status taiga_events taiga

You should see the following output:

? taiga_events.service - taiga_events
     Loaded: loaded (/etc/systemd/system/taiga_events.service; disabled; vendor preset: enabled)
     Active: active (running) since Mon 2020-11-02 09:30:21 UTC; 46s ago
   Main PID: 26383 (node)
      Tasks: 7 (limit: 2353)
     Memory: 15.2M
     CGroup: /system.slice/taiga_events.service
             ??26383 node node_modules/coffeescript/bin/coffee index.coffee

Nov 02 09:30:21 taiga.example.com systemd[1]: Started taiga_events.

? taiga.service - taiga_back
     Loaded: loaded (/etc/systemd/system/taiga.service; disabled; vendor preset: enabled)
     Active: active (running) since Mon 2020-11-02 09:30:55 UTC; 13s ago
   Main PID: 26478 (gunicorn)
      Tasks: 5 (limit: 2353)
     Memory: 266.4M
     CGroup: /system.slice/taiga.service
             ??26478 /home/taiga/.virtualenvs/taiga_venv/bin/python /home/taiga/.virtualenvs/taiga_venv/bin/gunicorn --workers 4 --timeout 60 >
             ??26494 /home/taiga/.virtualenvs/taiga_venv/bin/python /home/taiga/.virtualenvs/taiga_venv/bin/gunicorn --workers 4 --timeout 60 >
             ??26495 /home/taiga/.virtualenvs/taiga_venv/bin/python /home/taiga/.virtualenvs/taiga_venv/bin/gunicorn --workers 4 --timeout 60 >
             ??26496 /home/taiga/.virtualenvs/taiga_venv/bin/python /home/taiga/.virtualenvs/taiga_venv/bin/gunicorn --workers 4 --timeout 60 >
             ??26497 /home/taiga/.virtualenvs/taiga_venv/bin/python /home/taiga/.virtualenvs/taiga_venv/bin/gunicorn --workers 4 --timeout 60 >

Nov 02 09:30:55 taiga.example.com gunicorn[26495]: [2020-11-02 09:30:55 +0000] [26495] [INFO] Booting worker with pid: 26495
Nov 02 09:30:55 taiga.example.com gunicorn[26496]: [2020-11-02 09:30:55 +0000] [26496] [INFO] Booting worker with pid: 26496
Nov 02 09:30:55 taiga.example.com gunicorn[26494]: Trying import local.py settings...
Nov 02 09:30:55 taiga.example.com gunicorn[26495]: Trying import local.py settings...
Nov 02 09:30:55 taiga.example.com gunicorn[26497]: Trying import local.py settings...
Nov 02 09:30:55 taiga.example.com gunicorn[26497]: 2020-11-02 09:30:55 +0000] [26497] [INF
Nov 02 09:30:55 taiga.example.com gunicorn[26495]: 2
Nov 02 09:30:55 taiga.example.com gunicorn[26496]: 2
Nov 02 09:30:55 taiga.example.com gunicorn[26496]: rying import local.py settings...
Nov 02 09:30:55 taiga.example.com gunicorn[26497]: rying import local.py settings...

Configure Nginx as a Reverse Proxy

It is a good idea to configure the Nginx as a reverse proxy for Taiga. First, install the Nginx with the following command:

apt-get install nginx -y

Once installed, create an Nginx virtual host configuration file with the following command:

nano /etc/nginx/conf.d/taiga.conf

Add the following lines:

server {
    listen 80;
    server_name taiga.example.com;

    large_client_header_buffers 4 32k;
    client_max_body_size 50M;
    charset utf-8;

    access_log /home/taiga/logs/nginx.access.log;
    error_log /home/taiga/logs/nginx.error.log;

    # Frontend
    location / {
        root /home/taiga/taiga-front-dist/dist/;
        try_files $uri $uri/ /index.html;
    }

    # Backend
    location /api {
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://127.0.0.1:8001/api;
        proxy_redirect off;
    }

    # Admin access (/admin/)
    location /admin {
        proxy_set_header Host $http_host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Scheme $scheme;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_pass http://127.0.0.1:8001$request_uri;
        proxy_redirect off;
    }

    # Static files
    location /static {
        alias /home/taiga/taiga-back/static;
    }

    # Media files
    location /media {
        alias /home/taiga/taiga-back/media;
    }

    # Events
    location /events {
        proxy_pass http://127.0.0.1:8888/events;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_connect_timeout 7d;
        proxy_send_timeout 7d;
        proxy_read_timeout 7d;
    }
}

Save and close the file then restart the Nginx to apply the changes:

systemctl restart nginx

Access Tails Web UI

Now, open your web browser and access the Taiga web interface using the URL http://taiga.example.com. You will be redirected to the following page:

Taiga GUI

Click on the Login button. You will be redirected to the following page:

Taiga Login

Provide the default username as admin and the password as 123123 the click on the LOGIN button. You should see the Taiga dashboard in the following page:

Taiga Dashboard

Conclusion

Congratulations! you have successfully installed and configured the Taiga project management tool with Nginx on Ubuntu 20.04. You can now deploy Taiga in your development environment and start working on it.

Share this page:

Suggested articles

1 Comment(s)

Add comment

Comments

By: Milan at: 2020-11-12 11:03:19

Where should we set, and how, the database user and password?