Recent searches

in

Connecting a GitLab repository as your source

Last modified: September 29th, 2026

On this page

Connecting a GitLab Git Repository to your Site allows you to work on your website files locally and sync your changes to CloudCannon. CloudCannon also syncs any file changes you make in CloudCannon back to GitLab.

To connect a self-hosted GitLab Git Repository instead, please read our documentation on connecting a self-hosted GitLab repository as your source.

To connect a GitLab Git Repository and start syncing files:

  1. Navigate to the Syncing page under Site Settings.
  2. Select the GitLab repository option from the provider dropdown.
  3. Click the Authorize button.

CloudCannon will open the Connect to GitLab modal, where you can choose one of two authentication methods. The same options appear on the Authentication tab of the GitLab page under Org Settings.

A screenshot of the Syncing page under Site Settings shows the GitLab repository option selected and an Authorize button.

Authenticate with your GitLab account#

When you authenticate with your GitLab user account, your CloudCannon Organization gets access to the same Git Repositories on GitLab to which you have access.

To authenticate with your GitLab user account:

  1. Select the Connect your GitLab account option under Authentication method in the Connect to GitLab modal.
  2. Click the Authenticate with GitLab button. CloudCannon will redirect you to GitLab.
  3. Log in to your GitLab account.
  4. Authorize CloudCannon to access your GitLab account.

GitLab will redirect you back to CloudCannon, where you can select a Git Repository to connect.

A screenshot of the GitLab page under Org Settings shows the Connect your GitLab account authentication method with an Authenticate with GitLab button.

Authenticate with a group access token#

Alternatively, you can create a group access token in GitLab and save that token in CloudCannon. A group access token gives your CloudCannon Organization access to all the resources scoped to that token.

To create and configure a token, please read GitLab's documentation on group access tokens.

For full functionality in CloudCannon, your group access token should have at least the Maintainer role and the api, read_api, read_repository, and write_repository scopes.

To authenticate with a group access token:

  1. Select the Authenticate with a group access token option under Authentication method in the Connect to GitLab modal.
  2. Paste your token into the Group Access Token field.
  3. Enter the expiry date of your token in the Expiry Date field. The date must be in the future.
  4. Click the Save and authenticate button.

CloudCannon will save your token and authenticate GitLab.

A screenshot of the GitLab page under Org Settings shows the group access token form with the Group Access Token and Expiry Date fields.

Once you've authenticated with a group access token, the Authentication tab on the GitLab page under Org Settings shows the token's bot account, labeled Authenticated with access token, and the date the token expires. CloudCannon will email the members of the Owners Permission Group in your Organization shortly before the token expires. To replace an expired or revoked token, unauthenticate GitLab, then authenticate again with a new token.

A screenshot of the Authentication tab on the GitLab page under Org Settings shows a group access token bot account with its expiry date and an Open profile button.

Select your Git Repository and branch#

Once you've authenticated, you can choose the GitLab Git Repository and branch to connect to your Site. Under the Branch Setup heading, you can sync from a branch that already exists in your Git Repository, or have CloudCannon create a new branch from a source branch. If your Git Repository has no branches, CloudCannon will show a link to add one in GitLab.

When you click the Backup and Sync button, CloudCannon will replace any existing files on your Site with the contents of the selected Git Repository. To cancel the process, exit the page instead.

To connect your Git Repository and branch:

  1. Select your Git Repository from the Repository dropdown.
  2. Choose the Use an existing branch option or the Create a new branch option under the Branch Setup heading.
  3. Pick your branch from the Branch dropdown. If you are creating a new branch, pick the branch to copy from the Source branch dropdown and enter a name in the New branch name field.
  4. Click the Backup and Sync button.

CloudCannon will connect your Site to your GitLab Git Repository. CloudCannon pulls in any changes you push to your Git Repository, and automatically commits and pushes any changes you make in CloudCannon.

A screenshot of the Syncing page under Site Settings shows a GitLab Git Repository and branch selected.

Related Resources

Open in a new tab