How To Install Jira on Debian 12
Jira has become the go-to solution for teams that need robust project management capabilities. Whether you’re managing software development, tracking bugs, or implementing agile methodologies, Jira offers a powerful platform that scales with your needs. Installing Jira on Debian 12 provides a stable, secure foundation for your project management infrastructure. This guide walks through every step of the installation process, from preparing your Debian environment to configuring Jira for optimal performance.
Introduction
Jira is Atlassian’s flagship project management tool designed to help teams plan, track, and manage work efficiently. Originally developed as a bug and issue tracker, Jira has evolved into a comprehensive solution that supports various project management methodologies, including agile frameworks like Scrum and Kanban. Its flexibility and extensive feature set make it ideal for teams of all sizes across different industries.
Debian 12, the latest stable release of this renowned Linux distribution, offers an excellent platform for hosting Jira due to its stability, security, and robust package management system. Running Jira on Debian provides better resource management, improved security, and greater control over your deployment compared to cloud-based alternatives.
By the end of this guide, you’ll have a fully functioning Jira instance running on your Debian 12 server, ready to streamline your project management processes. Whether you’re a system administrator, DevOps engineer, or IT professional, this step-by-step approach ensures a smooth installation experience.
Prerequisites and System Requirements
Before diving into the installation process, ensure your system meets the necessary requirements to run Jira effectively.
Hardware Requirements
Jira’s performance is heavily dependent on adequate system resources. For a production environment, consider these specifications:
- RAM: Minimum 4GB, but 8GB or more is strongly recommended for optimal performance
- CPU: At least dual-core processor; quad-core or better recommended for larger teams
- Storage: Minimum 10GB free space for installation, plus additional space for attachments and database growth
- Network: Stable internet connection for updates and integrations
Software Prerequisites
Your Debian 12 environment must include:
- A fresh installation of Debian 12 (Bookworm)
- Root access or sudo privileges
- Updated package repositories
- Basic understanding of Linux command line operations
Domain Configuration
While optional, having a properly configured domain name improves accessibility and is essential for secure HTTPS connections. Consider setting up DNS records beforehand if you plan to make your Jira instance publicly accessible.
Firewall Considerations
Ensure relevant ports are open in your firewall:
- Port 8080 (default Jira port)
- Port 80 and 443 (if using a reverse proxy with HTTP/HTTPS)
- Database port (typically 3306 for MySQL/MariaDB or 5432 for PostgreSQL)
Preparing the System Environment
A properly prepared system ensures smooth installation and optimal performance. Let’s start by updating your Debian 12 system.
Update System Packages
First, refresh your package repositories and upgrade existing packages:
sudo apt update
sudo apt upgrade -y
Set Correct Timezone
Configuring the correct timezone ensures accurate timestamping in Jira:
sudo dpkg-reconfigure tzdata
Follow the on-screen prompts to select your region and city.
Install Essential Utilities
Several utility packages will be useful during installation and maintenance:
sudo apt install wget curl unzip fontconfig htop net-tools -y
Create Dedicated Directories
Organizing your Jira installation with dedicated directories improves manageability:
sudo mkdir -p /opt/atlassian/jira
sudo mkdir -p /var/atlassian/application-data/jira
Configure System Limits
Jira can be resource-intensive. Adjust system limits by editing /etc/security/limits.conf
:
sudo nano /etc/security/limits.conf
Add these lines to increase open file limits:
jira soft nofile 16384
jira hard nofile 65536
Save and exit the editor.
Java Installation and Configuration
Jira requires Java to run. The recommended version for recent Jira releases is OpenJDK 11.
Install OpenJDK 11
Install OpenJDK 11 using apt:
sudo apt install openjdk-11-jdk -y
Verify Java Installation
Confirm Java is properly installed:
java -version
You should see output similar to:
openjdk 11.0.19 2023-04-18
OpenJDK Runtime Environment (build 11.0.19+7-post-Debian-1)
OpenJDK 64-Bit Server VM (build 11.0.19+7-post-Debian-1, mixed mode, sharing)
Set JAVA_HOME Environment Variable
Configure the JAVA_HOME environment variable by adding it to /etc/environment
:
sudo nano /etc/environment
Add the following line:
JAVA_HOME="/usr/lib/jvm/java-11-openjdk-amd64"
Save and exit. Apply the changes:
source /etc/environment
Verify the setting:
echo $JAVA_HOME
This should display the Java installation path.
Database Setup and Configuration
While Jira includes an H2 database for evaluation purposes, a production environment requires a robust external database. This guide uses MySQL/MariaDB, though PostgreSQL is also well-supported.
Install MySQL/MariaDB
Install MariaDB, the open-source MySQL fork included with Debian:
sudo apt install mariadb-server -y
Secure MySQL Installation
Run the security script to improve database security:
sudo mysql_secure_installation
Follow the prompts to:
- Set a strong root password
- Remove anonymous users
- Disallow root login remotely
- Remove test database
- Reload privilege tables
Create Jira Database and User
Log in to MySQL as root:
sudo mysql -u root -p
Create a dedicated database and user for Jira:
CREATE DATABASE jiradb CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;
CREATE USER 'jirauser'@'localhost' IDENTIFIED BY 'strong_password';
GRANT ALL PRIVILEGES ON jiradb.* TO 'jirauser'@'localhost';
FLUSH PRIVILEGES;
EXIT;
Replace ‘strong_password’ with a secure password.
Optimize MySQL Configuration
Edit the MySQL configuration file:
sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf
Add these performance optimizations under the [mysqld]
section:
innodb_log_file_size = 256M
innodb_buffer_pool_size = 1G
max_allowed_packet = 256M
transaction-isolation = READ-COMMITTED
binlog_format = ROW
Restart MySQL to apply changes:
sudo systemctl restart mariadb
Install MySQL Java Connector
Download and install the MySQL Java connector:
wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.33.tar.gz
tar -xzf mysql-connector-java-8.0.33.tar.gz
sudo cp mysql-connector-java-8.0.33/mysql-connector-java-8.0.33.jar /opt/atlassian/jira/lib/
Downloading and Installing Jira
Now it’s time to download and install Jira itself. There are two installation methods: the binary installer or manual installation from an archive file.
Download Jira
First, create a dedicated user for running Jira:
sudo useradd -m -d /home/jira -s /bin/bash jira
Download the latest Jira Software binary installer:
cd /tmp
wget https://www.atlassian.com/software/jira/downloads/binary/atlassian-jira-software-9.6.0-x64.bin
Make the installer executable:
chmod a+x atlassian-jira-software-9.6.0-x64.bin
Run the Installer
Start the installation process:
sudo ./atlassian-jira-software-9.6.0-x64.bin
When prompted, choose “Custom Install” for more control over the installation. The installer will ask several questions:
- Installation directory (recommended:
/opt/atlassian/jira
) - Data directory (recommended:
/var/atlassian/application-data/jira
) - TCP ports (default: 8080)
- Whether to install as a service (recommended: Yes)
Configure Installation Permissions
Ensure the Jira user has appropriate permissions:
sudo chown -R jira:jira /opt/atlassian/jira
sudo chown -R jira:jira /var/atlassian/application-data/jira
First Startup
Start Jira for the first time:
sudo systemctl start jira
Verify Jira is running:
sudo systemctl status jira
Setting Up Jira as a Systemd Service
Running Jira as a system service ensures it starts automatically with your server and can be managed using standard systemd commands.
Create Systemd Service File
If the installer didn’t create a service file, create one manually:
sudo nano /etc/systemd/system/jira.service
Add the following content:
[Unit]
Description=Atlassian Jira
After=network.target
[Service]
Type=forking
User=jira
ExecStart=/opt/atlassian/jira/bin/start-jira.sh
ExecStop=/opt/atlassian/jira/bin/stop-jira.sh
PIDFile=/opt/atlassian/jira/work/catalina.pid
TimeoutSec=200
LimitNOFILE=16384
[Install]
WantedBy=multi-user.target
Enable and Start the Service
Reload systemd, enable and start the Jira service:
sudo systemctl daemon-reload
sudo systemctl enable jira
sudo systemctl restart jira
Verify Service Status
Check if Jira is running properly:
sudo systemctl status jira
You should see “active (running)” in the output.
Nginx Configuration for Reverse Proxy
Using Nginx as a reverse proxy provides benefits like SSL termination, load balancing, and improved security.
Install Nginx
Install Nginx web server:
sudo apt install nginx -y
Create Nginx Configuration for Jira
Create a new Nginx configuration file:
sudo nano /etc/nginx/sites-available/jira
Add the following configuration:
server {
listen 80;
server_name jira.yourdomain.com;
client_max_body_size 100M;
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:8080;
proxy_connect_timeout 300s;
proxy_read_timeout 300s;
proxy_redirect off;
}
}
Replace jira.yourdomain.com
with your actual domain name.
Enable the Configuration
Enable the Nginx configuration:
sudo ln -s /etc/nginx/sites-available/jira /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl restart nginx
SSL/TLS Configuration with Let’s Encrypt
Securing your Jira instance with HTTPS is essential for protecting sensitive data.
Install Certbot
Install Certbot for obtaining Let’s Encrypt certificates:
sudo apt install certbot python3-certbot-nginx -y
Obtain SSL Certificate
Request a certificate for your domain:
sudo certbot --nginx -d jira.yourdomain.com
Follow the prompts to complete the certificate issuance.
Verify HTTPS Configuration
Test that HTTPS is working by visiting https://jira.yourdomain.com
in your browser.
Set Up Automatic Renewal
Certbot includes a timer for automatic renewal. Verify it’s active:
sudo systemctl status certbot.timer
Jira Initial Setup and Configuration
After installation, access the Jira web interface to complete the setup process.
Access the Setup Wizard
Open your browser and navigate to https://jira.yourdomain.com
(or http://localhost:8080
if accessing locally).
Database Configuration
In the setup wizard:
- Choose “I’ll set it up myself”
- Select “MySQL” as the database type
- Enter database details:
- Database name: jiradb
- Username: jirauser
- Password: your_password
- Host: localhost
- Port: 3306
License Key
Enter your Jira license key or request a trial license.
Administrator Account
Create an administrator account with a strong password.
Email Notification Setup
Configure email settings to enable notifications:
- SMTP host (e.g., smtp.gmail.com)
- SMTP port (e.g., 587 for TLS)
- Username and password for your mail account
- From address
Application Settings
Configure application settings based on your organization’s needs:
- Site name
- Default language
- Base URL (should match your domain)
- Mode (private or public)
Security Hardening for Production
Implement these security measures to protect your Jira installation.
Configure Firewall with UFW
Install and configure UFW (Uncomplicated Firewall):
sudo apt install ufw -y
sudo ufw allow ssh
sudo ufw allow http
sudo ufw allow https
sudo ufw enable
Implement Fail2ban for Brute Force Protection
Install and configure Fail2ban:
sudo apt install fail2ban -y
sudo nano /etc/fail2ban/jail.local
Add the following configuration:
[jira]
enabled = true
port = http,https
filter = jira
logpath = /var/atlassian/application-data/jira/log/atlassian-jira.log
maxretry = 3
bantime = 1800
Create a filter:
sudo nano /etc/fail2ban/filter.d/jira.conf
Add:
[Definition]
failregex = ^.*WARN.*\[user:.*\].*login denied.*username: .*$
ignoreregex =
Restart Fail2ban:
sudo systemctl restart fail2ban
Review File Permissions
Ensure proper file permissions:
sudo find /opt/atlassian/jira -type d -exec chmod 750 {} \;
sudo find /opt/atlassian/jira -type f -exec chmod 640 {} \;
sudo find /opt/atlassian/jira/bin -type f -name "*.sh" -exec chmod 750 {} \;
Performance Tuning
Optimize your Jira installation for better performance.
JVM Memory Allocation
Edit the JVM memory settings:
sudo nano /opt/atlassian/jira/bin/setenv.sh
Adjust the JVM_MINIMUM_MEMORY and JVM_MAXIMUM_MEMORY values based on your server’s available RAM:
JVM_MINIMUM_MEMORY="2048m"
JVM_MAXIMUM_MEMORY="4096m"
Database Performance Optimizations
For MySQL performance, adjust the configuration in /etc/mysql/mariadb.conf.d/50-server.cnf
:
innodb_buffer_pool_size = 2G
innodb_log_file_size = 512M
innodb_flush_log_at_trx_commit = 2
innodb_flush_method = O_DIRECT
Enable Caching
In Jira’s administration interface:
- Go to System > Advanced > General Configuration
- Enable “Issue Cache Size” and set to an appropriate value
Backup and Recovery Strategy
Implement a robust backup strategy to protect your Jira data.
Database Backup
Create a script for database backup:
sudo nano /usr/local/bin/backup-jira-db.sh
Add:
#!/bin/bash
BACKUP_DIR="/var/backups/jira"
DATE=$(date +%Y%m%d)
mkdir -p $BACKUP_DIR
mysqldump -u jirauser -p'your_password' jiradb | gzip > $BACKUP_DIR/jiradb-$DATE.sql.gz
find $BACKUP_DIR -name "jiradb-*.sql.gz" -mtime +30 -delete
Make it executable:
sudo chmod +x /usr/local/bin/backup-jira-db.sh
Set up a cron job:
sudo crontab -e
Add:
0 2 * * * /usr/local/bin/backup-jira-db.sh
Jira Home Directory Backup
Create a script for Jira home directory backup:
sudo nano /usr/local/bin/backup-jira-home.sh
Add:
#!/bin/bash
BACKUP_DIR="/var/backups/jira"
DATE=$(date +%Y%m%d)
mkdir -p $BACKUP_DIR
tar -czf $BACKUP_DIR/jira-home-$DATE.tar.gz -C /var/atlassian/application-data jira
find $BACKUP_DIR -name "jira-home-*.tar.gz" -mtime +7 -delete
Make it executable and set up a cron job as before.
Troubleshooting Common Issues
Check Log Files
When troubleshooting Jira issues, check these log files:
tail -f /var/atlassian/application-data/jira/log/atlassian-jira.log
Memory Issues
If Jira is slow or unresponsive, check memory usage:
free -h
If memory is consistently low, increase JVM memory allocation in setenv.sh.
Database Connection Issues
If Jira can’t connect to the database:
- Verify database service is running:
sudo systemctl status mariadb
- Test connection:
mysql -u jirauser -p jiradb
- Check database permissions:
SHOW GRANTS FOR 'jirauser'@'localhost';
Permission Problems
For permission issues:
- Check ownership:
ls -la /opt/atlassian/jira/
- Fix permissions if needed:
sudo chown -R jira:jira /opt/atlassian/jira/
Congratulations! You have successfully installed Jira. Thanks for using this tutorial for installing the Jira project management tool on your Debian 12 “Bookworm” system. For additional or useful information, we recommend you check the official Jira website.