Choose your preferred SSG:
Choose your preferred SSG:

Connecting a self-hosted GitLab repository as your source

Connecting to your self-hosted GitLab allows you to work on your websites locally and have the changes sync to CloudCannon. File changes made on CloudCannon also get synced back to your self-hosted GitLab repository.


To connect to a repository instead, follow the instructions listed for GitLab.

Connecting to an instance

Before syncing with a repository in your self-hosted GitLab, you need to connect CloudCannon to your self-hosted instance. You only need to do this once per account.

To connect to your self-hosted GitLab instance:

  1. Go to Settings / Self Hosted GitLab
  2. Enter the details for your self-hosted instance of GitLab
  3. Click Configure Self Hosted GitLab
Self hosted GitLab entry interface

The details for this page come from the GitLab server under User Settings / Applications.

Settings page from Gitlab

The Redirect URI is The minimal scopes required are:

  1. api
  2. read_user
  3. read_repository
  4. write_repository
  5. openid

Once completed, the key and secret will be available for use in CloudCannon. The URLs should match the form placeholders.

Syncing with a repository

To connect a self-hosted GitLab repository and start syncing files, follow these instructions:

  1. Go to Site Settings / Source Syncing 
  2. Select Self Hosted GitLab repository 
  3. Click Authenticate
Selecting self hosted GitLab as the your provider

This redirects you to your self-hosted GitLab repository. Log in and authorize CloudCannon access to your self-hosted GitLab account. You’ll be redirected back to CloudCannon to pick a repository to connect. If you don’t have one for this website, create a new one in your self-hosted GitLab and refresh this page.

Selecting self hosted GitLab repository to sync

Any existing files on your website will be replaced with the contents of the selected repository. Click Backup and Sync to continue, or exit the page to cancel the process.

Your self-hosted GitLab is now connected. Changes you push to the Git repository are pulled in by CloudCannon. Any changes made on CloudCannon are automatically committed and pushed.

Adding custom HTTP headers

Once you’ve connected your GitLab server, you can configure custom HTTP headers for CloudCannon to use when connecting to your GitLab server under the Server tab of your Self Hosted GitLab settings. Custom headers are passed using Git’s http.extraHeader configuration option and in the form key:value.

Self Hosted GitLab custom HTTP headers interface
Was this article helpful? or Suggest an improvement >

Related articles