# Bitbucket

> Part of the NocoDB documentation (Product docs > Sync > App Sync > On Premise Auth Integration). Index of all pages: https://nocodb.com/llms.txt. Any docs page is available as Markdown by adding `.md` to its URL.

URL: https://nocodb.com/docs/product/sync/app-sync/on-premise-oauth/bitbucket
Last updated: 2026-10-03

Set up the Bitbucket OAuth2 authentication integration for a self-hosted NocoDB instance.

This document tells you how to set up the Bitbucket authentication integration for NocoDB.

## Environment Variables

To enable OAuth2 authentication with Bitbucket, configure these environment variables.

## Step 1: Create a Bitbucket OAuth Consumer

1. Log in to your Bitbucket account.

2. Go to Bitbucket Administration **Workspace settings → OAuth consumers**.
   * (Bitbucket → left sidebar → click your workspace → **Workspace settings** → **OAuth consumers**)

3. Click **“Add consumer”**.

4. Fill in the form:

   | Field            | Value                                                                                                                |
   | ---------------- | -------------------------------------------------------------------------------------------------------------------- |
   | **Name**         | Your application name (for example, "NocoDB")                                                                        |
   | **Description**  | A short description of your application                                                                              |
   | **Callback URL** | `https://your-nocodb-instance.com/`                                                                                  |
   | **Permissions**  | Enable: **Repositories**: Read & Write, **Pull requests**: Read & Write, **Issues**: Read & Write, **Account**: Read |

5. Click **Save**.

## Step 2: Get Client ID and Client Secret

After you create your OAuth consumer:

1. Bitbucket shows these values:

   | Bitbucket value | Use as        |
   | --------------- | ------------- |
   | **Key**         | Client ID     |
   | **Secret**      | Client Secret |

2. Copy both values. Bitbucket shows the Secret **only once**.

3. Keep them in a safe place for the configuration.

## Step 3: Set Environment Variables

Configure your NocoDB instance with these variables:

```
INTEGRATION_AUTH_BITBUCKET_CLIENT_ID=your_bitbucket_client_id
INTEGRATION_AUTH_BITBUCKET_CLIENT_SECRET=your_bitbucket_client_secret
INTEGRATION_AUTH_BITBUCKET_REDIRECT_URI=your_redirect_uri
```

Where:

| Variable value                 | Description                                                                               |
| ------------------------------ | ----------------------------------------------------------------------------------------- |
| `your_bitbucket_client_id`     | The **Key (Client ID)** from Bitbucket                                                    |
| `your_bitbucket_client_secret` | The **Secret (Client Secret)**                                                            |
| `your_redirect_uri`            | The callback URL of the OAuth consumer (for example, `https://your-nocodb-instance.com/`) |

## OAuth Scopes Requested

The integration requests these Bitbucket scopes:

* `repository`
* `repository:write`
* `pullrequest`
* `pullrequest:write`
* `issue`
* `issue:write`
* `account`

These permissions let NocoDB read and write repositories, issues, and pull requests as necessary.

## Availability

* App Sync is available on **NocoDB Cloud** (Plus plan and above) and licensed self-hosted deployments (Business plan and above). This page covers OAuth app setup for **self-hosted** deployments. On NocoDB Cloud, these OAuth apps are preconfigured.

---

## Related pages

- [GitHub](https://nocodb.com/docs/product/sync/app-sync/on-premise-oauth/github.md): Set up the GitHub OAuth2 or GitHub App authentication integration for a self-hosted NocoDB instance.
- [GitLab](https://nocodb.com/docs/product/sync/app-sync/on-premise-oauth/gitlab.md): Set up the GitLab OAuth2 authentication integration for a self-hosted NocoDB instance.
- [Google Calendar](https://nocodb.com/docs/product/sync/app-sync/on-premise-oauth/google-calendar.md): Set up the Google Calendar OAuth2 authentication integration for a self-hosted NocoDB instance.
- [Linear](https://nocodb.com/docs/product/sync/app-sync/on-premise-oauth/linear.md): Set up the Linear OAuth2 authentication integration for a self-hosted NocoDB instance.
- [Outlook Calendar](https://nocodb.com/docs/product/sync/app-sync/on-premise-oauth/outlook-calendar.md): Set up the Outlook Calendar OAuth2 authentication integration for a self-hosted NocoDB instance.
