Install Confluence with Docker Compose
This article is for those looking for a detailed and straightforward guide on installing Confluence with Docker Compose.
Confluence is a collaboration tool that helps teams collaborate and share knowledge effectively.
In this guide, we will consider the case when you already have a server with the Ubuntu Server 22.04 LTS operating system installed on it.
You can read more about how to install Ubuntu Server 22.04 LTS in my guide “Install Ubuntu Server 22.04 LTS”.
Also, the server must have Docker Engine and Docker Compose installed.
You can learn how to install Docker Engine and Docker Compose on Ubuntu Server by reading “Install Docker Engine and Docker Compose on Ubuntu Server”.
In addition, OpenSSH must be installed on the server, and port 22 must be open in order to be able to connect to the server using the SSH protocol.
To install OpenSSH on a server, you can use the command:
sudo apt install openssh-server
If you plan to connect to the server using the Windows operating system, you can use PuTTY or MobaXterm.
This guide describes how to connect to a server using the iTerm2 terminal emulator installed on the macOS operating system.
Please note that you will need to open the following TCP ports to access your server:
- TCP port 80 - to receive a free cryptographic certificate through the Let’s Encrypt CA.
- TCP port 443 - to access the Confluence web interface.
We connect to the server on which you plan to install Confluence.
Now you need to create a YAML configuration file that will contain all the necessary conditions for Confluence to work.
Let’s create a YAML configuration file using a text editor using the command:
vim confluence-traefik-letsencrypt-docker-compose.yml
Hit the “i” button to go into edit mode, then insert the following configuration for Confluence to work.
Next, you need to make changes to the configuration so that the contents of the file match your conditions. Parameters that need to be checked or changed are marked “(replace with yours)”.
In this guide, the confluence.heyvaldemar.net subdomain will be used to access Confluence from the Internet. You will need to specify your domain or subdomain by which your Confluence will be accessible from the Internet.
Please note that in this guide, Postgres will be used as a database management system, and Traefik will be used as a reverse proxy.
In the “traefik.http.middlewares.authtraefik.basicauth.users” parameter, you must specify the username and password hash to access the Traefik dashboard.
Please note that you can use this service to get the password hash.
Now press the “Esc” button to exit edit mode, then type “:x” and press the “Enter” button to save your changes and exit the editor.
Now let’s start Confluence with the command:
docker compose -f confluence-traefik-letsencrypt-docker-compose.yml -p confluence up -d
To continue the Confluence installation process, you need to go from the workstation to the link https://confluence.heyvaldemar.net, where confluence.heyvaldemar.net is the name of my server. Accordingly, you need to provide the name of your Confluence server.
This guide walks you through installing Confluence for a production environment.
Select “Production Installation” and click on the “Next” button.
Now you need to provide a license key for Confluence.
If you do not already have a license key, you can request a temporary key to try Confluence.
This guide covers installing Confluence with a temporary license key.
Click on “Get an evaluation license”.
Next, click on the “Sign up for an account” button if you do not have an Atlassian account yet.
The next step is to provide: email address, first name, last name, and password to create an Atlassian account.
Click on the “Sign up” button.
Please note that you will receive an email to the email address specified during registration. In the letter, you will find a link to complete the registration.
If you already have an Atlassian account, enter the email address associated with your Atlassian account in the “Enter email” field and click on the “Continue” button.
Specify the password for the Atlassian account and click on the “Log in” button.
In the next step, you need to specify for which product you need a temporary license key, as well as the name of your organization.
Click on the “Generate License” button to generate a temporary license key for Confluence.
Next, you need to confirm that the temporary license key for Confluence will be installed on your server.
Click on the “Yes” button.
In the “Confluence” field, insert the previously received temporary license key and click on the “Next” button.
Now you need to set up a connection to the previously created database.
Select “My own database” and click on the “Next” button.
Now you need to specify the system for database management and the previously created database that will be used to run Confluence.
In the “Database type” field, select “PostgreSQL”.
In the “Setup type” section, select “Simple”.
In this tutorial, the database for Confluence is on the same server as Confluence.
In the “Hostname” field, enter “localhost”.
In the “Database port” field, specify the value “5432”.
This tutorial uses “confluencedb” as the database name for Confluence.
Specify “confluencedb” in the “Database name” field.
This guide uses “confluencedbuser” as the username with database rights for Confluence.
In the “Username” field, specify “confluencedbuser”.
In the “Password” field, specify the password assigned to the “confluencedbuser” user.
Click on the “Test connection” button.
The message “Success! Database connected successfully.” means that all data was entered correctly.
Click on the “Next” button.
In the next step, you will be able to choose from several options: download demo content, do not download any content and start filling Confluence yourself or restore data from a backup.
This guide walks you through installing Confluence without importing any content.
Click on the “Empty Site” button.
Next, you can configure Confluence user management using Jira.
This tutorial walks you through installing Confluence without Jira’s user management capabilities.
Click on the “Manage users and groups within Confluence” button.
In the next step, you need to provide: username, name, email address, and password to create a Confluence administrator account.
Click on the “Next” button.
Everything is ready to use Confluence.
Click on the “Start” button.
Now you can create the first space, for example, for the development team, where they will work on their projects.
Specify a name for the first space and click on the “Continue” button.
Next, the editor will open, in which you can create the first page in the new space.
Click on the “Skip tutorial” button.
We fill the page with useful content so that we can later publish it in a new space.
Click on the “Publish” button.
The first page in the developer space has been successfully completed.
Please note that you can restrict access for users, both to space and to certain pages within it.
To access the Traefik control panel, go to the link https://traefik.confluence.heyvaldemar.net from the workstation, where traefik.confluence.heyvaldemar.net is the name of my server. Accordingly, you need to specify the name of your server with Traefik installed.
Specify the username and password specified earlier in the YAML configuration file and click on the “OK” button.
Welcome to the Traefik dashboard.