In this tutorial we will show you how to install Redmine on Ubuntu 18.04 LTS. For those of you who didn’t know, Redmine is a project management web app that allows users to manage projects flexibly while offering robust monitoring tools and a broad library of plug-ins. 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 through the step by step installation Wine on an Ubuntu 18.04 (Bionic Beaver) server.
Install Redmine on Ubuntu 18.04 LTS Bionic Beaver
Step 1. First, make sure that all your system packages are up-to-date by running these following apt-get commands in the terminal.
1 2 3 | sudoaptupdate sudoaptupgrade sudoaptinstallbuild-essentiallibmysqlclient-devimagemagicklibmagickwand-dev |
MySQL needs to be configured so that Redmine can store data, so we will install MySQL server:
1 | apt-getinstallmysql-servermysql-client |
By default, MySQL is not hardened. You can secure MySQL using the mysql_secure_installation script. You should read and below each steps carefully which will set root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MySQL.
1 | mysql_secure_installation |
Configure it like this:
1 2 3 4 5 | -Setrootpassword?[Y/n]y -Removeanonymoususers?[Y/n]y -Disallowrootloginremotely?[Y/n]y -Removetestdatabaseandaccesstoit?[Y/n]y -Reloadprivilegetablesnow?[Y/n]y |
Next we will need to log in to the MySQL console and create a database for the Redmine. Run the following command:
1 | mysql-uroot-p |
This will prompt you for a password, so enter your MySQL root password and hit Enter. Once you are logged in to your database server you need to create a database for Redmine installation:
1 2 3 4 | CREATEDATABASEredmin GRANTALLPRIVILEGESONredmine.*TO'redmine'@'localhost'IDENTIFIEDBY'PASSWORD'; FLUSHPRIVILEGES; \q |
Install Ruby using following command:
1 | sudoaptinstallruby-full |
Passenger is a fast and lightweight web application server for Ruby, Node.js and Python that can be integrated with Apache and Nginx. We will install Passenger as an Nginx module:
1 | sudoaptinstalldirmngrgnupgapt-transport-httpsca-certificates |
Next, import the repository GPG key and enable the Phusionpassenger repository:
1 2 | sudoapt-keyadv--recv-keys--keyserverhkp://keyserver.ubuntu.com:80 561F9B9CAC40B2F7 sudoadd-apt-repository'deb https://oss-binaries.phusionpassenger.com/apt/passenger bionic main' |
Once the repository is enabled, update the packages list and install the Passenger Nginx module with:
1 2 | sudoaptupdate sudoaptinstalllibnginx-mod-http-passenger |
First, download the latest version of Redmine, at the moment of writing this article it is version 4:
1 2 3 | sudocurl-Lhttp://www.redmine.org/releases/redmine-4.0.1.tar.gz -o /tmp/redmine.tar.gz sudotarzxf/tmp/redmine.tar.gz sudomv/tmp/redmine-4.0.1/opt/redmine |
Make the following changes to the database.yml file:
1 2 | sudocp/opt/redmine/config/database.yml.example/opt/redmine/config/database.yml sudonano/opt/redmine/config/database.yml |
Add following content:
1 2 3 4 5 6 7 | production: adapter:mysql2 database:redmine host:localhost username:redmine password:"change-with-strong-password" encoding:utf8 |
Install the Ruby dependencies and migrate the database:
1 2 3 | cd/opt/redmine/ sudogeminstallbundler--no-rdoc--no-ri sudobundleinstall--withoutdevelopmenttestpostgresqlsqlite |
Generate the secret token using the following command:
1 2 3 | cd/opt/redmine/ sudobundleexecrakegenerate_secret_token sudoRAILS_ENV=productionbundleexecrakedb:migrate |
Then, Set the correct permissions by issuing following chown command:
1 | sudochown-Rwww-data:/opt/redmine/ |
Open your text editor and create the following Nginx vhost file:
1 | sudonano/etc/nginx/sites-available/example.com |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | # Redirect HTTP -> HTTPS server{ listen80; server_namewww.example.comexample.com; includesnippets/letsencrypt.conf; return301https://example.com$request_uri; } # Redirect WWW -> NON WWW server{ listen443sslhttp2; server_namewww.example.com; ssl_certificate/etc/letsencrypt/live/example.com/fullchain.pem; ssl_certificate_key/etc/letsencrypt/live/example.com/privkey.pem; ssl_trusted_certificate/etc/letsencrypt/live/example.com/chain.pem; includesnippets/ssl.conf; return301https://example.com$request_uri; } server{ listen443sslhttp2; server_nameexample.com; root/opt/redmine/public; # SSL parameters ssl_certificate/etc/letsencrypt/live/example.com/fullchain.pem; ssl_certificate_key/etc/letsencrypt/live/example.com/privkey.pem; ssl_trusted_certificate/etc/letsencrypt/live/example.com/chain.pem; includesnippets/ssl.conf; includesnippets/letsencrypt.conf; # log files access_log/var/log/nginx/example.com.access.log; error_log/var/log/nginx/example.com.error.log; passenger_enabledon; passenger_min_instances1; client_max_body_size10m; } |
Enable the server block by creating a symbolic link to the sites-enabled directory:
1 | sudoln-s/etc/nginx/sites-available/example.com/etc/nginx/sites-enabled/ |
Restart the web server for the changes to take effect:
1 | sudosystemctlrestartnginx |
Redmine will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://mydomain.com and complete the required the 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.
Congratulation’s! You have successfully installed Redmine. Thanks for using this tutorial for installing Redmine project management web app on Ubuntu 18.04 LTS (Bionic Beaver) system. For additional help or useful information, we recommend you to check the official Redmine web site.