How to run Jira on a Raspberry Pi 4

I decided to use Jira for tracking issues and tasks on my side projects. There are two versions: Jira Server and Jira Cloud. Jira Cloud, the hosted version offered by Atlassian, is $10/month. Although $10/month isn’t going to break the bank, it’s still more than I want to pay for software that’s only intended for hobby projects. Fortunately, you can get Jira Server, the self-hosted version, for a one-time fee of $10. If you have a Raspberry Pi 4 laying around, its possible to roll your own Jira server and save a lot of money.

Can you run Jira on a Raspberry Pi?

You might be surprised, but yes, you can. Here’s what Atlassian’s page says about the Jira Server requirements:

“For a small number of projects (less or equal to 100) with 1,000 to 5,000 issues in total and about 100-200 users, a recent server (multicore CPU) with 8GB of available RAM and a reasonably fast hard drive (7200 rpm or faster) should cater for your needs.”

Well, the Raspberry Pi 4 doesn’t quite meet those specs (the flagship model rocks a quad-core 64-bit ARM processor and 4GB) but since I’ll only have 1 – 5 users and not more than 500 or so issues, we can get away with a bit less.

The Raspberry Pi 4 is pretty solid. I’m using the 4GB version for this Jira Server.

Just remember that using a setup like this in a production environment would be absolutely stupid. If you do that, don’t say I didn’t warn you.

The Raspberry Pi 4 will struggle with RAM

If anything is going to bottleneck Jira, it will be RAM. If Jira (or Java) runs out of RAM, it’s going to result in your Jira application crashing. We can help mitigate this by increasing the size of the swap file. It’s not as good as having more RAM, but it’s better than nothing.

You can increase your swap size by editing /etc/dphys-swapfile.

$ vim /etc/dphys-sqapfile

Change CONF_SWAPSIZE=256 to CONF_SWAPSIZE=2048.

Reboot your server with sudo reboot. Once your Pi is back up, ensure your swap size is actually 2GB with free -m. Look for the line labeled swap.

P.S. I should probably mention using an SD card for swap could be a bad idea. SD cards have limited lifespans and constant swap-file IO could drastically reduce its lifetime. Backup your Jira instance if you can’t afford to lose it.

Installing MariaDB

Jira needs a database to store all its crap. I’ll be using MariaDB but you can use anything supported by Atlassian.

Install MariaDB with

$ sudo apt install mariadb-server-10.0

Open a MariaDB monitor and create a user with

$ sudo mysql -u root

Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 243
Server version: 10.0.28-MariaDB-2+b1 Raspbian testing-staging

Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

and then (with a stronger password):

CREATE USER 'jira'@'localhost' IDENTIFIED BY 'jirapassword';

CREATE DATABASE jirapidb CHARACTER SET utf8 COLLATE utf8_bin;

the jira user will need some privileges:

GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER,REFERENCES,INDEX on jirapidb .* TO 'jirapi'@'localhost' IDENTIFIED BY 'YourDbPasswordGoesHere';

flush privileges;

Installing Jira

Alright, we are almost ready to install Jira but first, we need a user for it. You could run it as root or pi but that’s not best practice, especially when it’s so easy to create users.

$ sudo adduser jira
$ usermod -aG sudo

Download the Jira Server tar archive from here and get it onto your server at /home/jira. Next, let’s unpack the archive:

$ tar --extract -f /home/jira/atlassian-jira-software-8.5.0.tar.gz

There are a few changes we need to make to configure Jira for the Raspberry Pi.

Edit /home/jira/atlassian-jira-software-8.5.0/WEB-INF/classes/jira-application.properties and add the line:

jira.home = "/home/jira/jira_home"

Next, edit home/jira/atlassian-jira-software-8.5.0/bin/setenv.sh and add the line:

JIRA_HOME="/home/jira/jira_home"

Installing MySQL DB connector

Even though we are using MariaDB, the MySQL DB connector works just fine. You can get it here. Copy the file to /home/jira/atlassian-jira-software-8.5.0/lib/ and extract the file with:

$ tar --extract -f mysql-connector-java-5.1.48.tar.gz

Start Jira

Finally, we are ready to start Jira.

$ . /home/jira/atlassian-jira-software-8.5.0/bin/start-jira.sh

Next, you can browse to <your_server_IP>:8080 and you’ll be greeted with a Jira setup screen.

Jira’s initial setup screen

On the next screen, configure the database properties with whatever you set in the previous steps (choose MySQL if you used MariaDB),

Replace all this stuff with your own credentials

At this point, the installation boils down to entering a license key and creating an administrator account. These are pretty trivial so I’ll leave them up to you. When you’re done, you’ll see a Jira welcome screen!

If you made it this far, you’re done!

Once you hit the welcome screen, you are free to create a project and start using Jira.

Setting Jira up to start automatically

Now that Jira is installed, we want to make sure it starts automatically at boot. We can achieve this by adding it to the /etc/rc.local file. This file is executed every time the Raspberry Pi boots and will automatically start Jira.

Run the command vim /etc/rc.local and add the line:

source /home/jira/atlassian-jira-software-8.5.0/bin/start-jira.sh

Enjoy playing around with your new Jira install. I’ll be doing a future post about setting up dynamic DNS so you can access your Jira install from the internet at URL such as jira.yourdomain.com.

Leave a Reply