Project

General

Profile

Actions

Install Redmine 6.0.3 on Debian 12.4 (MySQL)

Step 1: System Preparation

You need root privileges.

  1. Ensure all existing packages are up-to-date
    apt update
    apt upgrade
    
  2. install vim
    apt install vim
    
  3. install sudo
    apt install sudo
    
  4. Create user redmine - # set 17 random characters password
    adduser redmine
    
  5. make redmine to have sudo priviledges
    usermod -aG sudo redmine
    
  6. switch to redmine
    su - redmine
    
  7. Install required dependencies
    sudo apt install build-essential libyaml-dev default-mysql-server default-mysql-client ruby ruby-dev libmariadb-dev-compat libmariadb-dev imagemagick libmagickwand-dev apache2 libapache2-mod-passenger curl -y
    

Step 2: Install and configure MySQL

  1. Secure the MySQL installation - be ready for many questions
    sudo mysql_secure_installation
    
  2. Create a database and user for Redmine - prepare <password>
    sudo mysql -u root -p
    

    > CREATE DATABASE redmine CHARACTER SET utf8mb4;
    > CREATE USER 'redmine'@'localhost' IDENTIFIED BY '<password>';
    > GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
    > FLUSH PRIVILEGES;
    > EXIT;
    
  3. Check users
    sudo mysql -u root -p
    

    > SELECT User, Host FROM mysql.user;
    > SELECT * FROM mysql.user where User='redmine'\G;
    > EXIT;
    

Step 3: Install Redmine

  1. Download and extract the latest stable Redmine version
    cd /opt
    sudo wget https://www.redmine.org/releases/redmine-6.0.3.tar.gz
    sudo tar -xzf redmine-6.0.3.tar.gz
    sudo rm redmine-6.0.3.tar.gz
    sudo mv redmine-6.0.3 redmine
    

Step 4: File Permissions

sudo chown -R www-data:www-data /opt/redmine
sudo chmod -R 755 /opt/redmine
sudo mkdir -p /opt/redmine/tmp /opt/redmine/tmp/pdf /opt/redmine/public/plugin_assets
sudo chown -R www-data:www-data /opt/redmine/tmp /opt/redmine/public/plugin_assets
sudo chmod -R 755 /opt/redmine/tmp /opt/redmine/public/plugin_assets

Step 5: Configure Redmine

  1. Ensure all existing packages are up-to-date
    sudo apt update
    sudo apt upgrade
    
  2. Create the database configuration
    cd /opt/redmine
    sudo cp config/database.yml.example config/database.yml
    sudo vim config/database.yml
    
  3. Add the following configuration (adjust as needed):
    production:
      adapter: mysql2
      database: redmine
      host: localhost
      username: redmine
      password: <your_password>
      encoding: utf8mb4
      tx_isolation: 'READ-COMMITTED'
    
  4. Install Bundler
    sudo gem install bundler
    
  5. Install required gems
    sudo bundle install --without development test
    
  6. Generate the secret token
    cd /opt/redmine
    sudo bundle exec rake generate_secret_token
    
  7. Set up the database
    cd /opt/redmine
    sudo RAILS_ENV=production bundle exec rake db:migrate
    sudo RAILS_ENV=production bundle exec rake redmine:load_default_data
    

Step 6: Configure Apache

  1. Create an Apache virtual host configuration
    sudo vim /etc/apache2/sites-available/redmine.conf
    
  2. Add the following configuration
    <VirtualHost *:80>
        ServerName <your.domain.com>
        ServerAdmin <admin_email>
        DocumentRoot /opt/redmine/public
    
        <Directory "/opt/redmine/public">
            Allow from all
            Require all granted
            Options -MultiViews
        </Directory>
    
        ErrorLog ${APACHE_LOG_DIR}/redmine_error.log
        CustomLog ${APACHE_LOG_DIR}/redmine_access.log combined
    
        PassengerRuby /usr/bin/ruby
    </VirtualHost>
    
  3. check the syntax of your Apache configuration
    sudo apache2ctl configtest
    
  4. Enable the site and required modules
    sudo a2enmod passenger
    sudo a2ensite redmine
    sudo systemctl restart apache2
    
  5. check status
    sudo systemctl status apache2.service
    sudo journalctl -xeu apache2.service
    

Step 7: Final Configuration

  1. Access Redmine through your web browser at http://your.domain.com
  2. If you see Apache2 Debian Default Page - Check the default Apache site is conflicting with your Redmine site
    sudo a2dissite 000-default
    sudo systemctl reload apache2
    
  3. Log in with default credentials:
    - Username: admin
    - Password: admin
  4. Change the admin password immediately after the first login!

DONE.

Updated by Blanka Bou 22 days ago ยท 3 revisions