Start FreeLog in
SonarQube Cloud | Administering SonarQube Cloud | Creating and editing your organization | Importing GitLab group

Importing a GitLab group

On this page

When you import a GitLab group to SonarQube Cloud, the corresponding organization is created in SonarQube Cloud and is bound to the DevOps platform organization: each SonarQube Cloud organization corresponds one-to-one with a GitLab group. 

The user account you used for the import is automatically assigned to the organization’s Owners group which grants you administration rights on the organization. 

Prerequisites

You must be an owner of the GitLab group to be imported.

Step 1: Create a GitLab personal access token

SonarQube Cloud uses a GitLab user account to import your GitLab organization and repositories. You must provide a personal access token from this account (the personal access token will be stored in the respective SonarQube Cloud organization). We highly recommend that you use a dedicated technical user account in GitLab (the account must be an owner of the GitLab group).

To create a GitLab personal access token:

  1. Log in to GitLab (with the technical account mentioned above if applicable).
  2. Go to User settings > Personal Access Tokens (or select the Personal Access Token hyperlink).
  3. Select the api scope.
  4. Select the Create personal access token button.
  5. When the personal access token is displayed at the top of the page, copy the token (you will have to paste it into the field on the SonarQube Cloud setup page in Step 3 below).

Step 2: Retrieve the GitLab group key

If you want to import a GitLab group that is not your personal GitLab group, you will have to provide a group key. You can provide:

  • Either the ID of the group.
    The group ID can be found under the group name on the group page.
  • Or the key of the group.
    The group key is the last element in the path of the group and is found in the URL.
    For example, gitlab.com/my-group.

Step 3: Import the GitLab group

To import a GitLab group to SonarQube Cloud:

  1. Log in to SonarQube Cloud with any DevOps platform account or your SAML SSO account. If you don't use your GitLab account, see Importing organizations from multiple DevOps platforms for important insights.
  2. At the top right of the SonarQube Cloud interface, select the ✚ (plus) menu and select Create new organization. The Create an organization page opens.
  3. Under Import from a DevOps platform, select the GitLab button.
  4. Select either
    • Import any GitLab group, if you want to import a GitLab group other than your personal one, or
    • Import my personal GitLab group, if you want to import only the repositories that are under your personal namespace.
  5. In GitLab group key (if you don't import your personal GitLab group), enter the group key retrieved in Step 2.
  6. In Personal Access Token, paste the personal access token you created in Step 1.
  7. Select Continue.
  8. In Import organization details, SonarQube Cloud suggests a Name and Key for your SonarQube Cloud organization. The key is unique across all organizations within SonarQube Cloud. You can accept the suggestion or change it manually. The interface will prevent you from changing it to an already existing key. 
  9. Select Add additional info to add:
    • An avatar: a small image representing the organization and displayed on the UI near the organization name.
    • A description of the organization.
    • A URL: the URL of the homepage of the organization displayed on the UI.
  10. In Choose a plan, select the subscription plan for your organization.
  11. If you selected a paid plan, select the number of Lines of Code (LOC) for your plan and follow the instructions to enter your billing and payment information.
  12. Select Create Organization. The organization is created and opened in SonarQube Cloud.

Was this page helpful?

© 2008-2025 SonarSource SA. All rights reserved. SONAR, SONARSOURCE, SONARQUBE, and CLEAN AS YOU CODE are trademarks of SonarSource SA.

Creative Commons License