Install Redmine on CentOS 8
You’ll learn how to get a fresh copy of Redmine running on a clean CentOS 8 server in under an hour, including the database setup and basic security hardening that keeps the web app from becoming a playground for bad guys.
Prerequisites – what you need before you start
- A CentOS 8 machine with a non‑root user that can sudo.
- An internet connection to fetch packages.
- Basic knowledge of the command line (you’ve probably used yum or dnf at least once).
If you’re pulling this from an older server, make sure it’s fully patched (sudo dnf update -y) – I’ve seen Redmine crash after a kernel upgrade that broke systemd‑journald.
Step 1: Install the base stack
sudo dnf install -y epel-release sudo dnf groupinstall -y "Development Tools" "Web Server" "Database Server"
Why it matters: The “Development Tools” pulls in compilers and libraries that Ruby needs to build native gems; the web server package (Apache) will later serve Redmine.
Step 2: Add the Remi repository for a recent Ruby
CentOS 8 ships with Ruby 2.6, but Redmine prefers at least 2.7.
sudo dnf install -y https://rpms.remirepo.net/enterprise/remi-release-8.rpm sudo dnf module reset -y ruby sudo dnf module enable -y ruby:remi-2.7 sudo dnf install -y ruby ruby-devel rubygems
Why it matters: Using the Remi stream keeps Ruby up‑to‑date without messing with the OS packages.
Step 3: Install Node.js for JavaScript assets
Redmine’s asset pipeline needs a recent Node version.
sudo dnf module reset -y nodejs sudo dnf module enable -y nodejs:14 sudo dnf install -y nodejs
Step 4: Set up MariaDB and create the Redmine database
sudo dnf install -y mariadb-server sudo systemctl enable --now mariadb # Secure the installation – I use this because the default root password is blank sudo mysql_secure_installation # Now create a user and database mysql -u root -p <<EOF CREATE DATABASE redmine CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost' IDENTIFIED BY 'StrongPass!23'; FLUSH PRIVILEGES; EXIT; EOF
MariaDB is lighter than MySQL and works fine out of the box; the utf8mb4 collation supports emojis, which Redmine can store in comments.
Step 5: Download and unpack Redmine
cd /opt sudo wget https://www.redmine.org/releases/redmine-4.2.3.tar.gz sudo tar xf redmine-4.2.3.tar.gz sudo mv redmine-4.2.3 redmine
Placing Redmine in /opt keeps it separate from system files and makes upgrades easier.
Step 6: Install Ruby gems for Redmine
cd /opt/redmine sudo gem install bundler sudo bundle install --without development test
Bundler pulls the exact gem versions Redmine expects; skipping dev/test reduces disk usage.
Step 7: Configure database credentials
Copy the example file and edit it:
cp config/database.yml.mysql.example config/database.yml sudo vi config/database.yml
Change username, password, and database to match what you created in MariaDB.
Also set adapter: mysql2.
Step 8: Precompile assets (optional but recommended)
RAILS_ENV=production bundle exec rake redmine:plugins RAILS_ENV=production db:migrate RAILS_ENV=production bundle exec rake assets:precompile
Why it matters: Without this, the first page load can be painfully slow and hit a timeout in production.
Step 9: Configure Apache to serve Redmine
sudo dnf install -y mod_passenger
cat >/etc/httpd/conf.d/redmine.conf <<EOF
<VirtualHost *:80>
ServerName redmine.example.com
DocumentRoot /opt/redmine/public
PassengerRuby /usr/bin/ruby
<Directory /opt/redmine/public>
Require all granted
</Directory>
ErrorLog /var/log/httpd/redmine_error.log
CustomLog /var/log/httpd/redmine_access.log combined
</VirtualHost>
EOF
sudo systemctl enable --now httpd
Passenger lets Apache spin up a Rails process automatically; no need to run rails server manually.
Step 10: Harden the installation (quick win)
# Make sure only the Redmine user owns its files sudo chown -R $USER:$USER /opt/redmine # Drop the default admin password immediately RAILS_ENV=production bundle exec rake redmine:admin_password RAILS_ENV=production
The default admin account is a common target; setting a new password on first boot stops attackers from logging in with known creds.
Step 11: Test everything works
Open http://redmine.example.com in your browser. You should see the login page. Try logging in as “admin” (or whatever you set) and check that dashboards load without error.
If something fails, glance at /var/log/httpd/redmine_error.log – it usually points straight to the culprit.
That’s it: a running Redmine instance on CentOS 8 ready for your teams. From here you can tweak SMTP settings, install plugins, or move to HTTPS with certbot.