> For the complete documentation index, see [llms.txt](https://docs.sonarsource.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sonarsource.com/sonarqube-server/2026.2/project-administration/creating-project/bitbucket-data-center/import-repos.md).

# Importing your Bitbucket Data Center repository

Creating your project by importing your Bitbucket Data Center repository in SonarQube Server 2026.2.

Once the integration of your SonarQube instance with Bitbucket Data Center has been properly set up, you can import a Bitbucket 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 repository. With a bound project:

* The project’s main branch name will be automatically set up from Bitbucket.
* The quality gate status report to the pull requests will be automatically set up.

{% hint style="info" %}
Starting in[ Enterprise Edition](https://www.sonarsource.com/plans-and-pricing/enterprise/), you can import a Bitbucket monorepo. See [Managing monorepo projects](/sonarqube-server/2026.2/project-administration/monorepos.md).
{% endhint %}

## Step 1: Create a Personal Access Token

You must provide a Bitbucket Data Center [Personal Access Token](https://confluence.atlassian.com/bitbucketserver0717/personal-access-tokens-1087535496.html) with `Read` permissions for both projects and repositories. This token will be stored in SonarQube and can be revoked at any time in bitbucket. SonarQube will use this token to access and list your Bitbucket projects and repositories. Copy it (you will have to paste it during Step 2). You cannot encrypt this token. SonarQube stores it as a personal credential, not as a system property.

## Step 2: Import one or several Bitbucket repositories

1. Go to **Projects**.
2. Select **Create Project > From Bitbucket Server**. The Bitbucket project onboarding page opens.
3. In **Personal Access Token**, enter the PAT you created in Step 1 and select **Save**. The projects and repositories to which the PAT has access are listed on the page.
4. Select one or several repositories to be imported and follow the instructions.

## Related pages

[Binding to Bitbucket Data Center](/sonarqube-server/2026.2/instance-administration/devops-platforms/bitbucket-data-center.md)\
[Configuring Bitbucket Data Center project binding](/sonarqube-server/2026.2/project-administration/creating-project/bitbucket-data-center/configure-binding.md)\
[Sensitive settings](/sonarqube-server/2026.2/instance-administration/security/encrypting-settings.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.sonarsource.com/sonarqube-server/2026.2/project-administration/creating-project/bitbucket-data-center/import-repos.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
