Install and Configure Kanboard on Ubuntu 22.04

By Raman Kumar

Updated on Jul 18, 2024

In this tutorial, we'll explain how to install and configure Kanboard on Ubuntu 22.04 with Apache for web server and secure with free SSL certificate.

Kanboard is an open-source project management software that uses Kanban boards to visualize tasks and projects. This tutorial will guide you through the steps to install and configure Kanboard on a Linux server.

Prerequisites

  • A Ubuntu 20.04/22.04 dedicated server or KVM VPS.
  • A user with sudo privileges.
  • Basic knowledge of command-line operations.

Step 1: Update Your System

First, ensure your system is up to date by running the following commands:

sudo apt update
sudo apt upgrade -y

Step 2: Install Apache Web Server

Kanboard can run on Apache or Nginx. In this tutorial, we will use Apache. Install Apache with the following command:

sudo apt install apache2 -y

Step 3: Install PHP and Required Extensions

Kanboard requires PHP and several extensions. Install them with the following command:

sudo apt install php libapache2-mod-php php-pgsql php-gd php-json php-mbstring php-curl php-intl php-xml php-zip -y

Step 4: Download Kanboard

Download the latest version of Kanboard from the official website or use wget to download it directly:

cd /var/www/html
sudo wget https://github.com/kanboard/kanboard/archive/refs/heads/master.zip -O kanboard.zip
sudo unzip kanboard.zip
sudo mv kanboard-main kanboard

Set the necessary permissions for Kanboard to function correctly:

sudo chown -R www-data:www-data /var/www/html/kanboard
sudo chmod -R 755 /var/www/html/kanboard

Step 5: Install and Configure PostgreSQL

First, install PostgreSQL on your server:

sudo apt install postgresql postgresql-contrib -y

Now, configure PostgreSQL. Switch to the PostgreSQL user:

sudo -i -u postgres

Create a new PostgreSQL user and database for Kanboard:

createuser kanboard_user -P
createdb -O kanboard_user kanboard_db

You will be prompted to set a password for the kanboard_user.

Exit the PostgreSQL shell:

exit

Configure Kanboard to Use PostgreSQL

Edit the Kanboard configuration file to use PostgreSQL:

sudo cp /var/www/html/kanboard/config.default.php /var/www/html/kanboard/config.php
sudo nano /var/www/html/kanboard/config.php

Add or update the following lines in the configuration file:

define('DB_DRIVER', 'postgres');
define('DB_USERNAME', 'kanboard_user');
define('DB_PASSWORD', 'your_password');
define('DB_HOSTNAME', '127.0.0.1');
define('DB_NAME', 'kanboard_db');

Note: Replace your_password with the password you set for kanboard_user.

Step 6: Configure Apache

Create a new Apache configuration file for Kanboard:

sudo nano /etc/apache2/sites-available/kanboard.conf

Add the following content to the file:

<VirtualHost *:80>
    ServerAdmin admin@example.com
    DocumentRoot /var/www/html/kanboard
    ServerName example.com

    <Directory /var/www/html/kanboard>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Note: Replace example.com with your domain name.

Enable the new site and rewrite module:

sudo a2ensite kanboard.conf
sudo a2enmod rewrite
sudo systemctl restart apache2

Step 7: Configure Firewall

We need to add HTTP and HTTPS port in the firewall.

ufw allow 80/tcp
ufw allow 443/tcp
ufw reload

Step 8: Secure Kanboard with HTTPS (Optional)

To secure your Kanboard installation with HTTPS, you can use Let's Encrypt to obtain a free SSL certificate. Install Certbot and obtain a certificate:

sudo apt install certbot python3-certbot-apache -y
sudo certbot --apache -d example.com

Follow the prompts to complete the setup. Certbot will automatically configure Apache to use the new SSL certificate.

Step 9: Access Kanboard

Open your web browser and navigate to https://example.com. You should see the Kanboard login page. Default username and password is admin.

Conclusion

You have successfully we seen how to install and configure Kanboard on Ubuntu 22.04. You can now start managing your projects and tasks using Kanban boards.