
Mastering Redmine: A Comprehensive Guide to Installing on Rocky Linux 8 & 9
In the world of project management, having a tool that is both powerful and flexible is paramount. Redmine stands out as a leading open-source solution, offering robust features like issue tracking, Gantt charts, wikis, and repository integration. By self-hosting Redmine on a stable platform like Rocky Linux, you gain complete control over your data and can customize the environment to your exact needs.
This guide provides a detailed, step-by-step walkthrough for installing and configuring Redmine on your Rocky Linux 8 or 9 server. We will cover everything from setting up the database and web server to securing your final installation.
Prerequisites for Installation
Before we begin, ensure you have the following ready:
- A server running a fresh installation of Rocky Linux 8 or 9.
- Root or sudo-level access to the server.
- A basic understanding of the Linux command line.
Let’s get started by preparing your server environment. First, update all your system packages to their latest versions:
sudo dnf update -y
Step 1: Set Up the MariaDB Database
Redmine requires a database to store all its data. MariaDB is a reliable and high-performance choice that works perfectly.
First, install the MariaDB server and client packages.
sudo dnf install mariadb-server -y
Once installed, enable and start the MariaDB service so that it launches automatically on boot.
sudo systemctl enable --now mariadb
Next, run the included security script. This is a crucial step to remove insecure default settings and set a root password for your database.
sudo mysql_secure_installation
Follow the on-screen prompts to secure your MariaDB instance. Now, log in to the MariaDB shell to create a dedicated database and user for Redmine.
sudo mysql -u root -p
Inside the MariaDB prompt, execute the following commands. Remember to replace 'your_strong_password'
with a secure password of your own.
CREATE DATABASE redmine CHARACTER SET utf8mb4;
CREATE USER 'redmineuser'@'localhost' IDENTIFIED BY 'your_strong_password';
GRANT ALL PRIVILEGES ON redmine.* TO 'redmineuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Your database is now configured and ready for Redmine.
Step 2: Install Ruby and Required Dependencies
Redmine is built on the Ruby on Rails framework, so we need to install Ruby and several development tools. The EPEL (Extra Packages for Enterprise Linux) repository contains many of the packages we’ll need.
sudo dnf install epel-release -y
sudo dnf install ruby ruby-devel gcc-c++ ImageMagick ImageMagick-devel make -y
With Ruby installed, we’ll use its package manager, gem
, to install Bundler. Bundler is a tool that manages all the specific library versions (gems) an application needs.
sudo gem install bundler
Step 3: Download and Configure Redmine
Now it’s time to download the Redmine source code. You can find the latest stable version on the official Redmine website. We will download it, extract it, and move it to a standard directory like /opt
.
First, download the latest version (check the Redmine site for the most current .tar.gz
link).
wget https://www.redmine.org/releases/redmine-5.1.2.tar.gz
tar -xvzf redmine-5.1.2.tar.gz
sudo mv redmine-5.1.2 /opt/redmine
Next, navigate to the Redmine directory and copy the sample database configuration file.
cd /opt/redmine
sudo cp config/database.yml.example config/database.yml
Now, edit this new file to add the database credentials we created earlier.
sudo nano config/database.yml
Find the production
section and modify it to look like this, using the database name, user, and password you created in Step 1.
production:
adapter: mysql2
database: redmine
host: localhost
username: redmineuser
password: "your_strong_password"
encoding: utf8mb4
With the configuration in place, we’ll install the required gems using Bundler. We exclude development and test groups to keep the installation lean for a production environment.
sudo bundle config set --local without 'development test'
sudo bundle install
Finally, generate a secret key for cookie session data and run the database migration to create the table structure.
sudo bundle exec rake generate_secret_token
sudo RAILS_ENV=production bundle exec rake db:migrate
Step 4: Configure Apache and Passenger
To serve the Redmine application over the web, we will use the Apache web server with the Phusion Passenger module. Passenger makes it easy for Apache to run Ruby on Rails applications.
Install Apache and the necessary Passenger packages.
sudo dnf install httpd passenger passenger-devel -y
Next, create a dedicated Apache configuration file for your Redmine site.
sudo nano /etc/httpd/conf.d/redmine.conf
Paste the following configuration into the file. If you plan to use a domain name, replace your_server_ip
with your domain.
<VirtualHost *:80>
ServerName your_server_ip
DocumentRoot /opt/redmine/public
<Directory /opt/redmine/public>
Allow from all
Options -MultiViews
Require all granted
</Directory>
ErrorLog /var/log/httpd/redmine_error.log
CustomLog /var/log/httpd/redmine_access.log combined
</VirtualHost>
File permissions are critical for security and functionality. We must give the Apache user ownership of the Redmine files so it can read them and write to necessary log and file upload directories.
sudo chown -R apache:apache /opt/redmine
sudo chmod -R 755 /opt/redmine
Because Rocky Linux uses SELinux for enhanced security, we must create a policy to allow Apache to connect to the network, which is required for it to communicate with the database.
sudo setsebool -P httpd_can_network_connect 1
Now, enable and start the Apache web server.
sudo systemctl enable --now httpd
Final Steps and Security Best Practices
You can now access your Redmine installation by navigating to http://your_server_ip
in your web browser. You will be greeted by the Redmine homepage.
- Default Login: The initial administrator login is admin with the password admin.
- Change Your Password: The first thing you should do after logging in is change the administrator password to something strong and unique.
To further secure your installation:
- Enable HTTPS: Use a tool like Certbot from Let’s Encrypt to configure a free SSL/TLS certificate for your domain. This encrypts traffic between your users and the server.
- Regular Backups: Implement a regular backup schedule for both your
/opt/redmine/files
directory and your MariaDBredmine
database. - Keep Updated: Periodically check for new versions of Redmine, its plugins, and all server packages to protect against security vulnerabilities.
By following this guide, you have successfully deployed a powerful, self-hosted project management system on a secure and stable Rocky Linux server.
Source: https://kifarunix.com/install-redmine-on-rocky-linux/