
Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Install Redmine on Ubuntu
Redmine is one of the best free and open-source project management tools, written using Ruby on Rails. Its customizable nature makes it an excellent choice for managing and tracking bugs in projects.
The term "project management" refers to a broad process with different stages and phases, ranging from planning and organizing to executing. Having a system to track all this can bring significant improvements.
Redmine has many features that make it popular and distinct from other project management tools.
In addition to being free and open-source, Redmine offers functionalities such as ?
- Issue Tracking ? Redmine provides custom workflows and categorization of issues.
- User Management ? Redmine supports user management and permissions.
- Integration ? Redmine can integrate with other tools like Git and offers a custom REST API.
Moreover, Redmine supports most popular database engines, including PostgreSQL, MariaDB, MySQL, and SQLite. Generally, Redmine is used by software development teams and Agile teams.
In this tutorial, we will learn how to set up Redmine on Ubuntu step by step.
Prepare for the Installation
Before we proceed with the Redmine installation, we have some prerequisites that we should install first on the system. First, make sure you have root access to your system in order to install software.
Next, update the system using the regular command ?
sudo apt update
And upgrade using the command ?
sudo apt upgrade
This will make sure that our Ubuntu system is updated.
After that, we need to install some dependencies that Redmine relies on in order to work. To install them, use the following command ?
sudo apt install curl gnupg2 build-essential zlib1g-dev libssl-dev libreadline-dev libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt1-dev libcurl4-openssl-dev software-properties-common libffi-dev nodejs git
This will install some dependencies and tools that Redmine needs to function properly.
Install Database
Redmine needs a database to store data related to the project in an organized way, and to do this, it needs a database. You can choose from the database engines that are supported. In this case, let's choose MariaDB as the database engine.
To install MariaDB on Ubuntu, use the command ?
sudo apt install mariadb-server
This command will install the MariaDB server available in the official repository. After the installation is done, you can check the version:
mariadb --version
You should get something like this ?
To make sure the database is working fine, you can try this command ?
sudo mysql -u root
This will bring you to an interface like this ?
This means the database is working correctly. The next step is to add a Redmine user to the database.
First, create a database using the following query (we call an SQL command a query) inside the database ?
CREATE DATABASE redmine CHARACTER SET utf8mb4;
This SQL request will create a database called redmine. Make sure the database is created successfully.
The next step is to create the user using the following query ?
CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'admin2025'; GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost';
This request will create a user redmine and give it all privileges (permissions). Make sure to change admin2025 to the password that you want. In this case, I use admin2025.
And as always, make sure the request is executed and the user is created by looking at the message ?
After that, we need to reload the privileges tables in the database because we updated it (we created a new user). To do that, use the query ?
FLUSH PRIVILEGES;
To exit from the MySQL prompt, we use the command:
EXIT;
This will bring you back to the terminal session.
I detailed the queries to make them simple to understand, but you can run them in one step like this ?
CREATE DATABASE redmine CHARACTER SET utf8mb4; CREATE USER 'redmine'@'localhost' IDENTIFIED BY 'admin2025'; GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'localhost'; FLUSH PRIVILEGES; EXIT;
At this stage, we are done. We set up a database and added a user.
Test Database
To ensure that all the steps to set up the database are done correctly, you can try logging into the Redmine database that we created earlier using the password we set up for it.
To do that, first quit the database using the command quit, and then try to access the Redmine database like this ?
sudo mysql -u redmine -p
First, it will ask for the root password because we use sudo, and then it will ask for the user password. Enter the password you created (for me, it was 'admin2025').
An optional step is to list databases using the query show databases;. You should get something like this ?
As you can see, we have our Redmine database, which means we have successfully set up the database.
Install Apache Server
Redmine is a web-based application, so to access the interface, we need a web server. The efficient way is to use the Apache server. If you don't already have Apache installed on your machine, you can install it using the command ?
sudo apt-get install apache2 libapache2-mod-passenger
After the installation is complete, we can check if it's up and running by navigating to the URL 127.0.0.1 (Ubuntu runs it by default after installation). You should see a screen like this ?
The Apache server is installed and running.
Install Redmine from the Command Line
The last package we need to install is Redmine itself, along with MySQL, as we use MariaDB as a database (MariaDB is a fork of MySQL). Use the following command ?
sudo apt-get install redmine redmine-mysql
This will set up Redmine and configure the database. During this process, it will ask for the password of the user we set up.
Note: This method works only if you are using Ubuntu. If you are using a Ubuntu-based distribution like Mint, this may not work. Use the method below instead.
Download Redmine from Source
Another way to install Redmine is by downloading the package from the official website. You can either use curl to download it or manually download it from this link. The latest version is 6. To download the package from the terminal using wget, run ?
wget https://www.redmine.org/releases/redmine-6.0.1.tar.gz
Extract the archive using the command:
sudo mv redmine-6.0.1 /opt/redmine cd /opt/redmine
Move the extracted files to /opt/redmine ?
sudo mv redmine-6.0.1 /opt/redmine cd /opt/redmine
Next, install bundler with the command ?
sudo gem install bundler
After that, run the following command ?
bundle install
This will install the required gems, such as Rails, which is the framework used to build Redmine. This process may take some time.
Configure the database by first copying the example YAML file ?
cp config/database.yml.example config/database.yml
Using an editor, edit the database YAML file to match your configuration ?
vim config/database.yml
For me, the configuration is like this ?
- The database name is redmine
- The username is redmine
- The password is admin2025
Replace these values with your credentials.
After the changes, run the migration using the command ?
RAILS_ENV=production bundle exec rake db:migrate
The next step is to change the permissions for the following files ?
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
Apache Configuration
Another step is to configure the Apache server to use Redmine.
Edit the redmine.conf file ?
sudo vim /etc/apache2/sites-available/redmine.conf
Add the following content ?
<VirtualHost *:80> ServerName 127.0.0.1 DocumentRoot /opt/redmine/public <Directory /opt/redmine/public> Require all granted Options -MultiViews </Directory> </VirtualHost>
Next, enable the Apache and Passenger modules using the commands ?
sudo a2ensite redmine sudo systemctl restart apache2 sudo a2enmod passenger sudo systemctl restart apache2
Initialize and Start Redmine
To start Redmine, first generate a token using RAILS_ENV ?
RAILS_ENV=production bundle exec rake generate_secret_token
Finally, you can start Redmine using this command ?
RAILS_ENV=production bundle exec rails server
Navigate to 127.0.0.1, and you should see the Redmine page where you can start working.
Conclusion
Redmine is an interesting tool for project management. Setting up Redmine on Ubuntu can be a challenging operation, but by following this guide, which shows the steps one by one, you will get Redmine up and running on Ubuntu.