Redmine ‐ Installation Guide - Raphonzius/Automated-Tasks-on-Redmine GitHub Wiki


Installation Guide:

1. Installing Dependencies:

  1. Update & Upgrade:

    sudo apt-get update && sudo apt-get upgrade -y
  2. Install Required Packages:

    sudo apt install -y apache2 ruby ruby-dev build-essential libapache2-mod-passenger libmysqlclient-dev
  3. Install Local MySQL:

    sudo apt install -y mysql-server

2. Redmine - Download and Extraction:

  1. Download (Can be done via SVN Repo or SCP/FTP):

    • SVN:
      svn co redmine-5.1
    • SCP or FTP:
      1. Download from Redmine's official website.
      2. If downloaded as .zip, extract the file after transferring. If downloaded as .tar.gz, extract it after transferring to your server:
        sudo tar -xvzf ~/redmine.tar.gz
  2. Create a symlink to remove the version reference:

    sudo ln -s redmine-5.0.1 redmine

3. Setting Up the Database:

  1. Create a Database:

    sudo mysql
  2. Create an application access user:

    GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';

    [OPTIONAL] Restoring a Database:

    sudo mysql -u redmine -p redmine < dump_redmine.sql
    • The database to be populated with the dump must be empty to avoid conflicts.

4. Editing the Database Configuration File:

  1. Copy the example file:

    cd /opt/redmine
    cp config/database.yml.example config/database.yml
  2. Edit the configuration file and update it with your database information:

    vi config/database.yml
  3. Save and exit the editing mode:


5. Installing Ruby Dependencies:

  1. Install bundler:
    sudo gem install bundler
    sudo bundle install

6. Running "Essential" Scripts:

  1. Generate the environment secret token:

    bundle exec rake generate_secret_token
  2. Run the database migration script:

    sudo RAILS_ENV=production bundle exec rake db:migrate
  3. Load default data values for new additions:

    sudo RAILS_ENV=production bundle exec rake redmine:load_default_data
  4. After migrating the database, remember to reinstall your plugins:

    sudo bundle exec rake redmine:plugins:migrate RAILS_ENV=production

7. Configuring Apache:

  1. Generate the environment secret token:

    cd /etc/apache2/sites-available
  2. Create the redmine.config configuration file with the following (VirtualHost) content:

    vi redmine.config
    <VirtualHost *:80>
        RailsEnv production
        DocumentRoot /opt/redmine/public
        <Directory "/opt/redmine/public">
            Allow from all
            Require all granted
        ErrorLog ${APACHE_LOG_DIR}/redmine_error.log
        CustomLog ${APACHE_LOG_DIR}/redmine_access.log combined
  3. Disable default Apache sites:

    sudo a2dissite 000-default.conf
  4. Enable Redmine configurations:

    sudo a2ensite redmine.config
  5. Reload Apache:

    sudo systemctl reload apache2
⚠️ ** Fallback** ⚠️