Skip to main content

Confluence Self-Hosting

This document outlines how to self-host Confluence, providing you with greater control over your data and infrastructure. Note: Self-hosting Confluence requires technical expertise and resources. Consider the implications carefully. Atlassian no longer sells Server licenses, so self-hosting refers to deploying Confluence Data Center or using very old Server licenses that you possess. This guide focuses on the Data Center edition.

Disclaimer: Consult the Atlassian documentation for the most up-to-date and accurate information regarding licensing and system requirements. This guide serves as a general overview. Installing older Server versions may violate Atlassian's terms of service if your license is expired.

Understanding Confluence Data Center

Confluence Data Center is the self-managed enterprise edition of Confluence. It provides high availability, scalability, and disaster recovery capabilities. Key differences from Atlassian's Cloud offering:

  • Infrastructure: You are responsible for providing and maintaining the underlying infrastructure (servers, networking, databases, etc.).
  • Licensing: Requires a Data Center license, obtained directly from Atlassian.
  • Data Residency: You control where your data is stored.
  • Customization: Greater flexibility in customizing Confluence to meet your specific needs.

Prerequisites

Before you begin, ensure you have the following:

  • Data Center License: You must possess a valid Confluence Data Center license.
  • Infrastructure:
    • Servers: Multiple servers are required for a Data Center setup for High Availability. Consider cloud providers like AWS, Azure, or GCP, or on-premises solutions.
    • Database: A supported database (PostgreSQL, MySQL, Oracle, SQL Server). See Atlassian's Confluence documentation for a comprehensive list.
    • Shared File System: A network file system (NFS or similar) accessible to all Confluence nodes for storing attachments.
  • Technical Skills: Experience with server administration, networking, database management, and LinuxWindows command-line tools.
  • Java: The correct version of Java Development Kit (JDK) installed. Consult Atlassian's documentation for supported JDK versions. Recommended to use a supported version of OpenJDK.
  • Reverse Proxy (Optional but Recommended): A reverse proxy such as Nginx or Apache for load balancing and SSL termination.
  • Confluence Installation Files: Download the Confluence Data Center installation files from the Atlassian website (requires a license).
  • Docker experience (If using Docker): Solid understanding of Docker concepts, Docker Compose, and container management.

Installation Steps (General Overview)

The specific installation steps will vary depending on your chosen infrastructure and database. The following provides a general outline:

  1. Prepare the Database:

    • Create a new database and user account for Confluence.
    • Grant the user account appropriate permissions to the database.
    • Configure the database for optimal performance.
  2. Set up the Shared Home Directory:

    • Create a directory on the shared file system to serve as the Confluence home directory.
    • Ensure that all Confluence nodes have read and write access to this directory.
  3. Install Confluence on the First Node:

    • Extract the Confluence installation files to a directory on the first server.
    • Run the Confluence installer and follow the prompts.
    • When prompted, choose the "Data Center" installation type.
    • Configure the database connection.
    • Specify the shared home directory.
    • Configure the Confluence base URL.
  4. Configure Clustering:

    • Before starting the first node, you'll typically need to configure cluster settings in the confluence.cfg.xml file (located in the shared home directory) or via the Confluence UI after the first node is operational. This involves setting up the cluster name.
    • Verify the database is properly connected.
  5. Install Confluence on Subsequent Nodes:

    • Repeat the installation process on the remaining servers. Point to the existing shared home directory.
    • Nodes should automatically join the cluster.
  6. Configure Load Balancing (Reverse Proxy):

    • Configure your reverse proxy to distribute traffic evenly among the Confluence nodes.
    • Enable session affinity ("sticky sessions") so that users are consistently routed to the same node.
    • Configure SSLTLS for secure communication.
  7. Start Confluence on All Nodes:

    • Start the Confluence service on all of the servers starting with the first installed node.
  8. Verify the Installation

    • Access the Confluence web interface through the reverse proxy URL to verify that the installation is working correctly.
    • Check for errors in the Confluence logs.

Self-Hosting with Docker (Example)

This provides a simplified example using Docker Compose. A production deployment would require more robust configuration.

  1. Create a Docker Compose File (docker-compose.yml):
version: "3.9"
services:
confluence:
image: atlassianconfluence-data-center:latest # Replace 'latest' with a specific version
ports:
- "8090:8090"
- "8091:8091"
environment:
- CATALINA_CONNECTOR_PROXYNAME=your.confluence.domain
- CATALINA_CONNECTOR_PROXYPORT=443
- CATALINA_CONNECTOR_SCHEME=https
- ATL_JDBC_URL=jdbc:postgresql:db:5432confluence
- ATL_JDBC_USER=confluenceuser
- ATL_JDBC_PASSWORD=your_password
volumes:
- confluence-data:varatlassianapplication-dataconfluence #Shared home directory
depends_on:
- db

db:
image: postgres:14 #Use a supported postgres version.
environment:
- POSTGRES_USER=confluenceuser
- POSTGRES_PASSWORD=your_password
- POSTGRES_DB=confluence
volumes:
- db-data:varlibpostgresqldata

volumes:
confluence-data:
db-data:
  1. Adjust Configuration:

    • Image Version: Replace atlassianconfluence-data-center:latest with a specific version of the Confluence Data Center image.
    • Ports: Adjust port mappings as needed.
    • Environment Variables: Set the environment variables according to your setup:
      • CATALINA_CONNECTOR_PROXYNAME: Your Confluence domain name.
      • CATALINA_CONNECTOR_PROXYPORT: The port your reverse proxy listens on (typically 443 for HTTPS).
      • CATALINA_CONNECTOR_SCHEME: The protocol (https).
      • ATL_JDBC_URL, ATL_JDBC_USER, ATL_JDBC_PASSWORD: Database connection details. Replace with your database URL, user and credentials.
    • Volumes: Ensure volumes are set up to persist data outside the container. Crucially, the confluence-data volume must be shared between all containers in a properly clustered Data Center setup, so this simple docker compose is only suitable for a single instance for non-critical testing. A real Data Center setup would require a proper shared filesystem like an NFS mount for the confluence-data volume.
  2. Start the Containers:

docker-compose up -d
  1. Access Confluence:
  • Open your web browser and navigate to your Confluence domain name (e.g., https:your.confluence.domain).

Important Considerations for Docker:

  • Clustering: This example sets up a single Confluence instance. To achieve Data Center high availability, you'll need to deploy multiple Confluence containers and configure them to form a cluster, requiring a shared filesystem for the confluence-data volume.
  • Networking: Configure your Docker network correctly.
  • Reverse Proxy: You'll still need a reverse proxy (e.g., Nginx) to handle SSL and load balancing. The reverse proxy must be configured to forward traffic correctly to the Confluence container(s).
  • Persistence: The Docker volumes ensure that your data persists even if the containers are stopped or restarted.
  • Docker Hub: Consult the Atlassian Confluence Docker Hub page for more information.

Post-Installation Tasks

  • Configure Backups: Implement a robust backup strategy to protect your Confluence data.
  • Monitor Performance: Monitor the performance of your Confluence instance and database.
  • Security Hardening: Follow security best practices to protect your Confluence instance from unauthorized access.
  • Install Plugins: Install any necessary plugins from the Atlassian Marketplace.
  • Configure Email: Configure Confluence to send and receive emailnotifications.
  • SSL Configuration: Ensure SSL is properly configured using your reverse proxy for secure communication with end users.

Troubleshooting

  • Check the Logs: Confluence logs are located in the Confluence home directory (varatlassianapplication-dataconfluencelog in the Docker example).
  • Consult the Atlassian Documentation: The Atlassian documentation is a valuable resource for troubleshooting Confluence issues.
  • Search the Atlassian Community: Ask questions and search for solutions in the Atlassian Community forums.

Resources

  • Atlassian Confluence Documentation:
  • Atlassian Confluence Data Center Documentation: Refer to specific Data Center documentation on Atlassian's site.
  • Atlassian Confluence Docker Hub: (Note: Check the Data Center image name)

This guide provides a general overview of self-hosting Confluence. Carefully review the Atlassian documentation and plan your deployment according to your specific requirements. Remember to ensure you possess the correct licenses.