GitLab for Confluence

Installation & Configuration

This guide explains how to install and configure GitLab for Confluence Cloud.

The configuration process requires:

  • A Confluence administrator

  • Either a GitLab Personal Access Token (PAT) or OAuth (GitLab SaaS only)

The integration supports both GitLab SaaS and GitLab On-Premises deployments.


Prerequisites

Before configuring the app, ensure that:

  • You have Confluence administrator permissions

  • You have access to a GitLab account

  • The GitLab account can access the required repositories

  • You can create a GitLab Personal Access Token (PAT), or, if using GitLab SaaS, you have a GitLab.com account to authorize via OAuth

For GitLab On-Premises deployments:

  • Your GitLab instance must be accessible from the public internet

  • HTTPS is strongly recommended

  • OAuth is not available for On-Premises deployments; use a Personal Access Token


Install the App

Install GitLab for Confluence Cloud from the Atlassian Marketplace. A free trial is available.

Once installed, the app becomes available within your Confluence instance.


Authorize the Connection

Choose one of the following methods to authorize the integration. You only need to complete one.

Method A: Personal Access Token (GitLab SaaS or On-Premises)

The integration requires a GitLab Personal Access Token (PAT) to retrieve GitLab data securely.

Step 1: Open GitLab Preferences

In GitLab:

  1. Click your profile avatar

  2. Select Preferences

image-20260526-021948.png

Step 2: Navigate to Access Tokens

In the left navigation menu:

  1. Under Access, select Personal access tokens

image-20260526-022144.png
  1. Under Generate token, select Legacy token

image-20260526-022931.png

Step 3: Create the Token

Configure the following:

Token Name

Choose a descriptive name such as:

Gitlab for Confluence

Expiration Date

Select an expiration date that matches your organization's security requirements.

Scopes

The following scope is required:

  • read_api

image-20260526-023353.png

Step 4: Copy the Token

After generating the token:

  1. Copy the Personal Access Token immediately

  2. Store it securely

Important:
GitLab only displays the token once.

image-20260526-023538.png

Step 5: Configure GitLab in Confluence

In Confluence:

  1. Navigate to the Confluence administration by clicking the cogwheel next to the avatar

  2. From the left-hand menu, expand Apps and select GitLab

    image-20260526-024459.png
  3. Enter:

    • The Personal Access Token

    • The GitLab Base URL

  4. Save the configuration

image-20260526-024755.png

Method B: OAuth (GitLab SaaS only)

GitLab SaaS accounts can authorize the integration using OAuth instead of a Personal Access Token.

Step 1: Open Confluence Administration

In Confluence:

  • Navigate to the Confluence administration by clicking the cogwheel next to the avatar

  • From the left-hand menu, expand Apps and select GitLab


Step 2: Connect via OAuth

  • Under "Type of authorization," select OAuth

  • Select Connect to GitLab

    image-20260805-011914.png
  • You'll be redirected to GitLab to approve read-only access, then back to Confluence

OAuth is available for GitLab.com only. For GitLab On-Premises, use Method A instead.


GitLab Base URL

Use the appropriate base URL for your deployment type.

GitLab SaaS

Use:

https://gitlab.com

This applies when using a Personal Access Token. OAuth connections are fixed to GitLab.com and do not require a Base URL to be entered.

GitLab On-Premises

Use your publicly accessible GitLab URL, for example:

https://gitlab.example.com

The URL must be accessible from the internet so the integration can retrieve GitLab metadata.


Updating the Configuration

For security reasons, when using a Personal Access Token:

  • The Personal Access Token and Base URL must be updated together

  • They cannot be changed independently

If your token expires, generate a new token and reconfigure both values.


Verify the Configuration

After saving the configuration:

  1. Open a Confluence page

  2. Insert a supported GitLab link

  3. Confirm that the macro renders correctly

Supported links include:

  • Projects

  • Merge requests

  • Issues/work items

  • Pipelines

  • Source Code


Security Recommendations

We recommend:

  • Using a dedicated service account where possible

  • Limiting token permissions to the minimum required scopes

  • Rotating tokens regularly

  • Avoiding personal administrator accounts for production integrations

  • If using OAuth, there is no token to rotate manually, the authorization can be revoked at any time from your GitLab account settings


Troubleshooting

Common setup issues include:

Issue

Possible Cause

No valid token

Token expired or invalid

Permission denied

Missing read_api scope

Content not loading

Incorrect base URL

On-Premises connection issues

GitLab instance not publicly accessible

OAuth connection lost

OAuth authorization expired or revoked in GitLab

See the Troubleshooting guide for additional details.


Next Steps

After completing the installation:


Updated: