15 C
Texas
angeloma
Senior Writer and partner

Install Redmine on Ubuntu 20.04

Hello, friends. In this post, you will learn how to install Redmine on Ubuntu 20.04 quickly and easily.

According to the official information on the project website,

Redmine is a flexible project management web application. Written using the Ruby on Rails framework, it is cross-platform and cross-database.

As you can imagine, it is open source which allows us to get the source code of the application. Also, we will be able to use it in small or medium projects.

Some of the main features of Redmine are:

  • Multiple projects support
  • Flexible role-based access control
  • Flexible issue tracking system
  • Gantt chart and calendar
  • News, documents & files management
- Advertisement -

As a project manager, it has the advantage of being able to have all the information associated with a project and delimited within the same project. In addition to allowing us to control it through a simple and very practical web interface.

So, let’s get started.

Install Redmine on Ubuntu 20.04 – First steps

When connecting to the server, make sure it is up to date. To do so, run the following commands:

apt update
apt upgrade

After this, install Apache and the passenger module.

apt install apache2 libapache2-mod-passenger
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  apache2-bin apache2-data apache2-utils libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libgdbm-compat4 libjansson4 liblua5.2-0 libperl5.30 libruby2.7
  passenger perl perl-modules-5.30 rake ruby ruby-minitest ruby-net-telnet ruby-power-assert ruby-rack ruby-test-unit ruby-xmlrpc ruby2.7 rubygems-integration
Suggested packages:
  apache2-doc apache2-suexec-pristine | apache2-suexec-custom www-browser nodejs passenger-doc python rails perl-doc libterm-readline-gnu-perl
  | libterm-readline-perl-perl make libb-debug-perl liblocale-codes-perl ri ruby-dev bundler
Recommended packages:
  ssl-cert zip fonts-lato libjs-jquery
The following NEW packages will be installed:
  apache2 apache2-bin apache2-data apache2-utils libapache2-mod-passenger libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libgdbm-compat4 libjansson4
  liblua5.2-0 libperl5.30 libruby2.7 passenger perl perl-modules-5.30 rake ruby ruby-minitest ruby-net-telnet ruby-power-assert ruby-rack ruby-test-unit ruby-xmlrpc
  ruby2.7 rubygems-integration
0 upgraded, 27 newly installed, 0 to remove and 3 not upgraded.
Need to get 14.3 MB of archives.
After this operation, 79.5 MB of additional disk space will be used.
Do you want to continue? [Y/n]

apt install mariadb-server mariadb-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  galera-3 gawk libconfig-inifiles-perl libdbi-perl libmpfr6 libsigsegv2 libsnappy1v5 mariadb-client-10.3 mariadb-client-core-10.3 mariadb-common mariadb-server-10.3
  mariadb-server-core-10.3 mysql-common socat
Suggested packages:
  gawk-doc libclone-perl libmldbm-perl libnet-daemon-perl libsql-statement-perl mailx mariadb-test tinyca
Recommended packages:
  libdbd-mysql-perl libterm-readkey-perl libhtml-template-perl
The following NEW packages will be installed:
  galera-3 gawk libconfig-inifiles-perl libdbi-perl libmpfr6 libsigsegv2 libsnappy1v5 mariadb-client mariadb-client-10.3 mariadb-client-core-10.3 mariadb-common
  mariadb-server mariadb-server-10.3 mariadb-server-core-10.3 mysql-common socat
0 upgraded, 16 newly installed, 0 to remove and 3 not upgraded.
Need to get 19.9 MB of archives.
After this operation, 167 MB of additional disk space will be used.
Do you want to continue? [Y/n]

Installing MariaDB on Ubuntu 20.04

Now it is time to install the MariaDB database driver. You can do this by running

apt install mariadb-server mariadb-client

When installing, set a root password and “secure” the installation using the mysql_secure_installation script.

mysql_secure_installation

Define the root password and answer the questions as appropriate. In my chaos, I’ve answered Y to everything.

Now, access the MariaDB console and create the new database for Redmine as well as the user and password for it.

mysql -u root -p
CREATE DATABASE redminedb CHARACTER SET utf8mb4;
GRANT ALL PRIVILEGES ON redminedb.* TO 'redmineuser'@'localhost' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
Exit;

Now with MariaDB ready, we can start the installation.

Install and configure Redmine on Ubuntu 20.04

Fortunately, Redmine is available from the official Ubuntu repositories. For now, this is the easiest and safest way to do the installation, so we’ll do it this way.

apt install redmine redmine-mysql
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  dbconfig-common dbconfig-mysql fontconfig-config fonts-dejavu-core imagemagick-6-common libfftw3-double3 libfontconfig1 libgomp1 libjbig0 libjpeg-turbo8 libjpeg8
  libjs-chart.js libjs-jquery libjs-jquery-ui libjs-raphael liblcms2-2 liblqr-1-0 libmagickcore-6.q16-6 libmysqlclient21 libtiff5 libwebp6 libwebpmux3 libx11-6
  libx11-data libxau6 libxcb1 libxdmcp6 libxext6 libxslt1.1 ruby-actioncable ruby-actionmailer ruby-actionpack ruby-actionpack-action-caching
  ruby-actionpack-xml-parser ruby-actionview ruby-activejob ruby-activemodel ruby-activerecord ruby-activestorage ruby-activesupport ruby-addressable ruby-arel
  ruby-atomic ruby-builder ruby-bundler ruby-coderay ruby-concurrent ruby-crass ruby-css-parser ruby-erubi ruby-eventmachine ruby-globalid ruby-hike ruby-htmlentities
  ruby-i18n ruby-jquery-rails ruby-loofah ruby-mail ruby-marcel ruby-method-source ruby-mime-types ruby-mime-types-data ruby-mimemagic ruby-mini-mime ruby-molinillo
  ruby-multi-json ruby-mysql2 ruby-net-http-persistent ruby-net-ldap ruby-nio4r ruby-nokogiri ruby-pkg-config ruby-public-suffix ruby-rack-test ruby-rails
  ruby-rails-deprecated-sanitizer ruby-rails-dom-testing ruby-rails-html-sanitizer ruby-rails-observers ruby-railties ruby-rbpdf ruby-rbpdf-font ruby-redcarpet
  ruby-request-store ruby-rmagick ruby-roadie ruby-roadie-rails ruby-rouge ruby-sprockets ruby-sprockets-rails ruby-thor ruby-thread-safe ruby-tilt ruby-tzinfo
  ruby-websocket-driver ruby-websocket-extensions
Suggested packages:
  libfftw3-bin libfftw3-dev libjs-jquery-ui-docs javascript-common liblcms2-utils libmagickcore-6.q16-6-extra bzr cvs darcs git mercurial ruby-fcgi subversion
Recommended packages:
  javascript-common ghostscript gsfonts ruby-oj
The following NEW packages will be installed:
  dbconfig-common dbconfig-mysql fontconfig-config fonts-dejavu-core imagemagick-6-common libfftw3-double3 libfontconfig1 libgomp1 libjbig0 libjpeg-turbo8 libjpeg8
  libjs-chart.js libjs-jquery libjs-jquery-ui libjs-raphael liblcms2-2 liblqr-1-0 libmagickcore-6.q16-6 libmysqlclient21 libtiff5 libwebp6 libwebpmux3 libx11-6
  libx11-data libxau6 libxcb1 libxdmcp6 libxext6 libxslt1.1 redmine redmine-mysql ruby-actioncable ruby-actionmailer ruby-actionpack ruby-actionpack-action-caching
  ruby-actionpack-xml-parser ruby-actionview ruby-activejob ruby-activemodel ruby-activerecord ruby-activestorage ruby-activesupport ruby-addressable ruby-arel
  ruby-atomic ruby-builder ruby-bundler ruby-coderay ruby-concurrent ruby-crass ruby-css-parser ruby-erubi ruby-eventmachine ruby-globalid ruby-hike ruby-htmlentities
  ruby-i18n ruby-jquery-rails ruby-loofah ruby-mail ruby-marcel ruby-method-source ruby-mime-types ruby-mime-types-data ruby-mimemagic ruby-mini-mime ruby-molinillo
  ruby-multi-json ruby-mysql2 ruby-net-http-persistent ruby-net-ldap ruby-nio4r ruby-nokogiri ruby-pkg-config ruby-public-suffix ruby-rack-test ruby-rails
  ruby-rails-deprecated-sanitizer ruby-rails-dom-testing ruby-rails-html-sanitizer ruby-rails-observers ruby-railties ruby-rbpdf ruby-rbpdf-font ruby-redcarpet
  ruby-request-store ruby-rmagick ruby-roadie ruby-roadie-rails ruby-rouge ruby-sprockets ruby-sprockets-rails ruby-thor ruby-thread-safe ruby-tilt ruby-tzinfo
  ruby-websocket-driver ruby-websocket-extensions
0 upgraded, 98 newly installed, 0 to remove and 3 not upgraded.
Need to get 21.7 MB of archives.
After this operation, 78.9 MB of additional disk space will be used.
Do you want to continue? [Y/n]

During the installation, you will be asked if you want to configure the Redmine database.

1.- Installing Redmine on Ubuntu 20.04
1.- Installing Redmine on Ubuntu 20.04

Then, set a password to complete the process

2.- Define a database password
2.- Define a database password

After this, it’s a good idea to install bundler because it provides an environment for Ruby on Rails projects and since Redmine is built on this, it’s a must install.

gem install bundler
Fetching bundler-2.2.24.gem
Successfully installed bundler-2.2.24
Parsing documentation for bundler-2.2.24
Installing ri documentation for bundler-2.2.24
Done installing documentation for bundler after 3 seconds
1 gem installed

After you install it, edit the Passenger module configuration file.

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

And replace the contents with this

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

Make a Redmine symbolic link to the Apache root directory

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

The next step is to create a file called gemfile.lock in addition to this, you have to make it belong to the apache user.

touch /usr/share/redmine/Gemfile.lock
chown www-data:www-data /usr/share/redmine/Gemfile.lock
chown -R www-data:www-data /var/www/html/redmine

The most convenient way is to create a new VirtualHost to manage the Redmine web interface.

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

And add the following

<VirtualHost *:80>
  ServerAdmin [email protected]
  DocumentRoot /var/www/html/redmine
  ServerName redmine.osradar.test

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

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

Remember to replace the ServerName and ServerAdmin values with your own.

Save the changes and close the editor.

Optional: Enabling HTTPS access

It is recommended to install the security certificates that enable HTTPS connection to Redmine. If the installation will be available via the Internet then this step is highly recommended.

So, install Certbot and its Apache plugin.

apt install certbot python3-certbot-apache

And now, generate and install a certificate for your domain.

certbot --apache --d [your-domain]

Then follow the instructions and when finished, restart Apache to complete the process.

systemctl restart apache2

Access to the Redmine installation

Now, open your favorite web browser and go to https://your-domain and you will see a HOME screen.

On the right-hand side, you will see a Sign Up button. Log in with the default credentials admin as user and admin as password.

3.- Redmine login screen
3.- Redmine login screen

After logging in, you will be prompted to change the password and you will be able to set your own.

And finally, you will see the Redmine main panel.

4.- Redmine on Ubuntu 20.04
4.- Redmine on Ubuntu 20.04

So, enjoy it.

Conclusion

Redmine is a tool that allows you to manage projects from a comfortable web interface. Made in Ruby on Rails it allows us to have the best of this language and the efficiency of being Open Source so we can even contribute with the code.

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

LEAVE A REPLY

Please enter your comment!
Please enter your name here



Latest article