# Setting up integration at global level

This section explains how to set up GitLab and SonarQube Server for global integration. To perform this setup, you need the global Administer System permission in SonarQube Server.

## Verifying the server base URL <a href="#verifying-server-url" id="verifying-server-url"></a>

You must configure your SonarQube Server base URL in SonarQube Server, otherwise, integration features will not work correctly. See [server-base-url](https://docs.sonarsource.com/sonarqube-server/2025.1/instance-administration/server-base-url "mention") for more information.

## Setting up the import of GitLab repositories <a href="#repos-import" id="repos-import"></a>

With this setup, users will be able to import GitLab repositories into SonarQube Server. See [importing-repos](https://docs.sonarsource.com/sonarqube-server/2025.1/devops-platform-integration/gitlab-integration/importing-repos "mention") for more details.

This integration is performed through a "GitLab Configuration" record, which is used in SonarQube Server to access the GitLab instance. You need the Administration System permission to set up a GitLab Configuration.

{% hint style="info" %}
Starting in [Enterprise Edition](https://www.sonarsource.com/plans-and-pricing/enterprise/), you can integrate SonarQube Server with multiple GitLab instances, each instance being accessed with a different GitLab Configuration.
{% endhint %}

To set up a GitLab Configuration in SonarQube Server:

1. In the SonarQube Server UI, go to **Administration > Configuration > General Settings > DevOps Platform Integrations**.
2. Select the **GitLab** tab and click **Create configuration**. The **Create a configuration** dialog opens.
3. Specify the following settings:
   * **Configuration Name** (Enterprise and Data Center Edition only): The name used to identify your GitLab configuration at the project level. Use something succinct and easily recognizable.
   * **GitLab URL**: The GitLab API URL. We recommend using `https://gitlab.com/api/v4`. You can also use your own GitLab server URL.
   * **Personal Access Token**: Token used to connect to the GitLab user account used to report the quality gate status to merge requests. See below.
4. Select Save configuration.

<details>

<summary>Providing a GitLab access token</summary>

To report the quality gate to the merge requests, you must provide a token. This token will be stored in SonarQube Server and can be revoked at any time in GitLab.

You can either provide:

* A [personal access token](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html).\
  We recommend using a dedicated GitLab account with at least Reporter [permissions](https://docs.gitlab.com/ee/user/permissions.html) (the account needs permission to leave comments). Use a personal access token from this account with the `api` scope authorized for the repositories you’re analyzing.
* Or a [Group Access Token](https://docs.gitlab.com/ee/user/group/settings/group_access_tokens.html) with at least the Reporter role and with the `api` scope.

If you want to enter the token in SonarQube Server in encrypted format, see [encrypting-settings](https://docs.sonarsource.com/sonarqube-server/2025.1/instance-administration/encrypting-settings "mention").

</details>

## Setting up user provisioning and authentication <a href="#authentication" id="authentication"></a>

See [setting-up](https://docs.sonarsource.com/sonarqube-server/2025.1/instance-administration/authentication/gitlab/setting-up "mention").
