# Bitbucket Server & Datacenter

## Overview

Arnica Integrates directly with Bitbucket Sever to help secure the development environment while identifying risks in real time - alerting your team and assisting with remediation actions. Arnica's integration is configurable allowing org-level provisioning or access to specified projects to extract the [necessary data](/arnica-documentation/security/data-handling.md) and take remediation actions.

## Integrating with Bitbucket Server / Bitbucket Data Center

### Allowing users to specify custom expiry settings

To ensure continuous connection to your Bitbucket Server / Data Center, we recommend you create a token without an automatic expiration date. Bitbucket Server / Data Center may be configured to enforce all tokens to expire after no longer than 1 year. To allow customizing it, follow these steps: \\

1. Go to Administration
2. Go to SYSTEM -> Keys and Tokens
3. Select No for automatic expiry.

<figure><img src="/files/m3VTdk0bubGYYosJCEOP" alt=""><figcaption></figcaption></figure>

### Creating an HTTP access token

1. Click on your profile picture on the right
2. Select Manage Account
3. Under HTTP access tokens, select Create token.
4. For the best compatibility, select Project Admin, this will allow Arnica to help you follow security best practices and keep your Bitbucket service protected on an ongoing basis including the ability to have one click mitigations.
5. For Expiry, in order to avoid service disruption, select Do not expire, or set an expiry date and set a reminder to your team to update the Arnica integration details 2 weeks before expiration.
6. Copy the token and store in a safe place (e.g., a password manager, secrets vault, HSM)

### Adding a Bitbucket Server / Data Center integration

1. Click CONNECT next to Bitbucket Server / Data Center

<figure><img src="/files/Z2V22f1XtzXcOl0s0pcZ" alt=""><figcaption></figcaption></figure>

3. Fill in the details of your integration.
   * Name – enter a short unique name to help you identify this sever.
   * Bitbucket Server URL – the full URL of your server.
   * PAT: the HTTP Access Token you generated on step 9 above.

<figure><img src="/files/LZBnIBdX24UGR7MsuN0M" alt=""><figcaption></figcaption></figure>

4. Click CREATE


---

# 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.arnica.io/arnica-documentation/getting-started/scm-integrations/bitbucket-server-and-datacenter.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.
