This article is written for those who were searching for a detailed and simple for the understanding guide on how to install Confluence on Ubuntu Server.

Confluence is a collaboration software program developed and published by Australian software company Atlassian.

In this guide, we will consider the case when you already have a server with the Ubuntu Server 18.04 LTS operating system installed on it.

You can read more about how to install Ubuntu Server 18.04 LTS in my guide «Installing Ubuntu Server 18.04 LTS».

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 the server, you can use the command:

sudo apt-get install openssh-server

If you plan to connect to the server using the Windows operating system, you can use PuTTY, a freeware client for various remote access protocols, including SSH, Telnet, rlogin.

This guide covers connecting 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:

  • 80 – to receive a free cryptographic certificate through the Let’s Encrypt certificate authority.
  • 443 – to access the Confluence web interface.
  • 8090 – to access the Confluence web interface.

Connect to the server on which it is planned to install Confluence.

This guide discusses how to obtain a free cryptographic certificate through the Let’s Encrypt Certificate Authority. To receive and further update the free SSL certificate, we will use the Certbot software client, which is designed to simplify the receipt and renewal of the certificate through the Let’s Encrypt certificate authority.

Add the Certbot repository using the command:

sudo add-apt-repository ppa:certbot/certbot

Press the “Enter” button to confirm the addition of a new repository.

Now install the packages necessary for Confluence to work using the command:

sudo apt-get install -y postgresql apache2 fontconfig certbot python-certbot-apache

Please note that in this guide, PostgreSQL will be used as the database management system, and Apache will be used as the webserver.

Configure Apache for further work with the Confluence.

Enable the Apache webserver module called “proxy_http” with the command:

sudo a2enmod proxy_http

Please note that the “proxy_http” module acts like a proxy server for the HTTP and HTTPS protocols.

Enable the Apache webserver module called “rewrite” with the command:

sudo a2enmod rewrite

Please note that the “rewrite” module is one of the most commonly used Apache webserver modules and provides a flexible and powerful way to manipulate URLs.

Now you need to create two virtual host files (called block in Nginx), with which Confluence will continue to work.

Two virtual host files will be required to provide access to Confluence via HTTPS, as well as to realize the possibility of using Confluence at https://confluence.heyvaldemar.net, without specifying port 8090 in the address bar of the browser.

In this manual, the confluence.heyvaldemar.net subdomain will be used to access the Confluence control panel from the Internet. You will need to specify your domain or subdomain by which your Confluence will be accessible from the Internet.

Create the first virtual host file using a text editor using the command:

sudo vim /etc/apache2/sites-available/confluence.heyvaldemar.net.conf

Press the “i” button to enter the editing mode, then insert the following configuration for the webserver to work:

In this manual, the confluence.heyvaldemar.net subdomain will be used to access the Confluence control panel from the Internet. You will need to specify your domain or subdomain by which your Confluence will be accessible from the Internet.

Now press the “Esc” button to exit the editing mode, and then enter “:x” and press the “Enter” button to save the changes and exit the editor.

Create a second virtual host file using a text editor using the command:

sudo vim /etc/apache2/sites-available/confluence.heyvaldemar.net-ssl.conf

Press the “i” button to enter the editing mode, then insert the following configuration for the web server to work:

In this manual, the confluence.heyvaldemar.net subdomain will be used to access the Confluence control panel from the Internet. You will need to specify your domain or subdomain by which your Confluence will be accessible from the Internet.

Now press the “Esc” button to exit the editing mode, and then enter “:x” and press the “Enter” button to save the changes and exit the editor.

Activate the first virtual host using the command:

sudo a2ensite confluence.heyvaldemar.net.conf

Activate the second virtual host using the command:

sudo a2ensite confluence.heyvaldemar.net-ssl.conf

Deactivate the default virtual host using the command:

sudo a2dissite 000-default.conf

Make sure that there are no errors in the syntax of the new Apache configuration file using the command:

sudo apache2ctl configtest

Restart Apache to apply the changes using the command:

sudo systemctl restart apache2

Verify that Apache started successfully using the command:

sudo systemctl status apache2

Now, to increase the security level of the webserver, it is necessary to obtain a cryptographic certificate for the domain or subdomain, through which the Confluence will be accessible from the Internet.

To obtain and subsequently renew a free SSL certificate, we will use the Let’s Encrypt Certificate Authority, as well as the Certbot software client, which is designed to simplify the receipt and renewal of the certificate through the Let’s Encrypt Certificate Authority.

In this manual, the confluence.heyvaldemar.net subdomain will be used to access the Confluence control panel from the Internet. You will need to specify your domain or subdomain by which your Confluence will be accessible from the Internet.

Request a cryptographic certificate using the command:

sudo certbot --apache -d confluence.heyvaldemar.net

Next, indicate the email address to which Let’s Encrypt will send notifications about the expiration of the cryptographic certificate and press the “Enter” button.

The next step is to read and accept the terms of use of the services provided.

Press the “a” button, then “Enter” if you agree to the terms of use of the services provided.

At the next stage, you need to choose: do you want to share the email address indicated above with the Electronic Frontier Foundation to receive newsletters.

Press the “n” button, then “Enter”.

The next step is to choose: do you want the parameters to automatically redirect HTTP traffic to HTTPS be automatically added to the Apache configuration file.

Press the button “2”, then “Enter”.

Please note that the cryptographic certificates received through the Let’s Encrypt Certificate Authority are valid for ninety days. Certbot automatically adds a script to renew the certificate in the task scheduler, and the script runs twice a day, automatically updating any cryptographic certificate that expires within thirty days.

You can check the operability of the cryptographic certificate renewal process using the command:

sudo certbot renew --dry-run

Now you need to create a database that Confluence will use in the future, as well as a user with the necessary rights to this database.

Switch to the “postgres” user, who has administrator rights in PostgreSQL using the command:

sudo su - postgres

Next, switch to the PostgreSQL command line using the command:

psql

Create a new user using the command:

CREATE USER confluencedbuser WITH PASSWORD '2n!sfa@423FdsC0fH$vL';

The user name will be “confluencedbuser” with the password “2n!Sfa@423FdsC0fH$vL”.

Create a new database and give it rights to the previously created user using the command:

CREATE DATABASE "confluencedb" WITH OWNER "confluencedbuser" ENCODING 'UTF8' LC_COLLATE = 'en_US.UTF-8' LC_CTYPE = 'en_US.UTF-8' TEMPLATE template0 CONNECTION LIMIT = -1;

In this manual, “confluencedb” will be used as the name for the database.

Exit the PostgreSQL command line using the command:

\q

Exit the user “postgres” using the command:

exit

Now you need to download the Confluence installer using the command:

wget https://www.atlassian.com/software/confluence/downloads/binary/atlassian-confluence-7.3.5-x64.bin

Please note that the latest version of Confluence can be found on the official Atlassian website https://www.atlassian.com/software/confluence/download-archives

This guide covers the installation of Confluence 7.3.5.

Let’s enable the execution of the file “atlassian-confluence-7.3.5-x64.bin” with the command:

sudo chmod a+x atlassian-confluence-7.3.5-x64.bin

Run the Confluence installation using the command:

sudo ./atlassian-confluence-7.3.5-x64.bin

Please note that your team will differ from the one specified in this article since you will install the current version of Confluence at the time of reading.

At the first stage, the installer will warn that Confluence will be installed on your server.

Press on the “Enter” button.

Next, select “Custom Install (recommended for advanced users)”.

Press on the “Enter” button.

In the next step, you can choose where to install Confluence.

This guide describes how to set Confluence to “/opt/atlassian/confluence”.

Press on the “Enter” button.

Next, you can choose where to store the Confluence data.

This tutorial covers setting Confluence to “/var/atlassian/application-data/confluence”.

Press on the “Enter” button.

Now you can select the ports that Confluence will use.

This guide describes how to install Confluence using port 8090 for HTTP and port 8000 for Control.

Press on the “Enter” button.

Next, you will be offered the opportunity to install Confluence as a service.

Press on the “Enter” button.

Confluence installation completed successfully.

Please note that you do not need to run Confluence.

Specify “n” and press the “Enter” button.

Now you need to make changes to the Confluence configuration file by opening it in a text editor using the command:

sudo vim /opt/atlassian/confluence/conf/server.xml

Press the “i” button to enter the editing mode, find the section “DEFAULT – Direct connector with no proxy, for unproxied HTTP access to Confluence” and comment it out by setting <!-- on the line above the section parameters and --> below the section options that you want to comment out.

Next, find the “HTTPS – Proxying Confluence via Apache or Nginx over HTTPS” section and uncomment it by removing the <!-- sign on the line above the section parameters and the --> below the section parameters that you want to uncomment.

Then set the parameter “proxyName” to “confluence.heyvaldemar.net”.

In this manual, 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 available from the Internet.

Now press the “Esc” button to exit the editing mode, and then enter “:x” and press the “Enter” button to save the changes and exit the editor.

Start Confluence with the command:

sudo /etc/init.d/confluence start

Open the Confluence log to verify that Confluence starts correctly using the command:

sudo less /opt/atlassian/confluence/logs/catalina.out

On the keyboard, press the key combination “Shift” and “f” to start monitoring changes in the Confluence log in real-time.

Please note that a message containing “Server startup in [13,359] milliseconds” indicates that Confluence has started successfully.

On the keyboard, press the key combination “Ctrl” and “c”, then “q” to close the Confluence log.

To continue the process of installing the Confluence, you must go from workstation to the link https://confluence.heyvaldemar.net, where confluence.heyvaldemar.net is the name of my server. Accordingly, you need to specify the name or IP address of your server with the Confluence installed.

This guide describes how to install Confluence for a production environment.

Select “Production Installation” and click on the “Next” button.

Next, you can connect additional applications to expand the capabilities of Confluence.

This guide describes how to install Confluence without additional applications.

Click on the “Next” button.

Now you need to specify the license key for Confluence.

If you do not already have a license key, you can request a temporary key to familiarize yourself with Confluence.

This guide describes how to install 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 already have an Atlassian account.

The next step is to specify: 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 provided during registration. In the letter, you will find a link to complete the registration.

If you already have an Atlassian account, then enter the email address associated with the 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.

The next step is to indicate 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 obtained temporary license key and click on the “Next” button.

Now you need to configure the connection to the previously created database.

Select “My own database” and click on the “Next” button.

Now you need to specify the database management system and the previously created database that will be used for Confluence.

In the “Database type” field select “PostgreSQL”.

In the “Setup type” section, select “Simple”.

In this guide, the Confluence database is located on the same server as Confluence.

In the “Hostname” field specify “localhost”.

In the “Database port” field specify the value “5432”.

In this manual, “confluencedb” is used as the database name for Confluence.

In the “Database name” field specify “confluencedb”.

In this manual, the “confluencedbuser” is used as the user name that has the rights to the database for Confluence to work.

In the “Username” field specify “confluencedbuser”.

In the “Password” field specify the password assigned to the user “confluencedbuser”.

Click on the button “Test connection”.

The message “Success! Database connected successfully.” means that all data was specified correctly.

Click on the “Next” button.

The next step will be the opportunity 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 covers installing Confluence without importing any content.

Click on the “Empty Site” button.

Next, you can configure Confluence user management using “Jira”.

This guide describes how to install Confluence without the ability to manage users with Jira.

Click on the “Manage users and groups within Confluence” button.

In the next step, you must specify: login, name, email address and password to create the 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 a development team where they will work on their projects.

Specify a name for the first space and click on the “Continue” button.

Next, an editor will open in which you can create the first page in a new space.

Click on the “Skip tutorial” button.

Fill the page with useful content, then publish it in a new space.

Click on the “Publish” button.

The first page in the space for developers has been successfully created.

Please note that you can restrict access for users, both to space and to certain pages inside it.

Author

Hi, I’m Vladimir Mikhalev, but my friends call me Valdemar. I have a lot of experience in the design and maintenance of various information systems. On my website, you will find detailed and clear guides for setting up IT solutions. Dive into the ocean, full of positive and technology! For cooperation: callvaldemar@gmail.com

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.