How to Install Focalboard on Ubuntu 20.04

Focalboard is an open-source, self-hosted alternative to Trello, Notion, and Asana. It's a project management tool that helps define, organize, track and manage work across teams, using a familiar kanban board view

Update the System.

apt update

apt upgrade

Install Focalboard

Download the focalboard packages and then move it into /opt/focalboard directory.

wget https://github.com/mattermost/focalboard/releases/download/v0.9.2/focalboard-server-linux-amd64.tar.gz
tar -xvzf focalboard-server-linux-amd64.tar.gz
mv focalboard /opt

Install NGINX

Now install NGINX using the following command. By default, the Focalboard server runs on port 8000.

apt install nginx

Adjust firewall settings as per your need. You can open port 8000 in the firewall or you can disable the firewall in your server.

Configure NGINX

Create a new config site.

nano /etc/nginx/sites-available/focalboard

Copy and paste this configuration.

upstream focalboard {
server localhost:8000;
keepalive 32;
}

server {
listen 80 default_server;

server_name focalboard.example.com;

location ~ /ws/* {
     proxy_set_header Upgrade $http_upgrade;
     proxy_set_header Connection "upgrade";
     client_max_body_size 50M;
     proxy_set_header Host $http_host;
     proxy_set_header X-Real-IP $remote_addr;
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     proxy_set_header X-Forwarded-Proto $scheme;
     proxy_set_header X-Frame-Options SAMEORIGIN;
     proxy_buffers 256 16k;
     proxy_buffer_size 16k;
     client_body_timeout 60;
     send_timeout 300;
     lingering_timeout 5;
     proxy_connect_timeout 1d;
     proxy_send_timeout 1d;
     proxy_read_timeout 1d;
     proxy_pass http://focalboard;
 }

 location / {
     client_max_body_size 50M;
     proxy_set_header Connection "";
     proxy_set_header Host $http_host;
     proxy_set_header X-Real-IP $remote_addr;
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
     proxy_set_header X-Forwarded-Proto $scheme;
     proxy_set_header X-Frame-Options SAMEORIGIN;
     proxy_buffers 256 16k;
     proxy_buffer_size 16k;
     proxy_read_timeout 600s;
     proxy_cache_revalidate on;
     proxy_cache_min_uses 2;
     proxy_cache_use_stale timeout;
     proxy_cache_lock on;
     proxy_http_version 1.1;
     proxy_pass http://focalboard;
   }
}

If there is a default site, then delete it.

rm /etc/nginx/sites-enabled/default

Test the config and reload NGINX using the following commands:

ln -s /etc/nginx/sites-available/focalboard /etc/nginx/sites-enabled/focalboard
nginx -t
/etc/init.d/nginx reload

Install Postgresql

To install Postgresql, run the following commands on the server.

apt install postgresql postgresql-contrib

Now login as a Postgres user to create a new database,

sudo -i -u postgres

psql

Currently, you are in psql prompt, run the following commands,

CREATE DATABASE focal;
CREATE USER focaluser WITH PASSWORD 'focaluser-password';
\q

Exit the session.

exit

Edit the Focalboard /opt/focalboard/config.json,

nano /opt/focalboard/config.json

Modify the dbconfig in the file with the Postgres database that was created.

"dbtype": "postgres",
"dbconfig": "postgres://boardsuser:boardsuser-password@localhost/boards?sslmode=disable&connect_timeout=10",

Move focalboard-server file in /opt/focalboard/ directory,

 mv /opt/focalboard/bin/focalboard-server /opt/focalboard/

Configure Focalboard Service

Create a new service config file,

nano /lib/systemd/system/focalboard.service

And paste the following lines into the file.

[Unit]
Description=Focalboard server

[Service]
Type=simple
Restart=always
RestartSec=5s
ExecStart=/opt/focalboard/focalboard-server
WorkingDirectory=/opt/focalboard

[Install]
WantedBy=multi-user.target

Make systemd reload the new unit, and enable it.

systemctl daemon-reload
systemctl start focalboard.service
systemctl enable focalboard.service

Enter the IP Address:8000 in the browser to open the focalboard. You will see the following screen.

image

You will see the Focalboard dashboard,

image

Done.


CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS