How To Install A Fresh MantisBT – OpenSource Bug Tracker


  1. You know how to setup your LAMP stack and any related Apache setups to run a website
  2. You know how to use phpMyAdmin or any other MySql query browser
  3. We are setting this up in a LOCAL environment and we are not bothering about any security or good practice scenarios

Step by Step Of How To Install A New Mantis Bug Tracking System

STEP 1) Download the latest copy from MantisBT’s Home pageclick here

STEP 2) Extract mantis to your LAMP’s www folder, we’ll assume you have set mantis to run under the local url “mantis.local” hereon..

STEP 3) Using phpMyAdmin, create a database. We’ll call it mantis
I will assume you have the following info handy and that you know how to set them up:

  • The hostname of your local server == localhost
  • The database name in which you plan to install your new mantis’ data/records == mantis (you can give it any name)
  • The username of the database mantis you created == root (this is the default username for any bundled LAMP stack like WAMP or XAMPP)
  • The password of the database mantis you created = [empty, it’s an empty string] (this is the default password for any bundled LAMP stack like WAMP or XAMPP is always a blank password)

Now lets briefly list how mantis’ code interprets each of the above mentioned terms:

In mantis jargon:

  • hostname is represented by the variable $g_hostname
  • database name is represented by the variable $g_database_name
  • database username is represented by the variable $g_db_username
  • database password is represented by the variable $g_db_password

Just keep this in mind, since we will refer to this in the famous PHP file config_inc.php somewhere below.. (Keep reading)

STEP 4) Browse http://mantis.local, you’ll be redirected to: http://mantis.local/admin/install.php

At this point, if your environment meets all the requirements, you should see a screen with GREEN colored squares saying GOOD (as shown below)

STEP 5) Now fill in all the data required, as shown below:

What is the difference between the Username and Admin Username as shown in the screenshot above?
=> Username is the actual username that has ‘privilege‘ specially on the database (mantis in our case)
=> Admin Username is the username which has ‘supreme privilege’ on the WHOLE MySql database. It is the one which was created FIRST and BEFORE any other username on that database. Mantis system asked us to provide it in case you have not yet created any database and ‘the‘ mantis system will need a username with high privilege on the MySQL to create a database for you..

So, technically Admin Username can create another instance of a username (Username) and also grant it supreme privileges just as itself..etc In my case, both the Admin Username and Username is the default root

STEP 6) Click Install button.. You should see most check in a big GREEN square. But for my example, I had TWO issues/warnings:

For Setting Database Password, it says: POSSIBLE PROBLEM => database password is blank
CONCERNS: well, this one is FINE for our example since we are working locally

Creating Configuration File (config_inc.php), it says: POSSIBLE PROBLEM => cannot write ~/www/sites/mantis/config_inc.php

The system also suggests us to:

(if this file is not created, create it manually with the contents below)
Please add the following lines to ~/www/sites/mantis/config_inc.php before continuing to the database upgrade check:

CONCERNS: BUT we will not do like this. We will do something better. If you browse your mantis root folder, you will find a file named as config_inc.php.sample
=> Rename that file to config_inc.php
=> Open config_inc.php and find the line # — Database Configuration —
=> Replace the values for that block of code with our values as mentioned above

Your full code should look something like the file below:


* @package MantisBT
* @copyright Copyright (C) 2000 - 2002  Kenzaburo Ito -
* @copyright Copyright (C) 2002 - 2011  MantisBT Team -
* @link

# This sample file contains the essential files that you MUST
# configure to your specific settings.  You may override settings
# from config_defaults_inc.php by assigning new values in this file

# Rename this file to config_inc.php after configuration.

# In general the value OFF means the feature is disabled and ON means the
# feature is enabled.  Any other cases will have an explanation.

# Look in or config_defaults_inc.php for more
# detailed comments.

# --- Database Configuration ---
$g_hostname = 'localhost';
$g_db_type = 'mysql';
$g_database_name = 'mantis';
$g_db_username = 'root';
$g_db_password = '';

# --- Anonymous Access / Signup ---
$g_allow_signup				= ON;
$g_allow_anonymous_login	= OFF;
$g_anonymous_account		= '';

# --- Email Configuration ---
$g_smtp_host			= 'localhost';			# used with PHPMAILER_METHOD_SMTP
$g_smtp_username		= '';					# used with PHPMAILER_METHOD_SMTP
$g_smtp_password		= '';					# used with PHPMAILER_METHOD_SMTP
$g_administrator_email  = '';
$g_webmaster_email      = '';
$g_from_name			= 'Mantis Bug Tracker';
$g_from_email           = '';	# the "From: " field in emails
$g_return_path_email    = '';	# the return address for bounced mail
$g_email_receive_own	= OFF;
$g_email_send_using_cronjob = OFF;

# --- Attachments / File Uploads ---
$g_allow_file_upload	= ON;
$g_file_upload_method	= DATABASE; # or DISK
$g_absolute_path_default_upload_folder = ''; # used with DISK, must contain trailing \ or /.
$g_max_file_size		= 5000000;	# in bytes
$g_preview_attachments_inline_max_size = 256 * 1024;
$g_allowed_files		= '';		# extensions comma separated, e.g. 'php,html,java,exe,pl'
$g_disallowed_files		= '';		# extensions comma separated

# --- Branding ---
$g_window_title			= 'MantisBT';
$g_logo_image			= 'images/mantis_logo.gif';
$g_favicon_image		= 'images/favicon.ico';

# --- Real names ---
$g_show_realname = OFF;
$g_show_user_realname_threshold = NOBODY;	# Set to access level (e.g. VIEWER, REPORTER, DEVELOPER, MANAGER, etc)

# --- Others ---
$g_default_home_page = 'my_view_page.php';	# Set to name of page to go to after login

7) After everything is now setup fine, you can login. But what is the Default Login?
The default Login for a fresh mantis install is administrator / root as shown in the screenshot below:

As mentioned in red in the screenshot,
=> Make sure you delete or rename the admin folder in your mantis root folder
=> Change the administrator password, you can do this in your mantis My Account section as ease..

6 Comment(s)

  1. Hey there! Do you use Twitter? I’d like to follow you if that would be okay. I’m definitely enjoying
    your blog and look forward to new updates.

  2. Hi,
    I created a database called mantis using phpMyAdmin, and added a new user ‘mroot’ with password ‘mroot’. I am stuck at step 4 though. When I try going to localhost/mantis, it asks me for a username and password. I have tried the following combinations: administrator/root, root/{empty}, mroot/mroot. I have also edited the config_inc.php file under mantis with all these settings, but none of these passwords is working. What should I do?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.