Content

How to install Redmine on Amazon Web Services (AWS) - Ubuntu 18.04 LTS - Part 1

Redmine is an open-source project management and issue tracking web application. It runs on top of Ruby on Rails and it is designed to be cross-platform and cross-database. In this tutorial, you will learn how to install Redmine on Amazon Web Services (AWS).

There are two main options to install Redmine on Amazon Web Services (AWS):

  • Using a plain AWS Linux instance (EC2 or Lightsail) and manually install Redmine, or
  • Using a preconfigured one-click-to-install Redmine Lightsail instance.

If we go for the first option, we will be in full control of every aspect of our Redmine deployment. On the other hand, the second option offers a quick and easy solution to have  Redmine up and running in a matter of minutes, not getting involved with all the installation and configuration details.

The first part of this tutorial describes how to install Redmine on a plain AWS Linux instance.

 

Prerequisites

Before starting the process, make sure the following prerequisites are met:

  • You have an Amazon Web Services Account with admin privileges.
  • You have a domain name for your Redmain application such as redmine.mydomain.com.
  • You have access to the DNS configuration for your domain.

 

Installing Redmine on a plain Linux EC2 or LightSail instance

For the purpose of this tutorial, we understand that you have already launched an AWS EC2 or Lightsail instance running Ubuntu 18.04 LTS.

We will install Redmine on this Linux instance using MySQL database, NGINX web server, and Phusion Passenger application server.

 

Configure the DNS Server

Before connecting to your instance, you need to configure your DNS. Create a DNS entry for your Redmine domain name (redmine.mydomain.com) pointing to the public IP address of your AWS Linux instance.

You can do this using the AWS Route 53 service.

image001

DNS Configuration Using AWS Route 53

The public IP of your Ubuntu 18.04 LTS instance can be found at your EC2 Management Console or at your Lightsail Console.

image003

AWS EC2 Management Console

image005

AWS Lightsail Console

Once your DNS entry is configured, connect to your Linux instance and complete the following steps.

 

Install and configure MySQL database

1. Install MySQL server:

sudo apt update

sudo apt install mysql-server mysql-client

 

2. Perform the initial MySQL server configuration:

sudo mysql_secure_installation

You will be prompted for:

  • activating the VALIDATE PASSWORD PLUGIN (say yes and choose STRONG passwords)
  • selecting the root user password.
  • removing anonymous users (say yes).
  • disallowing root remote login (say no if you are planning to connect to the database from outside your Ubuntu Linux instance, say yes otherwise).

 

3. Check that MySQL server is running:

sudo systemctl status mysql

(you should see active (running) as part of the command response)

 

4. Create a new database and a new database user for Redmine:

sudo mysql

mysql > CREATE DATABASE redminedb CHARACTER SET utf8mb4;

mysql > GRANT ALL ON redminedb.* TO 'redminedbusr'@'localhost' IDENTIFIED BY 'password';

mysql > EXIT

 

Install Ruby

Install the default Ruby version for your Linux distribution. If you need a different version, you can use RVM (Ruby Version Manager).

 

1. Install Ruby:

sudo apt install ruby-full

 

Install NGINX and Passenger

NGINX is an open-source web server designed for maximum performance and stability. Passenger is an open-source application server that integrates with NGINX to run Ruby software, such as Redmine, over the web.  In our case, we need to install both.

 

1. Install NGINX:

sudo apt install nginx

 

2. Check that NGINX is properly running after the installation.

sudo systemctl status nginx

(you should see active (running) as part of the command response)

 

3. Install Passenger required dependencies:

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

 

4. Add Passenger PGP key and APT repository:

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 561F9B9CAC40B2F7

sudo sh -c 'echo deb https://oss-binaries.phusionpassenger.com/apt/passenger bionic main > /etc/apt/sources.list.d/passenger.list'

sudo apt-get update

 

5. Install Passenger:

sudo apt install libnginx-mod-http-passenger

 

Install and configure Redmine

Before continuing the installation, check for the latest Redmine version available. You can find it on the Redmine downloads page.

image007

Redmine Downloads Page

Note down your target version and continue.

 

1. Install the dependencies required to build Redmine:

sudo apt install build-essential libmysqlclient-dev imagemagick libmagickwand-dev

 

2. Download Redmine to your /tmp directory:

sudo curl -L http://www.redmine.org/releases/redmine-4.1.0.tar.gz -o /tmp/redmine.tar.gz

 

3. Extract the downloaded archive and copy the application files to the installation directory:

cd /tmp

sudo tar zxf /tmp/redmine.tar.gz

sudo mv /tmp/redmine-4.1.0 /var/www/html/redmine/

 

3. Configure Redmine database settings:

3.1. Open the database configuration file (database.yml)

cd /var/www/html/redmine/config/

cp database.yml.example database.yml

sudo nano /var/www/html/redmine/config/database.yml

 

3.2. Apply the changes shown below to the production section of the file:

production:

adapter: mysql2

database: redminedb

host: localhost

username: redminedbusr

password: "password"

encoding: utf8mb4

 

3.3 Install the Ruby dependencies required to run Redmine:

cd /var/www/html/redmine/

sudo gem install bundler --no-rdoc --no-ri

sudo bundle install --without development test postgresql sqlite

 

3.4 Migrate the database and configure the running environment.

cd /var/www/html/redmine/

sudo bundle exec rake generate_secret_token

sudo RAILS_ENV=production bundle exec rake db:migrate

 

Configure NGINX

This is the last step of our tutorial. After completing your NGINX configuration you sho will have a fully operational Redmine server running on your Ubuntu 18.04 LTS box.

 

1. Create a virtual host for your Redmine application:

sudo nano /etc/nginx/sites-available/redmine.mydomain.com

 

2. Enter the following virtual host configuration and save your file:

server {

listen 80;

server_name redmine.mydomain.com;

root /var/www/html/redmine/public;

passenger_enabled on;

passenger_min_instances 1;

client_max_body_size 10m;

# redirect server error pages to the static page /50x.html

#

error_page 500 502 503 504 /50x.html;

location = /50x.html {

root html;

}

}

 

3. Enable your virtual host by linking the newly created configuration file into the sites-enabled directory:

sudo ln -s /etc/nginx/sites-available/redmine.mydomain.com /etc/nginx/sites-enabled/redmine.mydomain.com

 

4. Verify your NGINX configuration:

sudo nginx -t

COMMAND OUTPUT:

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok

nginx: configuration file /etc/nginx/nginx.conf test is successful

 

5. Restart the NGINX server:

sudo systemctl restart nginx

 

Access Redmine

1. Open your web browser and type your Redmine domain name at the address bar. The Redmine login screen will show up.

image009

Redmine Initial Login Screen

2. Login in to your Redmine server using the default credentials (username: admin and password: admin) and, when prompted, set a new password for your admin account.

3. Finally, configure your admin account settings, including your email address and timezone.

image011

Congratulations! Your Redmine is ready!

If you want to discover other ways of deploying Redmine on Amazon Web Services (AWS), have a look at the second part of this tutorial.

 

Author: Jose OmedesLukáš Beňa

Additional information
Free Trial

Easy Redmine 10 upgrade
Top plugins & features
New & mobile design
Server upgrades
Global cloud

Start Free Trial

Try Easy Redmine in a 30-day free trial

Full-featured, 30 Days, SSL protected, Daily Backups, In your Geo Location

or