Home Linux How to run Jira on a Raspberry Pi 4

How to run Jira on a Raspberry Pi 4

by Sean Ziegler

I 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 will not 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 onetime fee of $10. If you have a Raspberry Pi 4 lying around, it’s possible to roll your own Jira server and save a lot of money.

Can you run Jira on a Raspberry Pi?

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

For some projects (less than 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 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 over 500 issues, we can get away with less.

The Raspberry Pi 4 is 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 stupid. If you do that, don’t say I didn’t warn you.

The Raspberry Pi 4 will struggle with RAM

If anything will bottleneck Jira, it will be RAM. If Jira (or Java) runs out of RAM, it will 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 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

All right, 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 jira

Download the Jira Server tar archive from Jira’s downloads page 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 from MySQL 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 see 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

The installation boils down to entering a license key and creating an administrator account. These are 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 autostart 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

Conclusion

Enjoy experimenting 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.

You may also like

12 comments

Frank November 25, 2019 - 8:42 PM

Hi, thanks for your discribtion : usermod -aG sudo does not work. Do you have any idea how to solve?

Reply
David T February 19, 2020 - 6:06 PM

I got the same error message. However, the following worked for me, sudo usermod -a -G sudo jira

Reply
Bryon Lewis November 29, 2019 - 2:06 AM

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?

Reply
Sean Ziegler December 27, 2019 - 7:59 PM

It runs okay for me. I certainly wouldn’t recommend doing this for a large project or with more than 1 or 2 users.

Reply
Marcin December 27, 2019 - 4:15 PM

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

Reply
Sean Ziegler December 27, 2019 - 7:58 PM

Glad it helped you, I’ll update the post with some of your findings. Thanks

Reply
David T February 19, 2020 - 6:19 PM

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.

Reply
Joan Galtés April 24, 2020 - 1:41 AM

Hi there,

Really great tutorial Sean! However, I can’t finish installing it. Let me explain you my case:

I’ve followed all your steps, with these unique differences:

1. I dowloaded the 8.5.4 version, and put it in a SSD connected to my RPi4 B 4Gb in a USB 3 port, instead of do it in the SD card.
2. I also relabelled the main folder to /media/pi/WDSSD/Jira/Jira/ instead of: /media/pi/WDSSD/Jira/atlassian-jira-software-8.5.4/
3. I was comfortable with the default “pi” user, so I didn’t create a jira’s specific user.

At the moment of launch the installer I get this error:

/media/pi/WDSSD/Jira/Jira/bin/start-jira.sh: line 45: /media/pi/WDSSD/Jira/Jira/bin/catalina.sh: Permission denied
/media/pi/WDSSD/Jira/Jira/bin/start-jira.sh: line 45: exec: /media/pi/WDSSD/Jira/Jira/bin/catalina.sh: Cannot be executed: Permission denied

I checked all the file permissions of the bin/ folder and I saw a *.bat version of all the files with execute permissions enabled; and a *.sh version of all the files with executable permissions disabled.

So… I did a (sudo) chmod 775 * for all .sh files, but the permissions didn’t change for them! o.0′.
Have you any idea to fix it?

Thank you in advance!

Reply
Sean Ziegler April 24, 2020 - 5:07 PM

Unfortunately, no not really. I would expect that chmod +x catalina.sh fixes that issue. Double check the permissions on all the scripts.

Reply
donbucheJoan Galtés April 24, 2020 - 8:06 PM

I think my user (even if it’s the root), can’t perform achmod on the SSD device, so I’m moving all the Jira related folders back to the RPi4’s SDCard, as you did in your tutorial 😉

Thank U!

Reply
Michael May 31, 2020 - 5:57 PM

Thanks for the write up. Just got JIRA running finally on a RaspPi4 with 4GB of memory (had I known it was coming, I’d have waited and bought the 8GB version!).

Couple notes from my trials using your notes as a guide (as well as https://github.com/jdavidpeter/Jira-on-Raspberry-Pi) as of 5/31/2020 for folks looking to do this.

1. As others have noted, I did not need to mess with the swap file. Seems to be working fine with the OS defaults.
2. As others have also noted, the usermod command doesn’t work (either in raspbian or in ubuntu server). Simple work around is at this point log out of the admin account and in as the jira user and do everything else from there.
3. I ended up going with Ubuntu Server 64 bit as the recent versions of JIRA appear to now only be 64-bit and Raspbian 64 is still in beta. This was because no matter what I did on Raspbian, JIRA was not starting due to not finding java. No idea why, but their support documentation is all geared to Ubuntu LTS. That doesn’t change much here.
4. Your notes still have different names in places for the database. 🙂 The commands say ‘jirapidb’ but the picture says ‘jiradb’ for instance. For folks following along, yes the DB name needs to be the same everywhere, as does the DB user name and password.
5. As of JIRA 8.9 anyhow, the version I installed, the MySQL connector jar files appear to need to be in the $JIRA_HOME/lib directory itself vs $JIRA_HOME/lib/MySQL-driver-blah. So if you extract the files from the tar.gz file inside the lib directory, you need to copy the 2 jar files up a level to /lib.
6. When I fired it up and finally got it working, the initial DB creation failed for whatever reason. I had to go into the DB admin again, drop the database, recreate it and then try again. JIRA picked up and finished the second time through without an issue. So try again if you get this far!
7. For anybody trying, the .bin self installing version, even though tested on Ubuntu according to Atlassian, failed in all accounts on multiple platforms. I suspect it’s because we are on ARM and the installer is ‘hardcoded’ for IA32/IA64.
8. Be patient on start up. It’s slow to start. Seems okay once it’s running however.

But it’s up and running now it seems and I’ve been able to create a couple projects, noodle around some, etc!

Thanks for sharing the inspiration to get this going.

Reply
Johan April 21, 2022 - 4:33 AM

Do you do the same with Raspberry Pie 3B+?

Reply

Leave a comment

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept