# How do I configure Portainer's GitOps features to authenticate to a Bitbucket repository?

{% hint style="info" %}
The following instructions acknowledge that Bitbucket has announced the [deprecation of app passwords in Bitbucket Cloud](https://www.atlassian.com/blog/bitbucket/bitbucket-cloud-transitions-to-api-tokens-enhancing-security-with-app-password-deprecation).
{% endhint %}

When deploying a stack from a private Bitbucket repository, the authentication method will differ depending on how your bitbucket is hosted.

* **Bitbucket cloud:** Use an [**API token**](https://support.atlassian.com/bitbucket-cloud/docs/api-tokens/) or [**access token**](https://support.atlassian.com/bitbucket-cloud/docs/access-tokens/) with **basic authentication**.
* **Bitbucket Data Center:** Use a [**Personal Access Token**](https://confluence.atlassian.com/bitbucketserver/http-access-tokens-939515499.html) with **bearer token authentication.**


---

# 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.portainer.io/sts/faqs/troubleshooting/stacks-deployments-and-updates/how-do-i-configure-portainers-gitops-features-to-authenticate-to-a-bitbucket-repository.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.
