Redmine is a powerful and flexible open-source project management tool that provides issue tracking, time tracking, wiki functionality, and version control integration. It is built on Ruby on Rails and supports multiple database backends, including MySQL and PostgreSQL. In this guide, we will walk through the step-by-step process of installing Redmine on Ubuntu 22.04.
Before we begin, ensure that your system meets the following requirements:
First, update the package list and upgrade existing packages to ensure your system is up to date:
sudo apt update && sudo apt upgrade -y
Redmine requires several dependencies, including Ruby, Bundler, and a database server. We will install these packages first.
sudo apt install -y curl gnupg2 git-core libmysqlclient-dev imagemagick libmagickwand-dev libpq-dev build-essential libssl-dev libreadline-dev zlib1g-dev
Ubuntu 22.04 does not include the latest Ruby version by default, so we will install Ruby using rbenv
.
git clone https://github.com/rbenv/rbenv.git ~/.rbenv
cd ~/.rbenv && src/configure && make -C src
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc
Now install Ruby:
rbenv install 3.2.0 # Use the latest stable version
rbenv global 3.2.0
ruby -v # Verify installation
Redmine supports MySQL and PostgreSQL. In this guide, we will use MySQL.
sudo apt install -y mysql-server
Secure the MySQL installation:
sudo mysql_secure_installation
Create a Redmine database and user:
sudo mysql -u root -p
Inside the MySQL shell, run the following commands:
CREATE DATABASE redmine CHARACTER SET utf8mb4;
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'strongpassword';
GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Download and extract the latest stable version of Redmine:
cd /var/www/
wget https://www.redmine.org/releases/redmine-5.0.0.tar.gz
sudo tar -xvf redmine-5.0.0.tar.gz
sudo mv redmine-5.0.0 redmine
cd redmine
Configure the database connection:
cp config/database.yml.example config/database.yml
nano config/database.yml
Modify the MySQL section as follows:
production:
adapter: mysql2
database: redmine
host: localhost
username: redmine
password: "strongpassword"
encoding: utf8mb4
Run the following commands to install Bundler and required gems:
gem install bundler
bundle install --without development test
Run the following commands to initialize the database:
bundle exec rake db:migrate RAILS_ENV=production
bundle exec rake redmine:load_default_data RAILS_ENV=production
Ensure Redmine has the correct permissions:
sudo mkdir -p tmp tmp/pdf public/plugin_assets
sudo chown -R www-data:www-data files log tmp public/plugin_assets
sudo chmod -R 755 files log tmp public/plugin_assets
You can start Redmine using the built-in WEBrick server:
bundle exec rails server -e production
Alternatively, configure Redmine to run with Passenger and Apache or Nginx for production use.
Open your web browser and navigate to:
http://your-server-ip:3000
Log in with the default credentials:
admin
admin
You have successfully installed Redmine on Ubuntu 22.04. For production environments, consider setting up a reverse proxy with Nginx or Apache, enabling SSL, and configuring automatic backups. Redmine is now ready to manage your projects effectively!