(Last Updated On: November 4, 2018)

Welcome to our guide on how to install Mantis Bug Tracker on Ubuntu 18.04. MantisBT is an open source web-based bug tracking system which has matured and gained a lot of popularity to become one of the most popular open source bug/issue tracking systems. MantisBT is developed in PHP, with support for multiple database backends including MySQL, MS SQL and PostgreSQL.

MantisBT on Ubuntu 18.04 Software Requirements

  • MySQL 5.5.35+, PostgreSQL 9.2+, or other supported database
  • PHP 5.5.9+
  • Apache / Nginx web server

You’ll need to ensure that above software requirements are installed before downloading MantisBT.

Step 1: Install Apache2, PHP and Database Server

In this section, we’ll ensure all dependencies are installed. Let’s start with the installation of PHP

sudo apt update
sudo apt install wget php php-cli php-fpm php-mysql php-zip php-gd php-mbstring php-curl php-xml php-pear php-bcmath

Then install Apache2 Web Server

sudo apt -y install apache2

For a Database, you can choose to use MySQL or MariaDB. We have guides to help you with the installation of a Database server on Ubuntu 18.04

Install MariaDB 10.x on Ubuntu 18.04 and CentOS 7

How to Install MySQL 8.0 on Ubuntu 18.04 / 16.04

Login to the MariaDB shell:

$ mysql -u root -p

Create a database and user for MantisBT:

CREATE USER 'mantisbt'@'localhost' IDENTIFIED BY 'StrongPassword';
CREATE DATABASE mantisbt;
GRANT ALL PRIVILEGES ON mantisbt.* TO 'mantisbt'@'localhost';
FLUSH PRIVILEGES;
QUIT

Check if you can log in to Database shell as mantisbt user:

$ mysql -u mantisbt -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 42
Server version: 10.1.34-MariaDB-0ubuntu0.18.04.1 Ubuntu 18.04

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)]> SHOW DATABASES;
+--------------------+
| Database           |
+--------------------+
| information_schema |
| mantisbt           |
+--------------------+
2 rows in set (0.00 sec)

Step 2: Download and Install Mantis Mantis Bug Tracker on Ubuntu 18.04

Check for the latest release of Mantis Bug Tracker from Github. As of this writing, the current release is 2.18.0

Download it locally to your Ubuntu host

export VER="2.18.0"
wget https://liquidtelecom.dl.sourceforge.net/project/mantisbt/mantis-stable/${VER}/mantisbt-${VER}.zip

Uncompress the package

unzip mantisbt-${VER}.zip

Move the folder to /srv directory

sudo mv mantisbt-${VER}/ /srv/mantisbt

Set proper permissions for the directory

sudo chown -R www-data:www-data /srv/mantisbt/

Create Apache Virtual Host file for Mantis Bug Tracker

sudo vim /etc/apache2/sites-enabled/mantisbt.conf

Paste below content into the file

<VirtualHost *:80>
        ServerAdmin [email protected]
        DocumentRoot "/srv/mantisbt"
        ServerName bt.example.com
        ServerAlias www.bt.example.com
        ErrorLog "/var/log/apache2/mantisbt-error_log"
        TransferLog "/var/log/apache2/mantisbt-access_log"
        <Directory "/srv/mantisbt/">
                DirectoryIndex index.php index.html
                Options FollowSymLinks
                AllowOverride None
                Require all granted
                Options MultiViews FollowSymlinks
        </Directory>
</VirtualHost>

Check for syntax errors

apachectl -t
Syntax OK

If you get the Syntax OKmessage, restart Apache service

sudo systemctl restart apache2

A check on service status should indicate running

$ sudo systemctl status apache2
* apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
  Drop-In: /lib/systemd/system/apache2.service.d
           `-apache2-systemd.conf
   Active: active (running) since Sun 2018-11-04 06:48:42 PST; 4s ago
  Process: 20227 ExecStop=/usr/sbin/apachectl stop (code=exited, status=0/SUCCESS)
  Process: 20232 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
 Main PID: 20257 (apache2)
    Tasks: 6 (limit: 1111)
   CGroup: /system.slice/apache2.service
           |-20257 /usr/sbin/apache2 -k start
           |-20262 /usr/sbin/apache2 -k start
           |-20263 /usr/sbin/apache2 -k start
           |-20264 /usr/sbin/apache2 -k start
           |-20265 /usr/sbin/apache2 -k start
           `-20266 /usr/sbin/apache2 -k start

Nov 04 06:48:42 ubuntu-01 systemd[1]: Starting The Apache HTTP Server...
Nov 04 06:48:42 ubuntu-01 systemd[1]: Started The Apache HTTP Server.

Step 3: Finish Mantis Bug Tracker Installation

Open the URL http://bt.example.com to finish your Mantis Bug Tracker installation on Ubuntu 18.04.

Configure Database

Under Installation Options fill:

  • Type of Database: MySQL Improved
  • Username (for Database): mantisbt
  • Password (for Database): StrongPassword
  • Database name (for Database): mantisbt

Then click on “Install/Upgrade” Database” button. If the installation was successful, you should receive a message like below

Login to Mantis Bug Tracker Dashboard

Default Logins are:

Username: administrator
Password: root

Please change the administrator password after the first login

Cheers!. You have successfully installed Mantis Bug Tracker on Ubuntu 18.04 server. Explore more settings and don’t forget to check the official Mantis Bug Tracker Administration guide.