LinuxTutorialsUbuntu

How To Install Redmine on Ubuntu 20.04 LTS

Install Redmine on Ubuntu 20.04 LTS

In this tutorial, we will show you how to install Redmine on Ubuntu 20.04 LTS. For those of you who didn’t know, Redmine is an open-source, cross-platform, and cross-database issue tracking and web-based project management application built on top of the Ruby on Rails framework. This free and open-source solution offers a substitute for paid job management tools and contains support for wikis, forums, calendars, and information visualization programs.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of Redmine on an Ubuntu 20.04 LTS (Focal Fossa) server.

Prerequisites

  • A server running one of the following operating systems: Ubuntu 20.04, 18.04, 16.04, and any other Debian-based distribution like Linux Mint.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Install Redmine on Ubuntu 20.04 LTS Focal Fossa

Step 1. First, make sure that all your system packages are up-to-date by running the following apt commands in the terminal.

sudo apt update
sudo apt upgrade

Step 2. Installing MariaDB on Ubuntu 20.04.

Once the system is updated, use the following commands to install MariaDB Server on the Ubuntu system:

sudo apt install software-properties-common mariadb-server mariadb-client

After the server is installed, the commands below can be used to stop, start and restart the database services:

sudo systemctl stop mariadb.service
sudo systemctl start mariadb.service
sudo systemctl restart mariadb.service

Let’s confirm our installation of the MariaDB server on Ubuntu 20.04:

mysql -V

Securing MariaDB after installation.

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. you should read and below each step carefully which will set a root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB:

mysql_secure_installation

Configure it like this:

- Set root password? [Y/n] y
- 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

To log into MariaDB, use the following command (note that it’s the same command you would use to log into a MariaDB database):

mysql -u root -p

This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for Redmine installation:

CREATE DATABASE redmine CHARACTER SET utf8mb4;
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost' IDENTIFIED BY 'your-passwd';
FLUSH PRIVILEGES;
EXIT;

Step 3. Installing Apache, Ruby, and Passenger.

Now we will install a Passenger application server that will be used by Ruby and integrate with Apache for serving Redmine on Ubuntu:

sudo apt install apache2 libapache2-mod-passenger

Step 4. Installing Redmine on Ubuntu 20.04.

Run the following commands to install Redmine on the Ubuntu system:

sudo apt install redmine redmine-mysql

Then, install the bundler gem:

sudo gem update
sudo gem install bundler

Next, configure the Apache Passenger module:

nano /etc/apache2/mods-available/passenger.conf
<IfModule mod_passenger.c>
  PassengerDefaultUser www-data
  PassengerRoot /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini
  PassengerDefaultRuby /usr/bin/ruby
</IfModule>

Now create a symlink to connect Redmine:

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

Next, create an Apache virtual host file for Redmine with the following command:

nano /etc/apache2/sites-available/redmine.conf
<VirtualHost *:80>
  ServerAdmin admin@example.com
  DocumentRoot /var/www/html/redmine
  ServerName myprojects.example.com
  ServerAlias www.projects.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 and close the file. Then, enable the Redmine virtual host and Apache rewrite module with the following command:

sudo a2enmod rewrite
sudo a2ensite redmine.conf
sudo systemctl restart apache2.service

Step 5. Accessing Redmine Web UI.

Redmine will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://myprojects.example.com and complete the required steps to finish the installation using the default credentials (admin/admin). If you are using a firewall, please open port 80 to enable access to the control panel.

Congratulations! You have successfully installed Redmine. Thanks for using this tutorial for installing the Redmine project management web app on Ubuntu 20.04 Focal Fossa system. For additional help or useful information, we recommend you to check the official Redmine website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is a seasoned Linux system administrator with a wealth of experience in the field. Known for his contributions to idroot.us, r00t has authored numerous tutorials and guides, helping users navigate the complexities of Linux systems. His expertise spans across various Linux distributions, including Ubuntu, CentOS, and Debian. r00t's work is characterized by his ability to simplify complex concepts, making Linux more accessible to users of all skill levels. His dedication to the Linux community and his commitment to sharing knowledge makes him a respected figure in the field.
Back to top button