Run any Jira Data Center version with a real database directly on your own desktop
Andrei Pisklenov
Head of Development | Passionate Full-Stack Enthusiast (Typescript & Java) | Certified Atlassian Expert
Hey Jira admins, developers and enthusiasts, would you like to know how to run any Jira version right on your local environment with a normal database like Postgres? This guide will show you how you can do it easily, without much effort or special Linux/DevOps knowledge.
Why run Jira locally?
TL;DR: for Development and Testing purposes.
Okay, so picture this: you're knee-deep in code, tweaking configurations, and fine-tuning workflows in Jira. Wouldn't it be awesome if you could do all of this without worrying about breaking something in the live system? That's where running Jira locally for development and testing comes into play, and let me tell you why it's a game-change:
So there you have it, folks! Running Jira locally for development and testing is a no-brainer. It's fast, it's flexible, and it's downright awesome.
And how are we going to do it? Docker is the answer. With Docker, we'll use public, officially supported Jira and database images, from its vendors to teardown of our local environment. It's a practical solution that streamlines the process, making it efficient and hassle-free. Let's get started with Docker and make setting up Jira locally a breeze.
Starting with Docker
Alright, before we dive into the nitty-gritty of setting up Jira locally with Docker, let's make sure we've got all our ducks in a row. Here's what you'll need:
Requirements for Running Jira Locally with Docker:
Installation of Docker and Docker Compose:
Basic Understanding of Docker Concepts:
So there you have it! With these prerequisites out of the way, you'll be ready to roll up your sleeves and get your hands dirty with setting up Jira locally using Docker. Let's do this!
The Problem
Let's start with the problem: we want to set up the latest stable version of Jira Software with a compatible PostgreSQL database. To find the latest version, check Atlassian's release notes page https://confluence.atlassian.com/jirasoftware/jira-software-release-notes-776821069.html or "Long Term Support releases" for the latest LTS version here. As of June 2024, the latest Jira Software version is 9.16.0. We'll use this version for our example, but make sure to double-check this because Atlassian releases new versions frequently.
Next, we need to find the compatible version of PostgreSQL for this Jira version. Refer to the "Supported platforms" page here. According to the documentation, "PostgreSQL 12" is the recommended version.
Now, let's put it all together.
The Solution is… docker-compose.yml
Now that we know which versions of Jira and PostgreSQL we need, it's time to set up our Docker environment. We'll use Docker Compose to manage both the Jira application and the PostgreSQL database. Here's how to create the docker-compose.yml file.
Create a New Directory: Start by creating a new directory for your project. This is where all your Docker-related files will live.
Create the docker-compose.yml file: In this directory, create a new file named "docker-compose.yml". You can do this using any text editor you prefer.
Define Services in docker-compose.yml: Open the "docker-compose.yml" file in your text editor and define the services for Jira and PostgreSQL. Here’s a basic setup:
services:
jira:
container_name: jira
image: atlassian/jira-software:9.16.0 # LTS: https://www.atlassian.com/software/jira/download-archives
depends_on:
- jiradb
networks:
- jiranet
volumes:
- ./jira:/var/atlassian/application-data/jira
ports:
- '8080:8080'
environment:
- ATL_JDBC_URL=jdbc:postgresql://jiradb:5432/db
- ATL_JDBC_USER=jiradbuser
- ATL_JDBC_PASSWORD=DoNotTimeTravelTo2020!
- ATL_DB_DRIVER=org.postgresql.Driver
- ATL_DB_TYPE=postgres72
- JVM_MINIMUM_MEMORY=2048m
- JVM_MAXIMUM_MEMORY=8192m
- ATL_PROXY_NAME=localhost
- ATL_PROXY_PORT=8080
- ATL_TOMCAT_SCHEME=http
restart: unless-stopped
jiradb:
container_name: postgresql
image: postgres:12
ports:
- 5432:5432
networks:
- jiranet
volumes:
- ./postgresql:/var/lib/postgresql/data
environment:
- POSTGRES_USER=jiradbuser
- POSTGRES_PASSWORD=DoNotTimeTravelTo2020! # The same as in ATL_JDBC_PASSWORD
- POSTGRES_DB=db
- POSTGRES_ENCODING=UNICODE
- POSTGRES_COLLATE=C
- POSTGRES_COLLATE_TYPE=C
restart: unless-stopped
networks:
jiranet:
driver: bridge
Explanation of the docker-compose.yml File
Services "jira":
领英推荐
Services "postgres":
Networks: Defines a network for the containers to communicate.
Save and Close the File: After adding the configuration, save the "docker-compose.yml" file and close your text editor.
Running docker-compose.yml
Now that we've created our docker-compose.yml file, it's time to bring our Jira and PostgreSQL services to life. Follow these steps to run the Docker Compose setup and get your local Jira instance up and running.
Start the Services: In your terminal, navigate to the directory where your docker-compose.yml file is located. Use the following command to start the services defined in the file:
docker compose up -d
The "up" command tells Docker Compose to start the services.
The "-d" flag runs the containers in the background (detached mode), allowing you to use your terminal for other tasks.
Access Jira: With the containers running, open your web browser and navigate to https://localhost:8080. This is where you'll find your Jira instance.
The first time you access Jira, you'll need to go through the initial setup process. Follow the on-screen instructions to configure your Jira instance. Stay patient, depending on your laptop's CPU and RAM, the process might take some time. Wait for the loading process to complete and for the system to redirect you to the next step of the configuration.
Stopping and Restarting Services
Stopping the Services: If you need to stop the Jira and PostgreSQL containers, you can do so with the following command:
docker compose down
This command stops and removes the containers but preserves the data in the named volumes.
Restarting the Services: To restart the services after stopping them, simply use the "docker compose up -d" command again. Your data will be preserved, and Jira will start up with the previous configuration.
Conclusion
Running Jira locally using Docker and Docker Compose offers a powerful and flexible solution for developers, admins, and enthusiasts. By encapsulating Jira and its dependencies into containers, you gain the ability to easily set up, manage, and experiment with your Jira environment without impacting production systems.
Among multiple other examples, this approach has several distinct benefits:
I'd love to hear from you! Share your thoughts about running Jira with PostgreSQL using Docker Compose. Do you have any ideas to optimize this configuration? Your feedback and suggestions can help others in the community improve their setups as well.
Founder | Advancing Enterprise Platforms with Advanced Data and API Solutions
3 个月Just use the SDK
Product Owner of Report Builder (Actonic GmbH)
3 个月Nice article, Andrei Pisklenov! Does running Confluence locally require same steps?