# Importing Bitbucket Cloud repositories

Once the integration of your SonarQube instance with Bitbucket Cloud has been properly set up, you can import a Bitbucket Cloud repository to create the corresponding project in SonarQube. To do so, you need the Create Project permission in SonarQube.

The so-created SonarQube project is "bound" to its Bitbucket Cloud repository. With a bound project:

* The project’s main branch name will be automatically set up from Bitbucket.

### Step 1: Create an API token

You must provide a Bitbucket Cloud [API token](https://support.atlassian.com/bitbucket-cloud/docs/api-tokens/). Your API token needs the  read:repository:bitbucket  scope (Read permission for the repositories).  To avoid exceeding[ Bitbucket Cloud API rate limits](https://support.atlassian.com/bitbucket-cloud/docs/api-request-limits/), it is recommended to use a dedicated Bitbucket user for SonarQube integration.

{% hint style="warning" %}
Bitbucket's API tokens replace the App passwords which are deprecated. See the[ Bitbucket documentation](https://www.atlassian.com/blog/bitbucket/bitbucket-cloud-transitions-to-api-tokens-enhancing-security-with-app-password-deprecation) for more details.
{% endhint %}

### Step 2: Import one or several repositories

1. In the top right corner, select **Create Project > From Bitbucket Cloud**. The Bitbucket Cloud project onboarding page opens.
2. In the top navigation bar of SonarQube, select the **Projects** tab.

<figure><img src="broken-reference" alt="The first time you import a Bitbucket Cloud repository into SonarQube, you must enter a username and an App password."><figcaption></figcaption></figure>

3. In **Bitbucket user name**, enter your email address.
4. In **App password**, enter the API token you created in Step 1.
5. Select **Save**. The projects and repositories to which the PAT has access are listed on the page.
6. Select one or several repositories to be imported and follow the instructions.

### Related pages

[global](https://docs.sonarsource.com/sonarqube-community-build/devops-platform-integration/bitbucket-integration/bitbucket-cloud-integration/global "mention")\
[bitbucket-pipelines](https://docs.sonarsource.com/sonarqube-community-build/devops-platform-integration/bitbucket-integration/bitbucket-cloud-integration/bitbucket-pipelines "mention")\
[troubleshooting](https://docs.sonarsource.com/sonarqube-community-build/devops-platform-integration/bitbucket-integration/bitbucket-cloud-integration/troubleshooting "mention")
