Hi! 👋 We are doing a big documentation refresh. Help us improve - what's missing or could be better? Let us know! Join the Discord channel or simply send an email!
Learn how to integrate CodeRabbit with your self-managed GitLab instance through automated or manual onboarding, including OAuth setup, user configuration, and webhook installation.
Version RequirementsCodeRabbit supports GitLab 16.x and above. Version 15.x may experience unexpected issues such as review comments not being posted or the sign-up process not working at all. We recommend upgrading your GitLab instance to obtain the intended experience.
To integrate your self-managed GitLab with CodeRabbit, we require specific information for the initial setup within your domain. Once this setup is complete, you can log in directly using the OAuth2 flow.
Enter the URL of your self-managed GitLab instance and click Submit. We’ll check our database for an existing record of your organization and start the login process if found.If your self-managed GitLab instance is not found, we’ll initiate the onboarding process.
3
Choose onboarding method
You can choose between automated or manual onboarding based on your security
preferences and administrative access.
Why do we need the Admin Access Token?The admin access token is required to set up a new CodeRabbit bot user within your self-managed instance. The token is needed only once during the initial setup process. Once generated, you can set its minimum expiration period. This is the standard approach used by other products in this category.Note: This does not automatically install the CodeRabbit app across all projects. You will add CodeRabbit manually to the projects you wish to integrate.
This feature will work with any user from your organization, but we strongly recommend creating a dedicated user called CodeRabbitAI. This ensures clarity about which user is used for our application and allows for better fine-grained access control.
1
Create the user
Log in with an instance admin account and follow the steps provided in the
GitLab
documentation
to create a new user.
2
Retrieve user information
After the user is created, retrieve the User ID from that user’s profile.
3
Generate access token
Generate an access token for this
user. The access token is used to post reviews on merge requests.
Recommendations for the CodeRabbit user: - Use “CodeRabbitAI” as the
username for easy identification - Use the CodeRabbit
logo as the profile picture for easy
recognition - Ensure the user has appropriate permissions for the repositories
you want to integrate
If you prefer, you can create a Group Access Token which will create a
dedicated user on your behalf. For more information, see Group Access
Token.
For self-managed GitLab, we recommend creating an instance-wide application unless you want the reviews to be limited to a single group or user.Follow the steps outlined in the GitLab documentation for creating the application.
Use this flow when you need to install the webhook manually or rotate the shared webhook secret. The Webhook Secret page is available for both GitLab.com and self-managed GitLab.
1
Open Webhook Secret settings
In the CodeRabbit app, open Account and select Webhook Secret from the sidebar.
2
Copy the webhook URL
Use the Webhook URL field on that page to copy the exact endpoint that your GitLab instance should call.
3
Save or change the webhook secret
Enter the secret that GitLab should send with webhook deliveries and save it in CodeRabbit.
4
Configure the GitLab webhook
When creating or editing the webhook in GitLab, use the copied webhook URL and enable these settings:
Merge request events
Comments
Issues events
SSL verification enabled
If you change an existing webhook secret, CodeRabbit attempts to update existing CodeRabbit-managed GitLab project and group webhooks automatically. If a webhook was created manually, or if an automatic refresh fails, update the secret directly in GitLab.
By default, CodeRabbit clones your GitLab projects over HTTPS. If HTTPS is not available or your organization prefers SSH for repository access, you can configure SSH clone credentials in the CodeRabbit web app.
An SSH key pair generated without a passphrase. CodeRabbit cannot use passphrase-protected keys.
The public key must be registered on the GitLab account used by CodeRabbit under Edit profile → SSH Keys. GitLab will deny SSH access if the public key is not registered!See the GitLab documentation on SSH keys.
Navigate to app.coderabbit.ai and log in with your self-managed GitLab account.
2
Open account settings
In the left navigation menu, click Account at the bottom.
3
Navigate to SSH Clone Credentials
In the left navigation of the Account page, under Developer settings, click SSH Clone Credentials.
4
Enter your SSH credentials
Fill in the fields as required for your setup:
Field
Required
Description
SSH Private Key
Yes
The private key used to authenticate with your GitLab instance. Must be generated without a passphrase.
SSH Public Key
Recommended
The corresponding public key. Providing it allows CodeRabbit to verify the key pair.
SSH Port
Optional
Custom SSH port if your GitLab instance does not use the default port 22.
known_hosts
Optional
Contents of a known_hosts file for your GitLab host. Helps prevent man-in-the-middle warnings on first connection.
For most setups, providing the SSH Private Key and SSH Public Key is sufficient.
To avoid common copy-paste problems, use pbcopy (macOS) or xclip (Linux) to copy each key file to your clipboard, then paste directly into the corresponding field.
5
Save your credentials
Click Save to apply the SSH clone credentials. CodeRabbit will attempt SSH cloning using these credentials for your self-managed GitLab repositories. If SSH credentials cannot be decrypted or are invalid, cloning falls back to HTTPS.
After the initial setup, you can return to this page to update individual fields without re-entering all credentials.