Redmine is a free and open source, web-based project management and bug-tracking tool. It includes a calendar and Gantt charts to aid visual representation of projects and their deadlines. It handles multiple projects. Redmine provides integrated project management features, issue tracking, and support for various version control systems.

Redmine is written using the Ruby on Rails framework. It is cross-platform and cross-database.

Prerequisites

This document will guide you through the installation process of the Redmine and all of its prerequisites, including the optional ones. If desired, however, you may install Redmine and it's prerequisites separately, simply refering to the relevant sections below.

Although this guide will go through all the installation process, this isn't a one way path. So Redmine can use different versions of the other softwares (mariaDB, mySQL, postgreSQL, etc, as your database).

Note: At this time is important to note that this guide is an default suggestion, feel free to use other of the prerequisites mentioned on this wiki.

Ruby

Redmine version

Supported Ruby versions

Rails version used

Supported RubyGems versions

2.4.0

ruby 1.8.7, 1.9.2, 1.9.3, 2.0.0

Rails 3.2.13

RubyGems <= 1.8

jruby 1.6.7, 1.7.2

There are two simple ways to install Ruby: installing the ruby package as described in ruby or installing RVM as described in RVM(recommended).

Note: If you use RVM, pay attention to the single and multiple user differences! If you are not creating a hosting service, the multiple user (available for all users on the machine) should be the choice for simpler debuging.

And then edit this file in order to configure your database settings for "production" environment (you can configure for the "development" and "test" environments too, just change the appropriate sections).

Ruby gems

Redmine requires some RubyGems to be installed and there are multiple ways of installing them (as listed on the referenced page).

prototype-rails

unicorn (an application-server)

mysql2 (high-performance Ruby bindings for MySQL)

coderay

erubis

fastercsv

rdoc

net-ldap

rack-openid

Obviously, if you choose a different database-server, or want to use a different application-server you should replace mysql2 and unicorn to your liking.

Adding Additional Gems (Optional)

If you need to load gems that are not required by Redmine core (eg. Puma, fcgi), create a file named Gemfile.local at the root of your redmine directory. It will be loaded automatically when running bundle install:

# nano Gemfile.local

gem 'puma'

Check previously installed gems

The Redmine devs included Bundler in Redmine, which can manage Gems just like pacman manages packages. Run the following command to assure that all Redmine dependencies are met:

# bundle install --without development test

This should output a list of gems Redmine needs.

Gems Installation

Note: If you prefer, you can install all the gems as pacman packages. You have only to search for the gem package and install them as usual. As of using Ruby gem is much simpler to manage and maintain up to date gems, this will be preferable and used as default bellow.

Then you can install all the gems required by Redmine using the following command:

# cd /usr/share/webapps/redmine
# bundle install

To install without the ruby development and test environments use this instead of the last command:

# bundle install --without development test

Note: You can include/exclude environments using the above syntax.

Although it is highly recommend to enjoy all the features of Redmine, if you really does not want to use ImageMagick, you should skip the installation of the rmagick gem using:

# bundle install --without rmagick

Note: Only the gems that are needed by the adapters you've specified in your database configuration file are actually installed (eg. if your config/database.yml uses the mysql2 adapter, then only the mysql2 gem will be installed). Don't forget to re-run bundle install when you change or add adapters in this file.

Session Store Secret Generation

Now you must generate a random key that will be used by Rails to encode cookies that stores session data thus preventing their tampering:

# rake generate_secret_token

Note: For Redmine prior to 2.x this step is done by executing # rake generate_session_store.

Warning: Generating a new secret token invalidates all existing sessions after restart.

Database Structure Creation

With the database created and the access configured for Redmine, now it's time to create the database structure. This is done by running the following command under the application root directory:

These command will create tables by running all migrations one by one then create the set of the permissions and the application administrator account, named admin.

Database Population with Default Data

Now you may want to insert the default configuration data in database, like basic types of task, task states, groups, etc. To do so execute the following:

# RAILS_ENV=production rake redmine:load_default_data

Redmine will prompt for the data set language that should be loaded; you can also define the REDMINE_LANG environment variable before running the command to a value which will be automatically and silently picked up by the task:

Test the installation

To test your new installation using WEBrick web server run the following in the Redmine folder:

# ruby script/rails server webrick -e production

Once WEBrick has started, point your browser to http://localhost:3000/. You should now see the application welcome page. Use default administrator account to log in: admin/admin. You can go to Administration menu and choose Settings to modify most of the application settings.

Warning: Webrick is not suitable for production use, please only use webrick for testing that the installation up to this point is functional. Use one of the many other guides in this wiki to setup redmine to use either Passenger (aka mod_rails), FCGI or a Rack server (Unicorn, Thin, Puma or hellip) to serve up your redmine.

Configure the production server

For Apache and Nginx, it is recommended to use Phusion Passenger. Passenger, also known as mod_rails, is a module available for Nginx and Apache.

Start by installing the 'passenger' gem:

# gem install passenger

Now you have to look at your passenger gem installation directory to continue. If you don't known where it is, type:

# gem env

And look at the GEM PATHS to find where the gems are installed. If you followed this guide and installed RVM, you can have more than one path, look at the one you are using.

For this guide so far, the gem path is /usr/local/rvm/gems/ruby-2.0.0-p247@global.

And finally, the installer will provide you with further information regarding the installation (such as installing additional libraries). So, to setup your server, simply follow the output from the passenger installer.

Warning: The command above will delete ALL the gems in your system or user, depending of what type of Ruby installation you did in the prerequisites step. You must take care or you can stop working another applications that rely on Ruby gems.

If you did the last step and removed all the gems, now you will need to reinstall them all:

# gem install bundler
# bundle install --without development test

Copy the saved files:

# tar xzvf ~/redmine_files.tar.gz -C /usr/share/webapps/redmine/

Copy the installed plugins

# tar xzvf ~/redmine_plugins.tar.gz -C /usr/share/webapps/redmine/

Regenerate the secret token:

# cd /usr/share/webapps/redmine
# rake generate_secret_token

Check for any themes that you may have installed in the public/themes directory. You can copy them over but checking for updated version is ideal.

Warning: Do NOT overwrite config/settings.yml with the old one.

Update the database. This step is the one that could change the contents of your database. Go to your new redmine directory, then migrate your database:

# RAILS_ENV=production REDMINE_LANG=pt-BR rake db:migrate

If you have installed any plugins, you should also run their database migrations: