Confluence Installation and Backup Recovery on Linux

Prerequisites

Before installing Confluence, ensure the following components are ready on your server:

  • Java Development Kit (JDK) 8 or later
  • MySQL 5.7+ or another supported database

JDK Setup

# Extract JDK archive to /opt/java
cd /opt
tar xzf jdk-8u231-linux-x64.tar.gz

# Set environment variables in /etc/profile
export JAVA_HOME=/opt/java/jdk1.8.0_231
export JRE_HOME=$JAVA_HOME/jre
export CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
export PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin

# Reload profile and verify
source /etc/profile
java -version
# Output: java version "1.8.0_231"

MySQL Database

# Install MySQL 5.7 via official repository (simplified compared to compiling from source)
yum install -y https://dev.mysql.com/get/mysql57-community-release-el7-11.noarch.rpm
yum install -y mysql-community-server

# Start MySQL and secure the installation
systemctl start mysqld
grep 'temporary password' /var/log/mysqld.log
mysql_secure_installation

# Create database and user for Confluence
mysql -u root -p
CREATE DATABASE confluence CHARACTER SET utf8 COLLATE utf8_bin;
CREATE USER 'confluence'@'localhost' IDENTIFIED BY 'StrongP@ssw0rd';
GRANT ALL PRIVILEGES ON confluence.* TO 'confluence'@'localhost';
FLUSH PRIVILEGES;
SET GLOBAL TRANSACTION ISOLATION LEVEL READ COMMITTED;
EXIT;

Installing Confluence

Download and Extract

wget https://www.atlassian.com/software/confluence/downloads/binary/atlassian-confluence-7.13.0.tar.gz
tar xzf atlassian-confluence-7.13.0.tar.gz
mv atlassian-confluence-7.13.0 /opt/atlassian/confluence

Set Confluence Home Directory

mkdir -p /var/atlassian/application-data/confluence
echo "confluence.home=/var/atlassian/application-data/confluence" >> /opt/atlassian/confluence/confluence/WEB-INF/classes/confluence-init.properties

First Startup and Server ID Retrieval

# Start Confluence
/opt/atlassian/confluence/bin/start-confluence.sh

# Access http://<server-ip>:8090 in a browser
# Follow the web installer steps:
#   - Choose language and installation type (Product installation)
#   - Skip plugin installation
#   - Note the Server ID displayed on the license screen

Apply License (Patching)

After obtaining the Server ID, stop Confluecne and proceed with the licensing process.

# Stop Confluence
/opt/atlassian/confluence/bin/stop-confluence.sh

# Copy the jar file to a local machine for patching
cp /opt/atlassian/confluence/confluence/WEB-INF/lib/atlassian-extras-decoder-v2-3.4.jar ~/atlassian-extras-2.4.jar

# On a Windows machine, use a patching tool (e.g., ConfluenceCrack) to process the jar.
# The tool generates atlassian-extras-2.4.jar and atlassian-extras-2.4.bak.

# Rename the patched jar back to the original name and upload it
mv atlassian-extras-2.4.jar atlassian-extras-decoder-v2-3.4.jar
scp atlassian-extras-decoder-v2-3.4.jar root@server:/opt/atlassian/confluence/confluence/WEB-INF/lib/

# Obtain a license key from the patcher tool

Install MySQL JDBC Driver

mkdir -p /opt/atlassian/confluence/confluence/WEB-INF/lib/
wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-5.1.49.tar.gz
tar xzf mysql-connector-java-5.1.49.tar.gz
cp mysql-connector-java-5.1.49/mysql-connector-java-5.1.49-bin.jar /opt/atlassian/confluence/confluence/WEB-INF/lib/

Complete Installation via Web UI

# Restart Confluence
/opt/atlassian/confluence/bin/start-confluence.sh

# In the browser, enter the license key
# Choose "My own database" and provide MySQL connection details:
#   Database URL: jdbc:mysql://localhost:3306/confluence?useUnicode=true&characterEncoding=utf8
#   User: confluence
#   Password: StrongP@ssw0rd

# Choose content loading options (empty site or restore from backup)
# Skip Jira integration if not needed
# Create administrator account

Backup and Restore

Backup Configruation

# Access Confluence administration → General Configuration → Daily backup management
# Configure backup schedule and destination (e.g., /var/atlassian/application-data/confluence/backups)

Restore from Backup

# Place the backup .zip file into the Confluence home directory's backups folder:
/var/atlassian/application-data/confluence/backups/

# In the admin interface, navigate to Backup & Restore and select the backup file
# Click "Restore" and wait for the process to complete

After restoration, verify that all space and pages are accessible.

Tags: confluence MySQL JDK Backup restore

Posted on Thu, 16 Jul 2026 17:12:39 +0000 by gtal3x