Setup Redmine Project Management Software on Ubuntu 16.04 | 18.04 | 18.10 with Nginx, MariaDB

Our previous tutorial we showed students and new users how to install Redmine on Ubuntu with Apache2 HTTP support. For those who want to run Redmine with Nginx instead, the steps below should be a great place to start.

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 Nginx HTTP Server

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

sudo apt update
sudo apt install nginx

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

sudo systemctl stop nginx.service
sudo systemctl start nginx.service
sudo systemctl enable nginx.service

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

nginx default home page test

If you see the page above, then Nginx 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 Passenger

Passenger is a fast and lightweight web application server for Ruby, Node.js and Python that can be integrated with Apache and Nginx.

Follow the steps below to install passenger module.

sudo apt install dirmngr gnupg apt-transport-https ca-certificates

Import the repository GPG key and enable the Phusionpassenger repository:

sudo apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 561F9B9CAC40B2F7
sudo sh -c 'echo "deb  $(lsb_release -sc) main" >> /etc/apt/sources.list.d/passenger.list'

Once the repository is enabled, update the packages list and install the Passenger Nginx module with:

sudo apt update
sudo apt install libnginx-mod-http-passenger

Step 5: Install Redmine

Now that you have installed Nginx 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 Nginx 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 Nginx user.

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

Step 6: Configure Nginx

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/nginx/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.

server {
    listen 80;
    listen [::]:80;
    root /var/www/html/redmine;
    server_name  example.com www.example.com;

     client_max_body_size 100M;
     passenger_enabled on;
     passenger_min_instances 1;
  
     autoindex off;

     access_log /var/log/nginx/example.com.access.log;
     error_log /var/log/nginx/example.com.error.log;
}

Save the file and exit.

Step 7: Enable the Redmine Site

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

sudo ln -s /etc/nginx/sites-available/redmine.conf /etc/nginx/sites-enabled/
sudo systemctl restart nginx.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: