Start Free
SonarQube Community Build | DevOps platform integration | Bitbucket integration | Bitbucket Server & Data Center

Bitbucket Server and Bitbucket Data Center integration

On this page

SonarQube's integration with Bitbucket Server or Bitbucket Data Center allows you to maintain code quality and security in your Bitbucket Server / Data Center repositories.

With this integration, you'll be able to:

  • Import your BitBucket Community Build or Data Center repositories: Import your Bitbucket Server or Data Center repositories into SonarQube to easily set up SonarQube projects.

Prerequisites

You've set a SonarQube Community Build base URL in SonarQube Community Build: see Configuring the SonarQube Community Build base URL.

Importing your Bitbucket Server repositories into SonarQube Community Build

Setting up the import of BitBucket Server or Data Center repositories into SonarQube Community Build allows you to easily create SonarQube Community Build projects from your Bitbucket Server or Data Center repositories. 

To set up the import of BitBucket Server or Data Center repositories:

  1. Set your global DevOps Platform integration settings
  2. Add a personal access token for importing repositories

Setting your global DevOps platform integration settings

To set your global DevOps Platform Integration settings, navigate to Administration > Configuration > General Settings > DevOps Platform Integrations, select the Bitbucket tab, and select Bitbucket Server as the variant you want to configure. From here, specify the following settings:

  • Bitbucket Server URL: your Server or Data Center instance URL. For example, https://bitbucket-server.your-company.com.
  • Personal Access Token: A Bitbucket Server or Data Center user account for the integration. We recommend using a dedicated Bitbucket Server / Data Center account with Administrator permissions. You need a Personal Access Token from this account with Read permission for the repositories that will be analyzed. Administrators can encrypt this token: see Encrypting sensitive settings for more information. 

Adding a personal access token for importing repositories

After setting your global settings, you can add a project from Bitbucket Server or Data Center by clicking the Add project button in the upper-right corner of the Projects homepage and selecting Bitbucket.

Then, you'll be asked to provide a personal access token from your user account with Read permissions for both projects and repositories. This token will be stored in SonarQube Community Build and can be revoked at any time in Bitbucket Server or Data Center.

After saving your personal access token, you'll see a list of your Bitbucket Server or Data Center projects that you can set up and add to SonarQube Community Build. 


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