How to Install Focalboard on Ubuntu 20.04

Updated on January 26, 2022
How to Install Focalboard on Ubuntu 20.04 header image

Introduction

This tutorial explains how to install Focalboard Personal Server with Docker on Ubuntu 20.04. It also describes how to secure your Focalboard installation with an Nginx reverse proxy and a Let's Encrypt SSL certificate to secure your server. Focalboard is a free, open-source alternative to Trello, Asana, and Notion, which helps you organize, track, and manage your work and projects.

Prerequisites

Before you begin, you should:

Installation

  1. Install Nginx using apt.

     $ sudo apt install nginx
  2. Ensure that any apt versions of Certbot are uninstalled, as well as old versions of Docker. It is okay if apt reports that none of these packages are installed.

     $ sudo apt remove certbot docker docker.io containerd runc
  3. Ensure that your version of Snap is up to date.

     $ sudo snap install core; sudo snap refresh core
  4. Install Certbot with Snap.

     $ sudo snap install --classic certbot
  5. Run Certbot and follow the prompts to enter your domain name and redirect all traffic to HTTPS.

     $ sudo certbot certonly --standalone
  6. Take note of your certificate and private key paths when provided. It may be different depending on the domain used.

     Certificate Path: /etc/letsencrypt/live/example.com/fullchain.pem
     Private Key Path: /etc/letsencrypt/live/example.com/privkey.pem

    If you used a different SSL provider, ensure the certificate and private key files are stored somewhere on your system and that you know the full path to them.

  7. Install Docker with Snap.

     $ sudo snap install docker
  8. Create a new folder and change to it.

     $ mkdir focalboard
     $ cd focalboard
  9. Create a new Docker compose file.

     $ nano docker-compose.yml
  10. Add the following lines to the file.

     version: '3.8'
     services:
       focalboard:
          ports:
             - '8000:8000'
          restart: always
          image: mattermost/focalboard
  11. Exit the file using Control + X, then press Y, followed by Enter.

  12. Run Focalboard by using docker-compose in detached mode. This may take a few seconds.

     $ sudo docker-compose up -d
  13. Check that Focalboard is running by using docker. The status should be Up.

     $ sudo docker ps
     STATUS
     Up x seconds/minutes

You have now successfully installed Focalboard and have obtained a signed SSL certificate.

Secure Focalboard with an Nginx Reverse Proxy

You can now use your SSL certificate and Nginx to secure your Focalboard installation. Make sure to replace example.com with your chosen domain name or IP address.

  1. Remove the Nginx default configuration file.

     $ sudo rm /etc/nginx/sites-enabled/default
  2. Create and open the new configuration file in Nginx's sites-available directory in your text editor.

     $ sudo nano /etc/nginx/sites-available/focalboard
  3. Paste the following into the file and replace example.com with your domain name or IP address. Ensure that the ssl_certificate and ssl_certificate_key lines point to your SSL certificate.

     upstream focalboard {
       server localhost:8000;
     }
    
     server {
       listen 443 ssl http2;
       server_name example.com;
    
       gzip on;
    
       ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
       ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
       ssl_session_cache builtin:1000 shared:SSL:10m; 
       ssl_session_cache shared:MySSL:10m;
       ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
       ssl_ciphers HIGH:!aNULL:!eNULL:!EXPORT:!CAMELLIA:!DES:!MD5:!PSK:!RC4;
       ssl_prefer_server_ciphers on;
    
       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_pass http://focalboard;
       }
     }
  4. Exit your text editor and save changes by pressing Control + X, then Y, followed by Enter.

  5. Create a link to the new configuration file in Nginx's sites-enabled directory.

     $ sudo ln -s /etc/nginx/sites-available/focalboard /etc/nginx/sites-enabled/focalboard.conf
  6. Test the configuration file. If the test is successful, you will see the success messages.

     $ sudo nginx -t
     nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
     nginx: configuration file /etc/nginx/nginx.conf test is successful
  7. Reload Nginx to apply your changes.

     $ sudo /etc/init.d/nginx reload

Finishing Steps

You should now navigate to your Focalboard installation and create an account.

https://example.com

After you log in, you can create a new board by clicking the + Add board button in the bottom left corner.

This completes the Focalboard installation with an SSL certificate and Nginx reverse proxy.

Documentation