How to Install Redmine 603 on Debian 124 (MySQL) » History » Revision 2
Revision 1 (Blanka Bou, 2025-03-10 11:27) → Revision 2/3 (Blanka Bou, 2025-03-10 11:29)
h1. How to Install Redmine 6.0.3 on Debian 12.4 124 (MySQL) h2. Step 1: System Preparation You need root privileges. # Ensure all existing packages are up-to-date <pre> apt update apt upgrade </pre> # install vim <pre> apt install vim </pre> # install sudo <pre> apt install sudo </pre> # Create user redmine - # set 17 random characters password <pre> adduser redmine </pre> # make redmine to have sudo priviledges <pre> usermod -aG sudo redmine </pre> # switch to redmine <pre> su - redmine </pre> # Install required dependencies <pre> 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 </pre> h2. Step 2: Install and configure MySQL # Secure the MySQL installation - be ready for many questions <pre> sudo mysql_secure_installation </pre> # Create a database and user for Redmine - prepare <password> <pre> sudo mysql -u root -p </pre> <pre> > CREATE DATABASE redmine CHARACTER SET utf8mb4; > CREATE USER 'redmine'@'localhost' IDENTIFIED BY '<password>'; > GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost'; > FLUSH PRIVILEGES; > EXIT; </pre> # Check users <pre> sudo mysql -u root -p </pre> <pre> > SELECT User, Host FROM mysql.user; > SELECT * FROM mysql.user where User='redmine'\G; > EXIT; </pre> h2. Step 3: Install Redmine # Download and extract the latest stable Redmine version <pre> 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 </pre> h2. Step 4: File Permissions <pre> 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 </pre> h2. Step 5: Configure Redmine # Ensure all existing packages are up-to-date <pre> sudo apt update sudo apt upgrade </pre> # Create the database configuration <pre> cd /opt/redmine sudo cp config/database.yml.example config/database.yml sudo vim config/database.yml </pre> # Add the following configuration (adjust as needed): <pre> production: adapter: mysql2 database: redmine host: localhost username: redmine password: <your_password> encoding: utf8mb4 tx_isolation: 'READ-COMMITTED' </pre> # Install Bundler <pre> sudo gem install bundler </pre> # Install required gems <pre> sudo bundle install --without development test </pre> # Generate the secret token <pre> cd /opt/redmine sudo bundle exec rake generate_secret_token </pre> # Set up the database <pre> cd /opt/redmine sudo RAILS_ENV=production bundle exec rake db:migrate sudo RAILS_ENV=production bundle exec rake redmine:load_default_data </pre> h2. Step 6: Configure Apache # Create an Apache virtual host configuration <pre> sudo vim /etc/apache2/sites-available/redmine.conf </pre> # Add the following configuration <pre> <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> </pre> # check the syntax of your Apache configuration <pre> sudo apache2ctl configtest </pre> # Enable the site and required modules <pre> sudo a2enmod passenger sudo a2ensite redmine sudo systemctl restart apache2 </pre> # check status <pre> sudo systemctl status apache2.service sudo journalctl -xeu apache2.service </pre> h2. Step 7: Final Configuration # Access Redmine through your web browser at http://your.domain.com # If you see Apache2 Debian Default Page - Check the default Apache site is conflicting with your Redmine site <pre> sudo a2dissite 000-default sudo systemctl reload apache2 </pre> # Log in with default credentials: - Username: admin - Password: admin # Change the admin password immediately after the first login! *DONE.*