> ## Documentation Index
> Fetch the complete documentation index at: https://docs.startmyvpn.com/llms.txt
> Use this file to discover all available pages before exploring further.

# DigitalOcean

> Connect your DigitalOcean account to deploy VPN servers from the admin panel.

## Prerequisites

* A [DigitalOcean](https://www.digitalocean.com) account
* A Personal Access Token with **write** scope

## 1. Generate an API token

1. Log into your DigitalOcean account
2. Go to **API → Tokens**
3. Click **Generate New Token**
4. Give it a name (e.g. `StartMyVPN`)
5. Select **Read** and **Write** scopes
6. Copy the token — it will only be shown once

## 2. Configure in StartMyVPN

Set the token in `.env`:

```ini theme={null}
DIGITALOCEAN_TOKEN=your_token_here
```

Or navigate to **Admin → Settings** and enter it in the DigitalOcean section.

## 3. Deploy a VPN server

1. Navigate to **Admin → Deployments → DigitalOcean**
2. Select a **region** (e.g. `nyc3`, `lon1`, `sgp1`)
3. Choose a **droplet size** — see sizing guide below
4. Select the **VPN protocol** (OpenVPN or WireGuard)
5. Click **Deploy** — the droplet is created and provisioning begins automatically

The deployment job runs in the background. You can monitor progress in the server details page.

## Recommended droplet sizes

| Users     | Droplet Size          | vCPU | RAM  |
| --------- | --------------------- | ---- | ---- |
| Up to 50  | `s-1vcpu-1gb`         | 1    | 1 GB |
| Up to 200 | `s-2vcpu-2gb`         | 2    | 2 GB |
| Up to 500 | `s-2vcpu-4gb`         | 2    | 4 GB |
| 500+      | `c-4` (CPU-optimized) | 4    | 8 GB |

## Regions

DigitalOcean regions are automatically synced when you visit the deployment page. To force a refresh:

```bash theme={null}
php artisan digitalocean:sync-regions
```

## Rate limiting

StartMyVPN respects DigitalOcean's API rate limits (5,000 requests/hour). Rate limit state is tracked internally and the app will back off automatically if the limit is approached.

## Billing

DigitalOcean droplets are billed to your DigitalOcean account independently of StartMyVPN subscriptions. Monitor your DigitalOcean billing dashboard for infrastructure costs.
