> For the complete documentation index, see [llms.txt](https://docs.octoxlabs.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.octoxlabs.com/adapters/d/digitalocean.md).

# DigitalOcean

DigitalOcean is a cloud infrastructure provider. OctoXLabs uses it to add the Droplets (virtual machines) of a team as devices, and optionally the Let's Encrypt and custom certificates managed in the account.

## Use cases

* List all Droplets with their operating system, vCPU and memory.

```
Adapters = digitalocean
```

* Find Droplets that your EDR does not cover.

```
Adapters = digitalocean AND NOT Adapters = falcon-crowdstrike
```

* Track certificate expiry for certificates stored in DigitalOcean (turn on Fetch Certificates Operation).

## Before you begin

### Network

| Source              | Destination            | Port | Protocol |
| ------------------- | ---------------------- | ---- | -------- |
| OctoXLabs connector | `api.digitalocean.com` | 443  | HTTPS    |

### Required permissions

| Scope or role                                | Permission | Needed for                |
| -------------------------------------------- | ---------- | ------------------------- |
| Personal access token scope **Read Only**    | Read       | Droplets and certificates |
| Or custom scopes `droplet` and `certificate` | Read       | Droplets and certificates |

Full Access is not required. A token belongs to one team and covers every project in that team. Create it in the team that owns the Droplets and certificates. Reference: [How to Create a Personal Access Token](https://docs.digitalocean.com/reference/api/create-personal-access-token/).

## Create credentials in DigitalOcean

{% stepper %}
{% step %}

### Switch to the right team

Log in to the DigitalOcean Control Panel and switch to the team whose resources you want to discover.
{% endstep %}

{% step %}

### Open the token page

Open **API** from the main menu, then find **Personal access tokens**.
{% endstep %}

{% step %}

### Generate the token

Click **Generate New Token** and enter a name, for example `octoxlabs-discovery`. Pick an expiration. The token stops working on that date.
{% endstep %}

{% step %}

### Select the scope

Select **Read Only**, or use **Custom Scopes** with read permission on `droplet` and `certificate`.
{% endstep %}

{% step %}

### Copy the token

Click **Generate Token** and copy the value. It is shown only once.
{% endstep %}
{% endstepper %}

## Connection parameters

| Parameter                    | Required | Type              | Default | Description                                            |
| ---------------------------- | -------- | ----------------- | ------- | ------------------------------------------------------ |
| Api Token                    | Yes      | String            | None    | DigitalOcean personal access token.                    |
| Fetch Devices Operation      | No       | Boolean           | `True`  | Collect Droplets as devices.                           |
| Fetch Certificates Operation | No       | Boolean           | `False` | Collect certificates (Let's Encrypt and custom).       |
| Per Page                     | No       | Integer           | `200`   | Records per API page. DigitalOcean caps a page at 200. |
| Proxy                        | No       | String            | None    | Proxy to reach `api.digitalocean.com`.                 |
| Timeout                      | No       | Integer (seconds) | `30`    | Time to wait for API responses.                        |

## Troubleshooting

| Error message                    | Cause                                 | Fix                                      |
| -------------------------------- | ------------------------------------- | ---------------------------------------- |
| `Max retries exceeded for <url>` | DigitalOcean kept answering HTTP 429. | Retry later or raise Per Page up to 200. |

## Change history

{% hint style="info" %}
Available starting from version 6.7.2.
{% endhint %}
