- Automated code reviews for newly created pull requests
- Intelligent comments and suggestions displayed directly on pull requests
- Real-time bot interaction for immediate feedback and assistance
- Seamless webhook integration for continuous monitoring
@coderabbitai â or the username of the bot user you create below, if it differs.Prerequisites
Before starting, you need to set up the following in your Bitbucket Data Center instance:Create a bot user
- Add the bot user to each project where you want CodeRabbit to review pull requests
- Grant the bot user write permissions on the relevant repositories
Generate an HTTP Access Token for the bot user
- Log in as the bot user
- Navigate to Manage Account and select HTTP Access Tokens
- Create a new token with project read and repository write permissions
Create an OAuth consumer
- Navigate to Administration and then Application Links
- Create a new External application with an Incoming link
- Set the Redirect URL to:
https://app.coderabbit.ai/login - Grant the following permissions:
- Repository Read
- Repository Write
- Project Admin
- Note the Client ID and Client Secret
Connect to CodeRabbit
Navigate to the CodeRabbit login page
Enter your Bitbucket Data Center URL
https://bitbucket.company.com) and click Submit.If your instance is already registered, you will be redirected to the OAuth authorization flow. Otherwise, you will be prompted to provide your credentials.Provide credentials
- Bot Token: The HTTP Access Token you generated for the bot user
- Client ID: The OAuth consumer Client ID
- Client Secret: The OAuth consumer Client Secret
Authorize CodeRabbit
Install CodeRabbit on your repositories
After logging in, the onboarding wizard guides you through selecting projects and repositories.Select a project
Select repositories
- Browse or search for repositories within the selected project
- Select the repositories where you want to enable AI code reviews
- Click Install to complete the setup
Configure network access
CodeRabbit can connect directly to a reachable Bitbucket Data Center instance or through an operator-provisioned CodeRabbit Reverse Tunnel. For a private instance with no public endpoint, contact CodeRabbit Support or Sales to provision the tunnel and connector before onboarding. For a tunnel connection, enter your canonical Bitbucket Data Center URL on the login page and provide the bot token and OAuth credentials when prompted. CodeRabbit validates credentials and makes API requests through the provisioned tunnel. Keep the connector connected during setup. Your browser must still reach the canonical Bitbucket URL for OAuth authorization, and Bitbucket must be able to send outbound HTTPS webhooks to CodeRabbit. Credential updates preserve the provisioned route; contact Support to change the route. If you connect directly and your Bitbucket Data Center instance requires IP allowlisting, add these CodeRabbit IP addresses:Manage credentials
You can update the bot userâs HTTP Access Token at any time:- Navigate to Organization Settings in the CodeRabbit app
- Select the Bitbucket DC User tab
- Enter the new HTTP Access Token
- Save your changes
Manual webhook installation
If you install repositories from the CodeRabbit app, CodeRabbit configures the webhook automatically. Use this flow only when you need to install the webhook manually or rotate the shared webhook secret. The Webhook Secret page is available to Bitbucket Data Center organizations with organization settings access.Open Webhook Secret settings
Copy the webhook URL
Save or change the webhook secret
Configure the Bitbucket Data Center webhook
- Opened
- Modified
- Comment Added
- Approved
- Changes Requested (shown as Needs Work on older Bitbucket Server versions)
- Unapproved
- Updated
BITBUCKET_SERVER_WEBHOOK_SECRET aligned with the secret configured in CodeRabbit; see the Bitbucket Data Center self-hosted .env file.
Troubleshooting
Bot token validation fails
Bot token validation fails
- Verify the HTTP Access Token has the correct permissions (project read and repository write)
- Ensure the bot user account is active and not locked
- Check that your Bitbucket Data Center URL is correct and reachable through the configured connection: directly from CodeRabbit, or through the provisioned reverse tunnel
- For a reverse tunnel, verify that the connector is connected and can reach Bitbucket Data Center inside your network
Webhooks not working
Webhooks not working
- Ensure your Bitbucket Data Center instance can reach CodeRabbitâs servers
- Check webhook configurations in your repository settings
- Verify the bot user has write access to the repositories
Webhook secret mismatch
Webhook secret mismatch
- Confirm the webhook secret in Bitbucket Data Center matches the value saved on CodeRabbitâs Webhook Secret page
- Update manually created webhooks directly in Bitbucket Data Center after rotating the secret
- Review skipped or failed refreshes reported by CodeRabbit and update those repository webhooks directly
- For self-hosted deployments, confirm
BITBUCKET_SERVER_WEBHOOK_SECRETmatches the secret configured in CodeRabbit
Reviews not posting
Reviews not posting
- Confirm the bot user is added to the project with write permissions
- Verify the HTTP Access Token has not expired
- Check that webhooks are properly configured and active