How to Install Mantis BT on Ubuntu 21

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
"The best Linux newsletter on the web"

MantisBT is an open source issue tracker platform designed to be flexible and user friendly and provides a tool help you collaborate with different teams to resolve bugs and issues and quickly and professionally as possible.

 Mantis also has built-in modules that extend its functionality and the platform is actively being developed. Mantis Bug Tracker allows the team to report errors and organize who can take care of them. Users are able to get started in minutes and start managing their projects while collaborating with their teammates and clients effectively.

This Tutorial will guide you about how to install Mantis BT on Ubuntu 21.

Install Apache2 HTTP Server on Ubuntu:

Mantis BT will need Apache2 web server so to install it use the following commands:

apt update
apt install apache2

Now, Start and Enable Apache2 so that It automatically starts on boot.

systemctl start apache2.service
systemctl enable apache2.service
systemctl status apache2.service

To check Apache2, open your browser and browse to the server IP address ( and you should see Apache2 default test page as shown below. When you see that, then Apache2 is working as expected.

Install MariaDB Database Server:

Mantis needs a Database server to store its content. MariaDB is an Open source Database, we will use it for Mantis BT.

To install MariaDB enter the following commands:

apt-get install mariadb-server mariadb-client

Start and Enable MariaDB service so that it may start automatically on boot.

systemctl start mariadb.service
systemctl enable mariadb.service
systemctl status mariadb.service

After that, run the commands below to secure MariaDB server by creating a root password and disallowing remote root access.


When prompted, answer the questions below by following the guide.

  • Enter current password for root (enter for none): Just press the Enter
  • Set root password? [Y/n]: Y
  • New password: Enter your desired password
  • Re-enter new password: Repeat the password set in above step
  • Remove anonymous users? [Y/n]: Y
  • Disallow root login remotely? [Y/n]: Y
  • Remove test database and access to it? [Y/n]:  Y
  • Reload privilege tables now? [Y/n]:  Y

MariaDB is successfully installed. Please login to check MariaDB using the following command:

mysql -u root -p

Enter the password that you have set.

Install PHP and Related Modules:

Run the following command to install PHP:

apt-get install software-properties-common
add-apt-repository ppa:ondrej/php
apt update
apt upgrade
apt install php8.0 libapache2-mod-php8.0 php8.0-common php8.0-gmp php8.0-curl php8.0-intl php8.0-mbstring php8.0-xmlrpc php8.0-mysql php8.0-gd php8.0-xml php8.0-cli php8.0-zip

Open PHP default config file for Apache2.

nano /etc/php/8.0/apache2/php.ini

Make the changes on the following lines below in the file and save. The value below are great settings to apply in this environments. If you want you can change them according to you need.

file_uploads = On
allow_url_fopen = On
short_open_tag = On
memory_limit = 256M
upload_max_filesize = 100M
max_execution_time = 360
max_input_vars = 1500
date.timezone = America/Chicago

save and quit the file.


You’ve install all the packages, continue below to start configuring the servers. First create a Mantis database.

Use the following commands to create mantis database.

mysql -u root -p

Enter password that you have set during the installation of MariaDB.

Now Create Database.

CREATE USER 'mantisuser'@'localhost' IDENTIFIED BY 'new_password_here';
GRANT ALL ON mantis.* TO 'mantisuser'@'localhost' WITH GRANT OPTION;
flush privileges;

Restart MariaDB to apply the above settings.

systemctl restart mariadb.service

After installation of PHP and related modules restart Apache2.

systemctl restart apache2.service

Configure PHP:

To test PHP settings with Apache2, create a phpinfo.php file in Apache2 root directory by running the commands below:

nano /var/www/html/phpinfo.php

type the content below and save the file.

<?php phpinfo( ); ?>

browse to your server IP followed by /phpinfo.php. like

You should see the default PHP page.

To download and install Mantis on Ubuntu server, simply run the commands below to get it download. then extract its content into Apache2 root directory..

cd /tmp
mv mantisbt-2.22.1 /var/www/mantis

To set the correct permissions for Mantis to function execute the following commands:

chown -R www-data:www-data /var/www/mantis/
chmod -R 755 /var/www/mantis/

Configure Apache2:

Finally, configure Apahce2 site configuration file for Mantis. This file will control how users access Mantis content. Run the commands below to create a new configuration file called mantis.conf

nano /etc/apache2/sites-available/mantis.conf

Then copy and paste the content below into the file and save it. Replace the highlighted line with your own domain name and directory root location.

<VirtualHost *:80>
     ServerAdmin [email protected]
     DocumentRoot /var/www/mantis

     <Directory /var/www/mantis/>
        Options +FollowSymlinks
        AllowOverride All
        Require all granted

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


save and quit the file.

Enable the Mantis and Rewrite Module:

After configuring the Virtual Host above, enable it by running the commands below:

a2ensite mantis.conf
a2enmod rewrite

a2dissite 000-default.conf
systemctl restart apache2.service

Then open your browser and browse to the server domain name. You should see Mantis setup wizard.

Type in database Username and password.

After that Mantis BT is ready for use.

Enter Default Username: admin and password:root.

Finally, System will ask you to change password for the administrator password.

Lastly You can use Mantis Bug Tracker according to your use.

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
"The best Linux newsletter on the web"
Unix/Linux Guru and FOSS supporter


Please enter your comment!
Please enter your name here

Latest articles

Join us on Facebook