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-swapfile

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.

Comments 7

  1. Thanks for detailed instructions. So I’m currently running JIRA server on an Amazon Web services EC2 t2.micro (it’s a 1 CPU, 1GB RAM). t2.micro is the free tier so it’s free to run for the first year with a new Amazon Web Services account. I use it just to track my continuing education (learning new coding languages or technologies). I’m the only user (+restricted guest account) and for the most part it runs ‘okay’. Create a new project, new user, or doing some of the built in reports will drastically slow it down.

    To get it to run I did a similar thing with actually creating a swap partition on the EC2 instance (the EC2 Amazon Linux AMI doesn’t have one configured by default). I might move to a locally hosted Pi and maybe a secondary one for confluence. Bumping to 4GB I feel should help me quite a bit, have you noticed any slowdowns with your install?

    1. Post
      Author
  2. Hi Sean,

    thank you for the tutorial, worked for me on Raspberry Pi 4b with 4GB RAM with two corrections:
    – on the beginning we are creating a database jirapidb; down the line you are entering jiradb as database name during Jira database setup
    – by default the JVM_MAXIMUM_MEMORY in JIRA_INSTALL_DIR/bin/setenv.sh is set to 2048m, this was to much in my case and Jira crashed due to outOfMemoryException. In my case reducing JVM_MAXIMUM_MEMORY to 1024m solved the problem (no additional swap was necessary, according the documentation even 786m should suffice)

    Kind regards,
    Marcin

    1. Post
      Author
    2. I got the same memory error and following Marcin’s advice allowed me to successfully install jira. The command to start Jira did not work till I removed the dot in the command. e.g.

      bash /home/jira/atlassian-jira-software-8.7.1-standalone/bin/start-jira.sh -fg

      the -fg option puts execution in the foreground so you can see what’s happening. I don’t remember seeing the database setup that you show. Maybe the difference is because I loaded a later version? Thanks for your tutorial, it was easy to follow and got me up and running.

Leave a Reply