
Install Redmine on CentOS Stream 9 & 8: A Comprehensive Guide
Deploying a powerful project management tool is a critical step for any team looking to streamline workflows, track issues, and manage complex projects efficiently. Redmine, a flexible and open-source web application built on the Ruby on Rails framework, is an excellent choice. It offers robust features like issue tracking, Gantt charts, wikis, and repository integration.
This guide provides a detailed, step-by-step walkthrough for installing Redmine on a CentOS Stream 8 or 9 server, complete with a secure Apache and MariaDB setup.
Prerequisites
Before we begin, ensure you have the following:
- A server running a fresh installation of CentOS Stream 8 or 9.
- Root or sudo-level access to the server.
- A basic understanding of the Linux command line.
Step 1: Prepare Your System
First, we need to ensure our system is up-to-date and configured correctly.
- Update System Packages: Start by updating all existing packages to their latest versions. This is a crucial first step for security and stability.
bash
sudo dnf update -y
- Configure SELinux: For the initial installation, it’s easiest to set SELinux to permissive mode to avoid potential file permission conflicts. This allows the installation to proceed smoothly.
bash
sudo setenforce 0
sudo sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config
Note: While permissive mode is fine for installation, for a production environment, you should re-enable SELinux and configure the correct security contexts for Redmine.
Step 2: Install Core Dependencies
Redmine relies on a specific stack of software to run: a web server, a database, the Ruby programming language, and other essential tools. We will install all of these in one go.
- Apache (
httpd): Our web server to handle requests. - MariaDB: A popular and reliable database server.
- Ruby and Development Tools: The programming language Redmine is built on.
- Phusion Passenger: An application server that integrates Ruby on Rails applications with Apache.
- ImageMagick: A library for handling image attachments.
Install all required packages using the following command:
sudo dnf install -y @ruby httpd httpd-devel mariadb-server mariadb-devel ImageMagick ImageMagick-devel rubygem-bundler policycoreutils-python-utils mod_passenger mod_passenger-devel
Once the installation is complete, enable and start the Apache and MariaDB services so they run automatically on boot.
sudo systemctl enable --now httpd
sudo systemctl enable --now mariadb
Step 3: Set Up the Redmine Database
With MariaDB running, we need to create a dedicated database and a user for Redmine.
- Log in to the MariaDB shell.
bash
sudo mysql -u root -p
- Create the database. It is essential to use a
utf8mb4character set for full international character support.
sql
CREATE DATABASE redmine CHARACTER SET utf8mb4;
- Create a dedicated database user and grant it permissions. Replace
your_strong_passwordwith a secure password of your own.
sql
CREATE USER 'redmine_user'@'localhost' IDENTIFIED BY 'your_strong_password';
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine_user'@'localhost';
- Flush privileges to apply the changes and then exit the shell.
sql
FLUSH PRIVILEGES;
EXIT;
Step 4: Download and Install Redmine
Now we will download the latest stable version of Redmine and place it in the correct directory.
- Navigate to the
/var/www/directory, which is a standard location for web application files.
bash
cd /var/www/
- Visit the official Redmine download page to find the URL for the latest stable release. Use
wgetto download it.
bash
sudo wget https://www.redmine.org/releases/redmine-5.1.1.tar.gz
- Extract the archive and rename the resulting folder for simplicity.
bash
sudo tar -xvf redmine-5.1.1.tar.gz
sudo mv redmine-5.1.1 redmine
Step 5: Configure Redmine
This step involves connecting Redmine to our database and installing its specific Ruby dependencies.
- Navigate into the Redmine configuration directory.
bash
cd /var/www/redmine/config
- Create the database configuration file by copying the provided template.
bash
sudo cp database.yml.example database.yml
- Now, edit
database.ymlusing a text editor likenano.
bash
sudo nano database.yml
- Find the
production:section and modify it with the database details you created in Step 3.
yaml
production:
adapter: mysql2
database: redmine
host: localhost
username: redmine_user
password: "your_strong_password"
encoding: utf8mb4
- Navigate back to the main Redmine directory and install the required Ruby gems using Bundler. We exclude development and test groups for a leaner production setup.
bash
cd /var/www/redmine
sudo bundle install --without development test
- Generate a secret key for cookie session data.
bash
sudo bundle exec rake generate_secret_token
- Migrate the database. This command creates the necessary tables and structure for Redmine to function.
bash
RAILS_ENV=production sudo bundle exec rake db:migrate
- (Optional but Recommended) Load the default configuration data, which includes trackers, roles, and initial settings. You will be prompted to select a language.
bash
RAILS_ENV=production sudo bundle exec rake redmine:load_default_data
Step 6: Set File Permissions
The web server needs appropriate permissions to read and write to the Redmine directory.
Assign ownership of the Redmine files to the Apache user.
sudo chown -R apache:apache /var/www/redmine
sudo chmod -R 755 /var/www/redmine
Step 7: Configure Apache with Passenger
Finally, we need to tell Apache how to serve our Redmine application using Phusion Passenger.
Create a new Apache configuration file for Redmine.
bash
sudo nano /etc/httpd/conf.d/redmine.conf
Paste the following configuration into the file. This sets up a virtual host that directs traffic to your Redmine installation.
<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/redmine/public ServerName your_server_ip_or_domain<Directory /var/www/redmine/public> AllowOverride all Options -MultiViews Require all granted </Directory> ErrorLog /var/log/httpd/redmine_error.log CustomLog /var/log/httpd/redmine_access.log combined</VirtualHost>
Remember to replace
your_server_ip_or_domainwith your server’s public IP address or fully qualified domain name.Restart the Apache web server to apply the new configuration.
bash
sudo systemctl restart httpd
Accessing Your Redmine Installation
You can now access your new Redmine instance by navigating to http://your_server_ip_or_domain in your web browser.
The default login credentials are:
- Username: admin
- Password: admin
Your first action should be to log in and change the default administrator password immediately.
Important Security Next Steps
Your Redmine installation is now running, but for a production environment, you should take these additional steps:
- Configure a Firewall: Use
firewalldto open ports 80 (HTTP) and 443 (HTTPS) and block all other unnecessary ports. - Install an SSL Certificate: Secure your site with a free Let’s Encrypt SSL certificate to enable HTTPS, protecting user data in transit.
- Review Redmine Security Settings: Explore the Administration panel in Redmine to configure user roles, permissions, and authentication settings according to your organization’s security policies.
By following this guide, you have successfully deployed a powerful, self-hosted project management platform ready to help your team stay organized and productive.
Source: https://kifarunix.com/install-redmine-on-centos-stream-8-9/


