X
    Categories: Tutorials

How to install Kanboard on a CentOS 7 VPS

In this tutorial, we will explain how to install Kanboard on a CentOS 7 VPS with MariaDB, PHP-FPM 5.6 and Nginx. Kanboard is a PHP open source project management software that use the Kanban methodology. Kanboard focus on simplicity and minimalism and it is designed for small teams. This guide should work on other Linux VPS systems as well but was tested and written for CentOS 7 VPS.

Login to your VPS via SSH

ssh user@myVPS

Update the system and install necessary packages

[user]$ sudo yum -y upgrade
[user]$ sudo yum install unzip wget

Install MariaDB

MariaDB 5.5 is shipped in the default CentOS 7 repository, to install it just run:

[user]$ sudo yum install mariadb-server

To start the MariaDB service and enable it to start on boot, execute the following commands:

[user]$ sudo systemctl start mariadb.service
[user]$ sudo systemctl enable mariadb.service

Run the following command to secure your installation:

[user]$ sudo mysql_secure_installation

Next, we need to create a database for our Kanboard instance.

[user]$ mysql -uroot -p
MariaDB [(none)]> CREATE DATABASE kanboard;
MariaDB [(none)]> GRANT ALL PRIVILEGES ON kanboard.* TO 'kanboarduser'@'localhost' IDENTIFIED BY 'kanboarduser_passwd';
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> \q

Install PHP and Nginx

Nginx is not available in the default CentOS 7 repository so we will use the official Nginx repository:

[user]$ sudo rpm -UVh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
[user]$ sudo yum -y install nginx

Enable the EPEL repository:

[user]$ sudo yum install epel-release

CentOS 7 ships with PHP version 5.4, to be able to install the latest version of PHP, version 5.6 we will enable the Webtatic repository:

[user]$ sudo rpm -Uvh https://mirror.webtatic.com/yum/el7/webtatic-release.rpm

Install PHP 5.6 and all nessesary extensions:

[user]$ sudo yum install php56w-cli php56w-mcrypt php56w-mbstring php56w-common php56w-gd php56w-fpm php56w-opcache php56w-pdo php56w-mysqlnd

Install Kanboard

Switch to home directory

[user]$ cd ~/

Download and unzip the latest version of Kanboard

[user]$ wget http://kanboard.net/kanboard-latest.zip
[user]$ unzip kanboard-latest.zip
[user]$ rm kanboard-latest.zip

Copy the included config.default.php to config.php and change the database information

[user]$ cd kanboard
[user]$ cp config.default.php config.php
[user]$ vim config.php
// 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', 'kanboarduser_passwd');

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

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

Configure Nginx and PHP

Create a new PHP-FPM pool for your user:

[user]$ sudo vim /etc/php-fpm.d/your_user.conf
[your_user]
user = your_user  
group = your_user  
listen = /var/run/php-fpm/your_user.sock  
listen.owner = your_user
listen.group = your_user  
listen.mode = 0666  
pm = ondemand  
pm.max_children = 5  
pm.process_idle_timeout = 10s;  
pm.max_requests = 200  
chdir = /  

Do not forget to change your_user with your username.

Restart PHP-FPM

[user]$ sudo systemctl restart php-fpm.service

Generate ssl certificate:

[user]$ sudo mkdir -p /etc/nginx/ssl
[user]$ cd /etc/nginx/ssl
[user]$ sudo openssl genrsa -des3 -passout pass:x -out kanboard.pass.key 2048
[user]$ sudo openssl rsa -passin pass:x -in kanboard.pass.key -out kanboard.key
[user]$ sudo rm kanboard.pass.key
[user]$ sudo openssl req -new -key kanboard.key -out kanboard.csr
[user]$ sudo openssl x509 -req -days 365 -in kanboard.csr -signkey kanboard.key -out kanboard.crt

To enable gzip compression open the nginx.conf file and add the follwing lines:

[user]$ sudo vim /etc/nginx/nginx.conf
# Gzip Compression
gzip on;
gzip_comp_level    5;
gzip_min_length    256;
gzip_proxied       any;
gzip_vary          on;
gzip_types
    application/atom+xml
    application/javascript
    application/json
    application/ld+json
    application/manifest+json
    application/rss+xml
    application/vnd.geo+json
    application/vnd.ms-fontobject
    application/x-font-ttf
    application/x-web-app-manifest+json
    application/xhtml+xml
    application/xml
    font/opentype
    image/bmp
    image/svg+xml
    image/x-icon
    text/cache-manifest
    text/css
    text/plain
    text/vcard
    text/vnd.rim.location.xloc
    text/vtt
    text/x-component
    text/x-cross-domain-policy;

Next, create a new Nginx server block:

[user]$ sudo vim /etc/nginx/conf.d/kanboard.conf
server {
    listen      443 ssl spdy;
    server_name your_kanboard_domain;

    ssl on;
    ssl_certificate     /etc/nginx/ssl/kanboard.crt;
    ssl_certificate_key /etc/nginx/ssl/kanboard.key;
    ssl_session_timeout 5m;

    ssl_ciphers               'AES128+EECDH:AES128+EDH:!aNULL';
    ssl_protocols              TLSv1 TLSv1.1 TLSv1.2;
    ssl_prefer_server_ciphers on;

    root /home/your_user/kanboard;

    index index.html index.htm index.php;

    charset utf-8;
    client_max_body_size 16M;

    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    access_log  /var/log/nginx/kanboard.access.log;
    error_log   /var/log/nginx/kanboard.error.log;

    sendfile off;

    location ~ \.php$ {
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_pass unix:/var/run/php-fpm/your_user.sock;
        fastcgi_index index.php;
        include fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_intercept_errors off;
        fastcgi_buffer_size 16k;
        fastcgi_buffers 4 16k;
    }

    location ~* /data {
            deny all;
            return 404;
    }

    location ~ /\.ht {
        deny all;
    }
}

server {
    listen      80;
    server_name your_kanboard_domain;

    add_header Strict-Transport-Security max-age=2592000;
    rewrite ^ https://$server_name$request_uri? permanent;
}

Do not forget to change your_user with your username.

Finally, restart nginx:

[user]$ sudo systemctl restart nginx.service

That’s it. You have successfully installed Kanboard on your Centos 7 VPS. The default username and password are both admin.

For more information about Kanboard ,please refer to the Kanboard website.


Of course you don’t have to do any of this if you use one of our Linux VPS Hosting services, in which case you can simply ask our expert Linux admins to setup this for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

View Comments

  • Thanks! (One small update - the database name and database user should be switched)