Actions
Install Redmine 6.0.3 on Debian 12.4 (MySQL)¶
Step 1: System Preparation¶
You need root privileges.
- Ensure all existing packages are up-to-date
apt update apt upgrade
- install vim
apt install vim
- install sudo
apt install sudo
- Create user redmine - # set 17 random characters password
adduser redmine
- make redmine to have sudo priviledges
usermod -aG sudo redmine
- switch to redmine
su - redmine
- 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¶
- Secure the MySQL installation - be ready for many questions
sudo mysql_secure_installation
- 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;
- 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¶
- 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¶
- Ensure all existing packages are up-to-date
sudo apt update sudo apt upgrade
- Create the database configuration
cd /opt/redmine sudo cp config/database.yml.example config/database.yml sudo vim config/database.yml
- 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'
- Install Bundler
sudo gem install bundler
- Install required gems
sudo bundle install --without development test
- Generate the secret token
cd /opt/redmine sudo bundle exec rake generate_secret_token
- 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¶
- Create an Apache virtual host configuration
sudo vim /etc/apache2/sites-available/redmine.conf
- 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>
- check the syntax of your Apache configuration
sudo apache2ctl configtest
- Enable the site and required modules
sudo a2enmod passenger sudo a2ensite redmine sudo systemctl restart apache2
- check status
sudo systemctl status apache2.service sudo journalctl -xeu apache2.service
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
sudo a2dissite 000-default sudo systemctl reload apache2
- Log in with default credentials:
- Username: admin
- Password: admin - Change the admin password immediately after the first login!
DONE.
Updated by Blanka Bou 22 days ago ยท 3 revisions