Install Redmine Project Management Platform on Ubuntu 16.04 | 18.04 | 18.10 with Apache2 and MariaDB

Redmine is a flexible enterprise project management web platform written in Ruby on Rails framework. and is great for projects and time tracking, wiki, document management and more… It also integrates with popular open source plugins to make managing your projects easy.…

If you want a project management platform that has enterprise-class features, scalable, and performs at a high level, then Redmine is a good place to start… Redmine is built on an open source core with support for open standards, which might be very useful in helping you run your projects…

Redmine platform is designed for ease of use to allow enterprises and business owners to collaborate and automate engaging experiences with users across multiple devices, including mobile…

For more about Redmine, please check their Homepage

This brief tutorial is going to show students and new users how to install Redmine on Ubuntu 16.04 / 18.10 and 18.04 LTS…

To get started with installing Redmine, follow the steps below:

Step 1: Install Apache2 HTTP Server

Redmine requires a web server and Apache2 HTTP server is the most popular open source web server available today. To install Apache2 server, run the commands below:

sudo apt update
sudo apt install apache2 libapache2-mod-passenger

After installing Apache2, the commands below can be used to stop, start and enable Apache2 service to always start up with the server boots.

sudo systemctl stop apache2.service
sudo systemctl start apache2.service
sudo systemctl enable apache2.service

Now that Apache2 is installed. to test whether the web server is working, open your browser and browse to the URL below.

Apache2 Test Page

If you see the page above, then Apache2 is successfully installed.

Step 2: Install MariaDB Database Server

Redmine also requires a database server to store its content. If you’re looking for a truly open source database server, then MariaDB is a great place to start. To install MariaDB run the commands below:

sudo apt-get install mariadb-server mariadb-client

After installing MariaDB, the commands below can be used to stop, start and enable MariaDB service to always start up when the server boots.

Run these on Ubuntu 16.04 LTS

sudo systemctl stop mysql.service
sudo systemctl start mysql.service
sudo systemctl enable mysql.service

Run these on Ubuntu 18.10 and 18.04 LTS

sudo systemctl stop mariadb.service
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service

Next, run the commands below to secure the database server with a root password if you were not prompted to do so during the installation.

sudo mysql_secure_installation

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 password
  • Re-enter new password: Repeat password
  • 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

Now that MariaDB is installed, to test whether the database server was successfully installed, run the commands below.

sudo mysql -u root -p

type the root password when prompted.

mariadb welcome

If you see a similar screen as shown above, then the server was successfully installed.

Step 3: Create Redmine Database

Now that you’ve installed all the packages that are required for Redmine to function, continue below to start configuring the servers. First run the commands below to create a blank Redmine database.

To logon to MariaDB database server, run the commands below.

sudo mysql -u root -p

Then create a database called redmine

CREATE DATABASE redmine;

Create a database user called redmineuser with a new password

CREATE USER 'redmineuser'@'localhost' IDENTIFIED BY 'new_password_here';

Then grant the user full access to the database.

GRANT ALL ON redmine.* TO 'redmineuser'@'localhost' IDENTIFIED BY 'user_password_here' WITH GRANT OPTION;

Finally, save your changes and exit.

FLUSH PRIVILEGES;
EXIT;

Step 4: Install Redmine

Now that you have installed Apache2 and MariaDB, run the commands below to install Redmine packages.

sudo apt-get install redmine redmine-mysql

During the installation, you will be asked to configure redmine. choose Yes and continue.

 ┌──────────────────────────┤ Configuring redmine ├──────────────────────────┐
 │                                                                           │ 
 │ The redmine/instances/default package must have a database installed and  │ 
 │ configured before it can be used. This can be optionally handled with     │ 
 │ dbconfig-common.                                                          │ 
 │                                                                           │ 
 │ If you are an advanced database administrator and know that you want to   │ 
 │ perform this configuration manually, or if your database has already      │ 
 │ been installed and configured, you should refuse this option. Details on  │ 
 │ what needs to be done should most likely be provided in                   │ 
 │ /usr/share/doc/redmine/instances/default.                                 │ 
 │                                                                           │ 
 │ Otherwise, you should probably choose this option.                        │ 
 │                                                                           │ 
 │ Configure database for redmine/instances/default with dbconfig-common?    │ 
 │                                                                           │ 
 │               <Yes>                            <No>                       |
 │                                                                           │ 
 └───────────────────────────────────────────────────────────────────────────┘ 

Then choose mysql ad the database type you want to use.

          ┌─────────────────┤ Configuring redmine ├─────────────────┐
          │ Database type to be used by redmine/instances/default:  │ 
          │                                                         │ 
          │                        sqlite3                          │ 
          │                        mysql                            │ 
          │                                                         │ 
          │                                                         │ 
          |             <Ok>                <Cancel>
          │                                                         │ 
          └─────────────────────────────────────────────────────────┘ 

Next, create a password for Remind instance to register with the database.

 ┌──────────────────────────┤ Configuring redmine ├──────────────────────────┐
 │ Please provide a password for redmine/instances/default to register with  │ 
 │ the database server. If left blank, a random password will be generated.  │ 
 │                                                                           │ 
 │ MySQL application password for redmine/instances/default:                 │ 
 │                                                                           │ 
 │ ********_________________________________________________________________ │ 
 │                                                                           │ 
 │                 <Ok>                   <Cancel>                           |
 │                                                                           │ 
 └───────────────────────────────────────────────────────────────────────────┘

Next, install gem blundler packages.

sudo gem update
sudo gem install bundler

After that, continue below to setup Apache2 site for Redmine. First run the commands below to create a symbolic link to Redmine document root.

sudo ln -s /usr/share/redmine/public /var/www/html/redmine

Next, adjust these directories to Apache2 user.

sudo touch /usr/share/redmine/Gemfile.lock
sudo chown www-data:www-data /usr/share/redmine/Gemfile.lock

Step 5: Configure Apache2

Next, run the commands below to open passenger.conf file.

sudo nano /etc/apache2/mods-available/passenger.conf

then add the highlighted line into the file and save.

<IfModule mod_passenger.c>
  PassengerDefaultUser www-data
  PassengerRoot /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini
  PassengerDefaultRuby /usr/bin/ruby
 </IfModule>

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

sudo nano /etc/apache2/sites-available/redmine.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/html/redmine
     ServerName example.com
     ServerAlias www.example.com

     <Directory /var/www/html/redmine>
         RailsBaseURI /redmine
         PassengerResolveSymlinksInDocumentRoot on
     </Directory>

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

</VirtualHost>

Save the file and exit.

Step 6: Enable the Redmine Site

After configuring the VirtualHost above, enable it by running the commands below

sudo a2ensite redmine.conf
sudo systemctl restart apache2.service

Then open your browser and browse to the server domain name and you should see Redmine home page.

Ubuntu install redmine

Login with username and password below:

Username: admin
Password: admin

Redmine ubuntu install

That’s it!

Congratulation! You have successfully installed Redmine on Ubuntu 16.04 | 18.04 and 18.10.

You may also like the post below: