RHEL BasedRocky Linux

How To Install Kanboard on Rocky Linux 9

Install Kanboard on Rocky Linux 9

Kanboard is an open-source project management software designed to facilitate Kanban methodology. This approach emphasizes visual workflow management, limiting work in progress, and maximizing efficiency. It provides a clear and intuitive interface for teams to manage their projects effectively. With its simplicity and flexibility, Kanboard is an excellent choice for individuals and teams looking to improve their project tracking and collaboration.

Rocky Linux 9, known for its stability and security, serves as an ideal platform for hosting Kanboard. Its robust architecture ensures reliable performance and makes it a favored choice for server environments. This guide will walk you through the entire process of installing and configuring Kanboard on Rocky Linux 9, ensuring you have a fully functional project management system.

This article will cover everything from initial server setup to securing your Kanboard installation with SSL. Follow each step carefully to create a robust and efficient project management environment. Our goal is to provide a seamless experience, even for those with limited Linux server administration experience. By the end of this tutorial, you will have a working Kanboard instance ready to manage your projects. This comprehensive tutorial provides an efficient way to streamline your project workflows using this powerful tool.

Table of Contents

1. Prerequisites for Installing Kanboard

Before you begin the installation, ensure that your Rocky Linux 9 server meets the necessary requirements. Proper preparation is critical for a smooth installation process.

System Requirements

  • Rocky Linux 9: A clean and updated installation of Rocky Linux 9 is necessary.
  • Root or Sudo Privileges: You need root access or a user with sudo privileges to execute administrative commands.

Hardware Recommendations

  • CPU: A minimum of 1 GHz processor is recommended. For larger teams and projects, consider a multi-core processor.
  • RAM: At least 1 GB of RAM is required, but 2 GB or more is preferable for better performance.
  • Disk Space: Allocate at least 10 GB of disk space. This should be sufficient for the application and its data, but adjust according to your project size.

Software Prerequisites

  • Web Server (Apache/Nginx): This guide uses Nginx, but Apache can also be used with slight modifications.
  • Database Server (MariaDB/MySQL/PostgreSQL): MariaDB is recommended due to its compatibility and performance.
  • PHP: Version 7.4 or higher is required, along with necessary PHP extensions.

2. Preparing Your Rocky Linux 9 Server

Preparing your server involves updating the system packages and installing essential tools. This ensures that your system is up-to-date and has the necessary utilities for the installation process.

Update System Packages

Run the following command to update your system packages:

sudo dnf update -y

This command updates all installed packages to their latest versions. It is crucial to keep your system updated to avoid compatibility issues and security vulnerabilities.

Install Essential Tools and Utilities

Install tools like wget, curl, git, unzip, and nano using the following command:

sudo dnf install wget curl git unzip nano -y
  • wget/curl: Used for downloading files from the internet.
  • git: Used for cloning the Kanboard repository from GitHub.
  • unzip: Used for extracting compressed files.
  • nano: A simple text editor for editing configuration files. You can also use vim or any other editor.

Configure Firewall Settings (Firewalld)

Configure the firewall to allow HTTP (port 80) and HTTPS (port 443) traffic:

sudo firewall-cmd --permanent --add-service=http
 sudo firewall-cmd --permanent --add-service=https
 sudo firewall-cmd --reload

These commands open the necessary ports for web traffic, ensuring that Kanboard is accessible via a web browser. The --permanent option ensures that these rules persist after a reboot. The --reload command applies the changes immediately.

SELinux Configuration (Optional but Recommended)

SELinux (Security-Enhanced Linux) provides an additional layer of security. While configuring SELinux is optional, it is highly recommended for production environments.

Check SELinux status:

sestatus

If SELinux is enabled, you may need to create specific policies to allow Nginx to access Kanboard files. For example:

sudo semanage fcontext -a -t httpd_sys_content_t "/var/www/html/kanboard(/.*)?"
 sudo restorecon -Rv /var/www/html/kanboard

These commands ensure that SELinux allows Nginx to serve the Kanboard files.

3. Installing and Configuring LEMP Stack on Rocky Linux 9

A LEMP stack consists of Linux, Nginx (web server), MariaDB (database server), and PHP (programming language). This section guides you through the installation and basic configuration of the LEMP stack.

Explanation of LEMP Stack Components

  • Linux: The operating system. In this case, it’s Rocky Linux 9.
  • Nginx: A high-performance web server.
  • MariaDB: A database management system.
  • PHP: A server-side scripting language used for web development.

Step-by-Step Installation

Install Nginx, MariaDB, and PHP along with necessary PHP extensions:

sudo dnf install nginx mariadb-server php php-fpm php-cli php-mysqlnd php-gd php-mbstring php-json php-openssl php-xml php-dom php-simplexml php-session php-filter php-hash php-ctype -y

This command installs all the necessary packages for the LEMP stack and PHP extensions required by Kanboard.

Enable and Start Services

Enable and start the Nginx, MariaDB, and PHP-FPM services:

sudo systemctl enable --now nginx mariadb php-fpm

The enable command ensures that the services start automatically on boot. The --now option starts the services immediately.

Basic Configuration Checks

Verify that the services are running:

sudo systemctl status nginx
 sudo systemctl status mariadb
 sudo systemctl status php-fpm

These commands display the status of each service. Make sure they are active and running without any errors.

4. Securing MariaDB Database Server

Securing your MariaDB installation is a crucial step to protect your data. The mysql_secure_installation script helps you set up basic security options.

Using mysql_secure_installation Script

Run the following command:

sudo mysql_secure_installation

The script will ask you a series of questions:

  • Set root password? It is recommended to set a strong root password.
  • Remove anonymous users? Yes, remove anonymous users for security.
  • Disallow root login remotely? Yes, disallow remote root login.
  • Remove test database and access to it? Yes, remove the test database.
  • Reload privilege tables now? Yes, reload the privilege tables to apply the changes.

Answer these questions appropriately to secure your MariaDB installation.

Recommended Security Configurations

  • Always use strong passwords for the root user and other database users.
  • Restrict access to the database server from specific IP addresses or networks.
  • Regularly update your MariaDB installation to patch security vulnerabilities.

5. Creating Database for Kanboard

Before installing Kanboard, you need to create a database and a user account for it. This section provides the necessary SQL commands to accomplish this.

Steps to Create Database and User

Log in to the MariaDB server as the root user:

sudo mysql -u root -p

Enter the root password when prompted. Then, execute the following SQL commands:

CREATE DATABASE kanboarddb;
 GRANT ALL PRIVILEGES ON kanboarddb.* TO 'kanboarduser'@'localhost' IDENTIFIED BY 'securepassword';
 FLUSH PRIVILEGES;
 EXIT;
  • CREATE DATABASE kanboarddb;: Creates a new database named kanboarddb.
  • GRANT ALL PRIVILEGES ON kanboarddb.* TO ‘kanboarduser’@’localhost’ IDENTIFIED BY ‘securepassword’;: Grants all privileges on the kanboarddb database to the user kanboarduser, which can only connect from localhost. Replace securepassword with a strong password.
  • FLUSH PRIVILEGES;: Reloads the grant tables to apply the changes.
  • EXIT;: Exits the MariaDB monitor.

Ensure you replace securepassword with a strong, unique password.

6. Installing Composer on Rocky Linux 9

Composer is a dependency management tool for PHP. Kanboard uses Composer to manage its dependencies. This section guides you through installing Composer.

Importance of Composer for PHP Dependencies

Composer simplifies the process of managing PHP libraries and dependencies. It automatically downloads and installs the necessary packages for your project.

Installing Composer

Download and install Composer using the following commands:

curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
 composer -v

These commands download the Composer installer and move it to /usr/local/bin/composer, making it globally accessible. The composer -v command verifies that Composer is installed correctly by displaying its version.

7. Downloading and Installing Kanboard

This section covers downloading the Kanboard source code from GitHub and setting up the necessary file permissions.

Download Latest Kanboard from GitHub

Navigate to the /tmp directory and clone the Kanboard repository:

cd /tmp
 git clone https://github.com/kanboard/kanboard.git

This command downloads the latest version of Kanboard from GitHub to the /tmp directory.

Move Kanboard to the Web Directory

Move the Kanboard directory to /var/www/html/:

sudo mv kanboard /var/www/html/
 cd /var/www/html/kanboard

This command moves the Kanboard directory to the web server’s document root.

Configure Kanboard

Copy the default configuration file and install dependencies:

sudo cp config.default.php config.php
 sudo composer install

The cp command creates a copy of the default configuration file, and the composer install command installs the necessary PHP dependencies.

Setting Correct Permissions

Set the correct permissions for the Kanboard directory:

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

These commands change the ownership of the Kanboard files to the nginx user and group and set the appropriate permissions.

8. Configuring Kanboard Application Settings

This section details how to configure the Kanboard application settings by modifying the config.php file.

Editing Configuration File

Edit the /var/www/html/kanboard/config.php file to set up the database connection:

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

Add or modify the following lines:

<?php
 define('DB_DRIVER', 'mysql');
 define('DB_USERNAME', 'kanboarduser');
 define('DB_PASSWORD', 'securepassword');
 define('DB_NAME', 'kanboarddb');
 define('DB_HOSTNAME', 'localhost');

Replace kanboarduser, securepassword, and kanboarddb with the appropriate values you set up earlier. You may also need to adjust the DB_HOSTNAME if your database is not on the same server.

Explanation of Essential Configurations

  • DB_DRIVER: Specifies the database driver (in this case, MySQL).
  • DB_USERNAME: The username for the database.
  • DB_PASSWORD: The password for the database user.
  • DB_NAME: The name of the database.
  • DB_HOSTNAME: The hostname of the database server.

Make sure to save the changes and exit the text editor.

9. Configuring Nginx Virtual Host for Kanboard

To make Kanboard accessible through a web browser, you need to configure Nginx to serve the application. This involves creating a virtual host configuration file.

Creating Nginx Server Block File

Create a new Nginx server block configuration file (e.g., /etc/nginx/conf.d/kanboard.conf):

sudo nano /etc/nginx/conf.d/kanboard.conf

Add the following configuration:

server {
  listen 80;
  server_name your-domain.com;

  root /var/www/html/kanboard;
  index index.php index.html;

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

  location ~ \.php$ {
  include fastcgi_params;
  fastcgi_pass unix:/run/php-fpm/www.sock;
  fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  fastcgi_index index.php;
  }

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

Replace your-domain.com with your actual domain name or server IP address.

Testing and Restarting Nginx

Test the Nginx configuration and restart the service:

sudo nginx -t
 sudo systemctl restart nginx

The nginx -t command tests the configuration for syntax errors. If the test is successful, restart Nginx to apply the changes.

10. Securing Kanboard with SSL Certificate (Let’s Encrypt)

Securing your Kanboard installation with an SSL certificate ensures that all traffic between the client and server is encrypted. Let’s Encrypt provides free SSL certificates.

Installation of Certbot Client

Install Certbot and the Nginx plugin:

sudo dnf install epel-release mod_ssl python3-certbot-nginx -y

Obtaining SSL Certificate

Run Certbot to obtain and install the SSL certificate:

sudo certbot --nginx -d your-domain.com -m your-email@example.com --agree-tos --redirect --hsts --staple-ocsp --no-eff-email

Replace your-domain.com with your domain name and your-email@example.com with your email address. Certbot will automatically configure Nginx to use the SSL certificate.

11. Accessing and Initializing Kanboard Web Interface

Once the installation and configuration are complete, you can access Kanboard through your web browser.

Accessing via Web Browser

Open your web browser and navigate to https://your-domain.com. If you used your server’s IP address, enter https://your_server_ip.

Initial Login Credentials Setup

The default login credentials are:

  • Username: admin
  • Password: admin

It is strongly recommended to change these default credentials immediately after logging in for security reasons.

Brief Overview of Initial Dashboard

After logging in, you will see the Kanboard dashboard. From here, you can create new projects, manage tasks, and configure various settings.

12. Troubleshooting Common Issues During Installation

This section provides solutions to common problems encountered during the installation process.

Common Errors and Solutions

  • Permissions Issues: Ensure that the Nginx user has the necessary permissions to access the Kanboard files. Use the chown and chmod commands to set the correct permissions.
  • Database Connection Errors: Double-check the database credentials in the config.php file. Verify that the database server is running and accessible.
  • PHP Extension Errors: Make sure that all required PHP extensions are installed. Use the dnf install command to install any missing extensions.
  • Nginx Configuration Errors: Use the nginx -t command to test the Nginx configuration for syntax errors. Check the Nginx error logs for more details.

Debugging Tips

  • Check the Nginx error logs (/var/log/nginx/error.log) for any errors.
  • Verify that the PHP-FPM service is running and configured correctly.
  • Use the ping command to check network connectivity to the database server.

13. Best Practices for Maintaining Your Kanboard Installation

Maintaining your Kanboard installation involves regular backups, updates, and monitoring.

Regular Backups of Database and Files

Create regular backups of the Kanboard database and files. You can use the mysqldump command to back up the database:

sudo mysqldump -u root -p kanboarddb > kanboarddb_backup.sql

Back up the Kanboard files by creating an archive:

sudo tar -czvf kanboard_files_backup.tar.gz /var/www/html/kanboard

Keeping Software Updated Regularly

Regularly update your Rocky Linux 9 system, Nginx, MariaDB, PHP, and Kanboard to patch security vulnerabilities and improve performance.

Monitoring Server Resources and Logs

Monitor your server’s resources (CPU, RAM, disk space) and logs to identify and resolve any issues promptly. Use tools like top, htop, and tail to monitor server activity.

Congratulations! You have successfully installed Kanboard. Thanks for using this tutorial for installing Kanboard open source project management on your Rocky Linux 9. For additional help or useful information, we recommend you check the official Kanboard website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button