Redmine is Open Source Project Management and Issue Tracking Tool. Redmine allows the users to manage multiple projects and associated subprojects, has project wikis, forums, time tracking, role-based access control, calendar, integrates various version control systems , RESTful API and a repository browser and diff viewer. Here is How To Install Redmine on Ubuntu 16.04 Blank Server From SSH. Redmine is written using the Ruby on Rails framework.
There are other ways of installing Redmine developed by various known webhosts which actually avoid our described steps, like DigitalOcean :
How To Install Redmine on Ubuntu 16.04 : Commands
SSH to server instance as user with root
privilege. First update and upgrade :
---
1 | apt update -y && apt upgrade -y |
Then run the below command to install all the needed components, including mysql-server
:
1 | apt install curl subversion libmysqlclient-dev libmagickcore-dev libmagickwand-dev imagemagick g++ zlib1g-dev libyaml-dev libsqlite3-dev sqlite3 autoconf libgmp-dev libgdbm-dev libncurses5-dev automake libtool bison pkg-config libffi-dev libgmp-dev libreadline6-dev libssl-dev mysql-server |
Afer the above installation is complete, run the following command to secure MySQL installation:
1 | mysql_secure_installation |
Then, create a database for our Redmine installation:
1 2 3 4 5 | mysql -uroot -p MariaDB [(none)]> CREATE DATABASE redmine CHARACTER SET utf8; MariaDB [(none)]> GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost' IDENTIFIED BY 'redmine_password'; MariaDB [(none)]> FLUSH PRIVILEGES; MariaDB [(none)]> q |
In the above set of commands, change redmine
and redmine_password
to your own. Now, we need to create a system user for Redmine and assign to sudoers :
1 2 | sudo adduser --home /opt/redmine --shell /bin/bash --gecos 'Redmine application' redmine usermod -aG sudo redmine |
Become that Redmine user :
1 | sudo su - redmine |
Now, install Ruby and RVM :
1 2 3 4 5 6 7 8 9 | cd ~ curl -sSL https://rvm.io/mpapis.asc | gpg --import - curl -sSL https://get.rvm.io | bash -s stable --ruby To start using RVM run the following commands: source ~/.rvm/scripts/rvm rvm --default use ruby To verify everything is done correctly, use the command ruby --version. The output should be similar to the following: ruby --version |
From the above commands, we are $HOME
or ~
. We will checkout the Redmine source code to the $HOME/redmine directory
:
1 2 | svn co http://svn.redmine.org/redmine/branches/3.4-stable redmine mkdir -p ./redmine/tmp/pids ./redmine/public/plugin_assets |
We will configure the settings as next step :
1 2 3 | cp ./redmine/config/configuration.yml.example ./redmine/config/configuration.yml cp ./redmine/config/database.yml.example ./redmine/config/database.yml nano ./redmine/config/database.yml |
Change username/password in the above database.yml
file like this :
1 2 3 4 5 6 7 | production: adapter: mysql2 database: redmine host: localhost username: redmine password: "redmine_password" encoding: utf8 |
Next install Gems :
1 2 3 4 5 | cd /opt/redmine/redmine echo "gem 'puma'" >> Gemfile.local echo "gem: --no-ri --no-rdoc" >> ~/.gemrc gem install bundler bundle install --without development test postgresql SQLite |
Next prepare the database and Puma :
1 2 3 4 | rake generate_secret_token RAILS_ENV=production rake db:migrate RAILS_ENV=production REDMINE_LANG=en rake redmine:load_default_data nano ~/redmine/config/puma.rb |
Below is sample puma.rb
:
1 2 3 4 5 6 7 8 9 10 | #!/usr/bin/env puma application_path = '/opt/redmine/redmine' directory application_path environment 'production' daemonize true pidfile "#{application_path}/tmp/pids/puma.pid" state_path "#{application_path}/tmp/pids/puma.state" stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log" bind "tcp://0.0.0.0:9000" |
Now, start Puma :
1 | cd /opt/redmine/redmine/ && bundle exec puma --config config/puma.rb |
We will have Redmine installation at http://Your_IP_ADDRESS:9000
on browser.