How to install Confluence on Google Cloud (GCP)?.
Updated: Jan 28
Prerequisites
You will need the following items to complete this tutorial:
A Compute Engine (VM) Instance running Ubuntu.
Create firewall rules (Ingress and Egress)
Add Sudo User (Running Confluence as a service)
Install font config dependency. (You need to install one before you can run the Confluence installer).
Deploying Atlassian Confluence Data Center.
Activate Trial or Production Installation License Key
Create a Database Configuration (MySQL, PostgreSQL, Oracle, Microsoft SQL Server, PostgreSQL Driver)
What is confluence?.
Confluence is a collaborative workspace that enables teams to work together more effectively on mission-critical projects. It's a wiki platform for collaboration that stores and organises all of your project material, from meeting notes to strategy and design documents, as well as IT documentation. It enables teams to quickly produce, store, and share information, allowing them to make faster decisions and better meet client needs. Confluence is a knowledge base that primarily handles content management functions such as creation, organisation, and storage, but it's how it does these things that sets it apart from other collaboration and content management applications.
What is the function of confluence?.
Confluence allows you to generate meeting notes, project plans, and product specifications while other users modify them and see all of the changes simultaneously. In addition, it will enable you to modify files saved in Confluence using your desktop programs and then automatically re-upload them. The Atlassian marketplace has hundreds of extensions and integrations with third-party apps.
Confluence integrates with Jira Software and Jira Service Desk to help your team complete projects quickly and avoid helpdesk problems. The Atlassian technical support team provides 12 months of assistance with each commercial Server license. While your Cloud and Data Center membership is active, you will receive assistance at all times.
What is the best way to use Confluence?.
Learn how to utilize Confluence to improve your team's productivity. Whether you're new to Confluence, teaching your coworkers, or eager to take your Confluence abilities to the next level, visit the link below to the page covering everything from the fundamentals to in-depth best practices. https://www.atlassian.com/software/confluence/guides
Installing Confluence on Compute Engine.
This article will walk you through the process of installing Confluence in a production environment with an external database (Cloud SQL - PostgreSQL) using the Linux installation.
This is the most straightforward approach to getting your production site up and running on a Linux.
Step - 1. Create a Compute Engine (VM) Instance up and running with Ubuntu.
In the Google Cloud Console, Navigate to the Compute Engine (VM) Instances interface and create a virtual machine instance with a Ubuntu (16, 18, 20, 21) LTS boot disk,

Add a network tag (For example, conf-firewall), and hostname (For example, docs.incapio.org).

The hostname of the server must be resolved. Confluence throws an error if the hostname isn't resolved after the final step (Confluence does not start because the Spring Application context has not been set).
Therefore, Configure your fully qualified domain name.

Lastly, Assign a static-ip address for Compute Engine(VM) Instance under network interfaces and create the virtual machine instance.
Step - 2. Create a VPC Firewall Rules
In the Google Cloud Console, Navigate to the VPC network interface and create a new firewall rule with the direction of traffic to Ingress and add the network tag (conf-firewall) in the target tags field, lastly add TCP(80, 443, 8000, 8090, 8091) and UDP(8000, 8091) port addresses and create the rule.
Next, add a secondary rule, create a new firewall rule with the direction of traffic to Egress, select the "Allow all" option under the protocols and ports, and create the firewall rule.
Step - 3. Confluence as a service
If you decide to operate Confluence as a service, you'll need to do the following:
To install Confluence as a service, you must use sudo while running the installation.
The installer will create a confluence user account that will be used to run the service.
The most efficient method to use Confluence is to use it as a service. To accomplish so, we'll need to first create a service account.
Open SSH(Secure Shell Access) on the Compute Engine(Confluence) Instance.
Switch to root user (sudo su -)
Create New User and add User to Sudo Group
Syntax
adduser username
usermod -aG sudo newuser
Example
adduser confusr
----------Output------------------
root@docs:~# adduser confusr
Adding user `confusr' ...
Adding new group `confusr' (1003) ...
Adding new user `confusr' (1002) with group `confusr' ...
Creating home directory `/home/confusr' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully
Changing the user information for confusr
Enter the new value, or press ENTER for the default
Full Name []:
Room Number []:
Work Phone []:
Home Phone []:
Other []:
Is the information correct? [Y/n] y
root@docs:~#
Add User to Sudo Group
usermod -aG sudo confusr
Lastly, switch to confluence service account user.
su confusr
Step - 4. Install font config dependency
The instructions to install font requirements are shown below.
sudo apt install -y fontconfig
Step - 5. Install Atlassian Confluence Data Center.
Download the installer
sudo wget https://www.atlassian.com/software/confluence/downloads/binary/atlassian-confluence-7.14.0-x64.bin
Make the installer executable
sudo chmod a+x atlassian-confluence-7.14.0-x64.bin
Run the installer: Recommend running it with sudo since it will establish a dedicated account for Confluence and allow you to run it as a service.
sudo ./atlassian-confluence-7.14.0-x64.bin
--------------Output-------------------------
Installation of Confluence 7.14.0 is complete
Start Confluence now?
Yes [y, Enter], No [n]
y
Please wait a few moments while Confluence starts up.
Launching Confluence ...
Installation of Confluence 7.14.0 is complete
Your installation of Confluence 7.14.0 is now ready and can be accessed via
your browser.
Confluence 7.14.0 can be accessed at http://localhost:8090
Finishing installation ...
To access confluence in the browser, type http://<instance-ip>:8090. For example, http://35.222.95.178:8090
Step - 6. Activate Trial or Production Installation License Key
Log in to your Atlassian account. Apply a new trial license for Confluence Datacenter, copy-paste the server ID and Generate a trial license.

Lastly, copy-paste the license key and activate the trial license for the Confluence data center.
Clustering
Confluence may be deployed in different ways. For example, you can start with a single node (non-clustered) installation and add clustering later if needed, and select "Non-clustered (single node)."
Step - 7. Database Configuration
Choosing an external database
Note: Remember to take your time while selecting a database. Confluence's built-in XML backup isn't designed for massive data migrations or backups. You may need to utilize a third-party database migration tool if you need to move later.

In the Console, Navigate to Cloud SQL, Create a new instance with PostgreSQL version 11 (Supported Platforms), add Confluence(VM) instance static IP address under Authorized network, connections, and create the instance.
Lastly, In the Cloud SQL interface, Navigate to Database and create a new database for Confluence.

Finally, Apply database configuration in the confluence setup such as Hostname(Cloud SQL(PostgreSQL) Instance IP Address), Port (5432), Database name, Username(postgres), password and test the connection, apply the database configuration.
Database setup will take a while. Once it is done, advance with the remaining setup.
Load Content
The example site is the ideal approach to become acquainted with what Confluence can accomplish for you, whether you are assessing or demonstrating Confluence or introducing Confluence to people new to the concept of a Wiki. More experienced users may want to start with a blank site or restore a backup.
Configure User Management
Confluence will keep a user and group database on its own. Choose this option if you're unsure. After installing Confluence, you can constantly adjust the user management setup and select "Manage users and groups within conflucene."
Administrator Account.
Configure the system administrator account for this Confluence installation and apply admin username, name, email, and password to complete Confluence setup.

Conclusion
Here are some additional installation instructions and solutions. :
Download and install the MySQL driver
sudo apt install -y unzip
sudo wget https://dev.mysql.com/get/Downloads/Connector-J/mysql-connector-java-8.0.27.zip
sudo unzip mysql-connector-java-8.0.27.zip -d mysql-connector
sudo cp mysql-connector/mysql-connector-java-8.0.27/mysql-connector-java-8.0.27.jar /opt/atlassian/confluence/confluence/WEB-INF/lib