Projects managing involves strong communication requirements. Keeping all teams aligned on tasks progress and issues solution require strong tools able to share info between involved owners and a strict timeline sharing.
In this guide I’ll show you how to install Redmine in your Raspberry PI (a very cheap single board computer) with Docker.
For this guide I will use a Raspberry PI 3 model A+, but this works also with newer Raspberry PI boards.
What is Redmine
Redmine is an open source project management platform, based on web application service. Written using the Ruby on Rails framework, it is cross-platform and cross-database. It allows to manage multiple projects and associated subprojects, with related objects like tasks, issues, files management and gantt chart.
What We Need
As usual, I suggest adding from now to your favourite e-commerce shopping cart all needed hardware, so that at the end you will be able to evaluate overall costs and decide if continue with the project or remove them from the shopping cart. So, hardware will be only:
- Raspberry PI 3 model A+ (including proper power supply or using a smartphone micro usb charger with at least 3A) or newer Raspberry PI board
- micro SD card (at least 16 GB, at least class 10)
Check hardware prices with following links:
We’ll start from installing Raspberry PI operating system, then setting up docker and docker-compose. After that, we’ll prepare docker-compose configuration files to create our Redmine platform with only 1 command line.
Redmine requires a database and works well with MySQL. I use MariaDB instead of MySQL because it is fully compatible and requires less resources (which is a good idea working with low capacity hardware like Raspberry PI). MariaDB for ARM has only a docker hub image compatible with ARM 64. I’ll use instead a custom MariaDB docker installation, so to be compatible with all Raspberry PI boards able to run docker.
Prepare Raspberry PI Environment
Start installing Raspberry Pi OS Lite, to have an headless and lite environment. If you start from an existing Raspberry PI os installation, please remember to update from terminal:
sudo apt update sudo apt upgrade
Then install Docker and docker-compose in your Raspberry PI. Portainer can be installed to visually control your docker environment, but it is not strictly required.
Prepare Docker-Compose Configuration Files
Create a redmine folder in your Raspberry PI. I’m going to name it “redmine”, but you can use whatever name you want. The enter your folder. From terminal:
mkdir redmine cd redmine
We’ll create 3 main files:
docker-compose.yml Dockerfile mySqlScript.sql
docker-compose.yml is your main docker-compose configuration file. It includes service configuration we’ll create. Dockerfile will drive mariaDB image building. mySqlScript.sql will be used to initialize MariaDB creating Redmine database, user and permission.
Next paragraphs will show file content.
Docker-compose yaml file
Create a docker compose file:
and add following code. Use your favourite credentials for “redmine” and “redmine_password” and remember them for mySqlScript.sql
# My Redmine # from peppe8o.com version: '3' services: redmine: image: redmine:latest restart: unless-stopped ports: - 8080:3000 environment: REDMINE_DB_MYSQL: db REDMINE_DB_USERNAME: redmine REDMINE_DB_PASSWORD: redmine_password REDMINE_SECRET_KEY_BASE: supersecretkey db: build: . restart: unless-stopped
Of course, you can customize this script by changing exposing port, mapping volumes for persistent data, and so on.
As you can see, our database will be built on custom installation (please refer to create custom MariaDB container on Raspberry PI for more info).
Create a Dockerfile:
And use following content inside it:
FROM debian RUN apt update && apt install mariadb-server -y RUN sed -i 's/bind-address/bind-address = 0.0.0.0 #/i' /etc/mysql/mariadb.conf.d/50-server.cnf RUN mkdir /mysql_scripts COPY mySqlScript.sql /mysql_scripts/ RUN /etc/init.d/mysql start && mysql -uroot --password="" -e "source /mysql_scripts/mySqlScript.sql" CMD /etc/init.d/mysql start && tail -f /dev/null
For security purposes please remember, once all procedure will be completed, to enforce your MariaDB root password.
MySQL Initialization Script
Finally, create your database initialization script:
Use following code, changing “redmine” and “redmine_password” with your preferred credentials:
CREATE DATABASE redmine CHARACTER SET utf8mb4; CREATE USER 'redmine'@'%' IDENTIFIED BY 'redmine_password'; GRANT ALL PRIVILEGES ON redmine.* TO 'redmine'@'%'; FLUSH PRIVILEGES; quit
Service Creation and Initialization
With previous files ready to be used, you will be able to install and have Redmine up only with following command:
docker-compose up -d
This process will require a while to:
- download and extract required images from Docker Hub (Redmine and Debian, latest being used for our custom MariaDB container)
- install and configure MariaDB
- run mySqlScript.sql initialization script
Once container preparation have been completed, from terminal you will see something like following:
... Creating redmine_redmine_1 … done Creating redmine_db_1 … done pi@raspberrypi:~/redmine $
At this point, Docker has done its job, but a few operations are still going on inside Redmine container. Docker ps command will confirm that containers are up and running (containers will inherit firt part of their name from folder name):
pi@raspberrypi:~/redmine $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES 265be67bf2d8 redmine:latest "/docker-entrypoint.…" 2 minutes ago Up 2 minutes 0.0.0.0:8080->3000/tcp redmine_redmine_1 26a443a3a1d2 redmine_db "/bin/sh -c '/etc/in…" 2 minutes ago Up 2 minutes redmine_db_1
We can check that redmine_redmine_1 container is still working to setup. With command:
docker logs redmine_redmine_1
you will see internal redmine operations progressing and our service will be ready once this command will show you following final line:
INFO WEBrick::HTTPServer#start: pid=1 port=3000
At this point, from your favorite browser (I will use Brave Browser), check url “http://<<yourRaspberryIpAddress>>:8080” (in my screenshot, my Raspberry PI IP address is 192.168.1.177):
If this is your output, it means that everything went well.
Use “Sign in” link on top/right:
Use following default Redmine credentials:
- login: admin
- Password: admin
and click login. You will be asked to change immediately admin password. Insert old “admin” in “Password” field. Use a new password for oher 2 fields:
Then click “Apply” button. You will be logged in:
From here you can refer to Redmine Users Guide and your Redmine platform is ready.
We are sorry that this post was not useful for you!
Let us improve this post!
Tell us how we can improve this post?