Saturday, December 28, 2024
Google search engine
HomeUncategorisedHow to Install Kanboard on CentOS 7 with Nginx and Let’s Encrypt...

How to Install Kanboard on CentOS 7 with Nginx and Let’s Encrypt SSL

This is a complete guide to install and configure Kanboard on CentOS 7 with Nginx web server, and optional Let’s Encrypt SSL certificate. Kanboard is a project management software that uses the Kanban methodology to help you visualize your workflow and complete tasks faster and efficiently.

Features of Kanboard

  • It is a free and open source
  • It enables you to customize your boards according to your business activities
  • Has native support for reports and analytics
  • You can have multiple projects with the ability to drag and drop tasks
  • Provides an easy to use web dashboard that can be accessed from anywhere with a modern browser
  • Capability to extend functionalities with plugins and integration to other external services

Kanboard on CentOS 7 setup

  • Database – By default Kanboard use SQLite but we will use MariaDB which is recommended for large teams.
  • Web Servers: We will install and configure Nginx.
  • PHP 7.2
  • Below are PHP extensions that will be can be installed:
PHP Extension Note
pdo_sqlite Only if you use SQLite
pdo_mysql Only if you use Mysql/MariaDB
pdo_pgsql Only if you use Postgres
gd
mbstring
openssl
json
hash
ctype
session
filter
xml
SimpleXML
dom

Optional PHP extensions

PHP Extension Note
zip Used to install plugins from the website
ldap Only for LDAP authentication

Install Kanboard on CentOS 7

Follow the steps below to install Kanboard on CentOS 7.

Step 1: Install MariaDB database server

Install MariaDB database server on your CentOS 7 server using the following guide:

Install MariaDB 10.x on Ubuntu 18.04 and CentOS 7

Once the installation is complete, create a database with a user. First, log in to the database CLI as a root user.

$ mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 39
Server version: 10.3.9-MariaDB-1:10.3.9+maria~bionic-log mariadb.org binary distribution

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]>

Then run the commands to create database and user with required privileges

CREATE DATABASE kanboard CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;;
GRANT ALL PRIVILEGES ON kanboard.* TO 'kanboard'@'localhost' IDENTIFIED BY 'StrongPassword';
FLUSH PRIVILEGES;
\q

Step 2: Install Nginx and PHP

Next, we can install the Nginx web server and required php extensions

sudo yum -y install http://rpms.remirepo.net/enterprise/remi-release-7.rpm
sudo yum -y install epel-release yum-utils
sudo yum-config-manager --disable remi-php54
sudo yum-config-manager --enable remi-php72
sudo yum -y install php php-{fpm,mbstring,cli,json,opcache,zip,xml,gd,ldap,mysql,json,sqlite3}

Install nginx

sudo yum -y install nginx

Step 3: Download and Install Kanboard

You have two options to download Kanboard:

  • From stable release
  • From Github development branch

To download a specific stable release of Kanboard, check Kanboard releases page. As of this writing, the latest release is version 1.2.5

export VER=1.2.5
wget https://github.com/kanboard/kanboard/archive/v${VER}.tar.gz
tar xvf v${VER}.tar.gz
rm -f v${VER}.tar.gz
sudo mv kanboard-${VER}/ /var/www/kanboard

To download development release, use

sudo git clone https://github.com/kanboard/kanboard.git /var/www/kanboard

Create a config file

Copy Kanboard configuration template.

sudo cp /var/www/kanboard/config.default.php /var/www/kanboard/config.php
sudo vim /var/www/kanboard/config.php

The file config.php should contain database access values.

// Database driver: sqlite, mysql or postgres (sqlite by default)
define('DB_DRIVER', 'mysql');

// Mysql/Postgres username
define('DB_USERNAME', 'kanboard');

// Mysql/Postgres password
define('DB_PASSWORD', 'StrongPassword');

// Mysql/Postgres hostname
define('DB_HOSTNAME', 'localhost');

// Mysql/Postgres database name
define('DB_NAME', 'kanboard');

This extensive configuration reference for Kanboard is helpful for proper configuration of other features like LDAP authentication, SMTP settings, Brute-force protection, Logging, Secure HTTP headers settings e.t.c.

Set Proper permissions

sudo chown -R nginx:nginx /var/www/kanboard

Configure php-fpm

Edit the file /etc/php-fpm.d/www.conf

Set like below

user = nginx
group = nginx
listen = /run/php-fpm/php7.2-fpm.sock
listen.owner = nginx
listen.group = nginx
listen.mode = 0660

Step 4: Configure Nginx

Create Nginx configuration file /etc/nginx/conf.d/kanboard.confwith the following content

server {
        listen       80;
        #listen       443 ssl;
	#ssl_certificate /etc/nginx/ssl/kanboard.crt;
	#ssl_certificate_key /etc/nginx/ssl/kanboard.key;
        server_name  kanboard.example.com;
        index        index.php;
        root         /var/www/kanboard;
        client_max_body_size 32M;

        location / {
            try_files $uri $uri/ /index.php$is_args$args;
        }

        location ~ \.php$ {
            try_files $uri =404;
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass unix:/run/php-fpm/php7.2-fpm.sock;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_index index.php;
            include fastcgi_params;
        }

        location ~* ^.+\.(log|sqlite)$ {
            return 404;
        }

        location ~ /\.ht {
            return 404;
        }

        location ~* ^.+\.(ico|jpg|gif|png|css|js|svg|eot|ttf|woff|woff2|otf)$ {
            log_not_found off;
            expires 7d;
            etag on;
        }

        gzip on;
        gzip_comp_level 3;
        gzip_disable "msie6";
        gzip_vary on;
        gzip_types
            text/javascript
            application/javascript
            application/json
            text/xml
            application/xml
            application/rss+xml
            text/css
            text/plain;
    }
Uncomment SSL configuration lines if you wish to use https

Using Let’s Encrypt SSL

This example is for http to https redirection and Let’s Encrypt SSL certificate

# HTTP

server {
	listen 80;
        server_name  kanboard.example.com;
        root         /var/www/kanboard;
	location / {
        	rewrite     ^ https://kanboard.example.com$request_uri? permanent;
    }
}
	
# HTTPS
server {
        listen       443 ssl;
	ssl_certificate /etc/letsencrypt/live/kanboard.example.com/fullchain.pem;
	ssl_certificate_key /etc/letsencrypt/live/kanboard.example.com/privkey.pem;
        server_name  kanboard.example.com;
        index        index.php;
        root         /var/www/kanboard;
        client_max_body_size 32M;

        location / {
            try_files $uri $uri/ /index.php$is_args$args;
        }

        location ~ \.php$ {
            try_files $uri =404;
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_pass unix:/run/php-fpm/php7.2-fpm.sock;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            fastcgi_index index.php;
            include fastcgi_params;
        }

        location ~* ^.+\.(log|sqlite)$ {
            return 404;
        }

        location ~ /\.ht {
            return 404;
        }

        location ~* ^.+\.(ico|jpg|gif|png|css|js|svg|eot|ttf|woff|woff2|otf)$ {
            log_not_found off;
            expires 7d;
            etag on;
        }

        gzip on;
        gzip_comp_level 3;
        gzip_disable "msie6";
        gzip_vary on;
        gzip_types
            text/javascript
            application/javascript
            application/json
            text/xml
            application/xml
            application/rss+xml
            text/css
            text/plain;
    }

Check configuration syntax

# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

If it returns OK then you can start nginx service

sudo systemctl restart php-fpm nginx
sudo systemctl enable php-fpm nginx

Step 5: Access Kanboard Web UI

Access  Kanboard Web UI by opening the link http://kanboard.example.com with your favorite web browser. Replace kanboard.example.com with your correct domain name.

kanboard ubuntu 18.04 login min

To login use:

Username: admin
Password: admin

You should get to a dashboard like below

kanboard ubuntu 18.04 admin dashboard min

Reset admin password

To be safe, reset admin password by navigating to Admin > Users Management > admin

kanboard ubuntu 18.04 change admin pass 01 min

kanboard ubuntu 18.04 change admin pass 02 min

That’s all. You now have a working Kanboard on CentOS 7 server. To further tune your Kanboard, refer to Admin guide.

RELATED ARTICLES

Most Popular

Recent Comments