# Bitbucket Cloud

SonarQube’s integration with Bitbucket Cloud allows you to maintain code quality and security in your Bitbucket Cloud repositories.

{% hint style="success" %}
To bind your SonarQube Server instance to Bitbucket Cloud, see [Binding to Bitbucket Cloud](/sonarqube-server/2026.2/instance-administration/devops-platforms/bitbucket-cloud.md).
{% endhint %}

### Key features

With this integration, you’ll be able to:

* Import your Bitbucket Cloud repositories: Import your Bitbucket Cloud repositories into SonarQube Server to easily set up SonarQube Server projects.
* Analyze projects with Bitbucket Pipelines: Integrate analysis into your build pipeline. SonarScanners running in Bitbucket Pipelines can automatically detect branches or pull requests being built so you don’t need to specifically pass them as parameters to the scanner.
* Report your quality gate status to your pull requests: See your quality gate and code metric results right in Bitbucket Cloud so you know if it’s safe to merge your changes.
* Authenticate with Bitbucket Cloud: Sign in to SonarQube Server with your Bitbucket Cloud credentials.

### Integration solution overview

Integration is performed at two levels:

* Global: Within your SonarQube Server instance, a “Bitbucket Cloud Configuration” record is used to manage the SonarQube Server access to your Bitbucket Cloud workspace. This record stores:
  * Your workspace ID.
  * The key and secret of a workspace’s OAuth consumer which is used by SonarQube Server to access your Bitbucket Cloud workspace, either to report the quality gate to pull requests on the repositories you’re analyzing or to import repositories.
* Project: A project administrator must provide a Bitbucket Cloud API token to import their Bitbucket Cloud repository to SonarQube Server. SonarQube stores this PAT in its database, enabling it to list and import the repositories the administrator can access.

<figure><img src="/spaces/KXW79zfYFiA8incTvwZK/files/4nuJGGmLZyLKkb5UQ111" alt="An OAuth consumer and an API token are used for SonarQube integration with Bitbucket Cloud"><figcaption></figcaption></figure>

For information about Bitbucket Cloud authentication solution, see [Bitbucket Cloud](/sonarqube-server/2026.2/instance-administration/authentication/bitbucket-cloud.md).

### Related pages <a href="#related-pages" id="related-pages"></a>

* [Binding to Bitbucket Cloud](/sonarqube-server/2026.2/instance-administration/devops-platforms/bitbucket-cloud.md)\
  This section explains how to set up the integration of your SonarQube Server instance with Bitbucket Cloud. You need the global Administer System permission in SonarQube to perform this setup.
* [Importing your Bitbucket Cloud repository](/sonarqube-server/2026.2/project-administration/creating-project/bitbucket-cloud/import-repos.md)\
  Once the integration of your SonarQube Server instance with Bitbucket Cloud has been properly set up, you can import a Bitbucket Cloud repository or monorepo to create the corresponding projects in SonarQube Server.
* [Configuring Bitbucket Cloud project binding](/sonarqube-server/2026.2/project-administration/creating-project/bitbucket-cloud/configure-binding.md)\
  This page explains how to set up pull request decoration and the blocking of pull requests in case of quality gate failure. You need the Administer permission on the project to perform this setup.
* [Bitbucket Pipelines](/sonarqube-server/2026.2/analyzing-source-code/ci-integration/bitbucket-pipelines.md)\
  Once you have created your project(s) in SonarQube Server, you can add the SonarQube Server analysis to your Bitbucket pipeline.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.sonarsource.com/sonarqube-server/2026.2/discovering/devops-platforms/bitbucket-cloud.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
