DigitalOcean exposes a REST API v2 for managing Droplets, App Platform, databases, Spaces, Kubernetes, domains, load balancers, firewalls, and more. Authentication uses personal access tokens (Bearer). The platform is built for simplicity and predictable pricing — ideal for solo developers and small teams who want AWS-like capabilities without the complexity. Spaces is S3-compatible; doctl is the official CLI; Node.js developers use the AWS SDK with Spaces or community libraries for the main API.
| Field | Value |
|---|---|
| Title | DigitalOcean API — Capabilities, Usage, and Building Guide |
| Author/Source | DigitalOcean (docs.digitalocean.com, digitalocean.com) |
| Date Downloaded | 2026-03-03 |
| Tags | digitalocean, cloud-api, vps, droplets, kubernetes, app-platform, s3 |
DigitalOcean exposes a REST API v2 for managing Droplets, App Platform, databases, Spaces, Kubernetes, domains, load balancers, firewalls, and more. Authentication uses personal access tokens (Bearer). The platform is built for simplicity and predictable pricing — ideal for solo developers and small teams who want AWS-like capabilities without the complexity. Spaces is S3-compatible; doctl is the official CLI; Node.js developers use the AWS SDK with Spaces or community libraries for the main API.
"Keep your tokens secret. They function like passwords. Do not hard code your tokens into programs where they may accidentally be released in version control and are harder to rotate. Instead, use environment variables."
— DigitalOcean API Documentation [1]
"The Spaces API is interoperable with the AWS S3 API, meaning you can use existing S3 tools and libraries with it."
— DigitalOcean Docs [2]
"App Platform is a fully managed Platform-as-a-Service (PaaS) that deploys applications from Git repositories or container images. It automatically builds, deploys, and scales components while handling all underlying infrastructure."
— DigitalOcean App Platform Docs [3]
"DigitalOcean Droplets are often praised for their simplicity and developer-friendly interface, making them a great choice for individuals and small to medium-sized businesses. AWS EC2 offers a wider range of instance types and services, which can be more suitable for large enterprises with complex requirements. In terms of pricing, DigitalOcean is generally more affordable for comparable resources."
— DigitalOcean Pricing FAQ [4]
"doctl does not support the DigitalOcean Spaces API. However, because the Spaces API is S3-compatible, you can use S3-compatible command line tools like s3cmd to manage Spaces."
— DigitalOcean doctl Docs [5]
DigitalOcean's API is straightforward: REST v2, bearer token auth, and well-documented endpoints for everything from spinning up Droplets to managing Kubernetes. The platform leans into predictability — flat monthly pricing, simple resource model, no hidden fees. For a solo dev or small team, it's a sweet spot between the bare-metal chaos of DIY VPS and the overwhelming breadth of AWS. Spaces is basically S3 — use the AWS SDK. App Platform deploys from Git or Docker; you can define apps in YAML and push via API or doctl. Managed databases (Postgres, MySQL, MongoDB, Valkey, etc.) start around $15/mo. The main gotchas: doctl doesn't do Spaces (use s3cmd or the AWS SDK), rate limits exist (doctl auto-retries on 429), and custom token scopes mean you can't edit scope after creation. Overall, it's a strong fit for static sites, side projects, and small production workloads — especially if you value simplicity and predictable bills.
https://api.digitalocean.com/v2. All resources (Droplets, apps, databases, etc.) use conventional HTTP requests with JSON [1][6].Authorization: Bearer . Custom scopes allow granular permissions (droplet:create, database:read, app:update, etc.). Token scopes cannot be edited after creation [1].--http-retry-max or DIGITALOCEAN_HTTP_RETRY_MAX [5]./v2/droplets, /v2/sizes (plans), /v2/images. Resize, snapshot, destroy via actions [6][7]./v2/databases. Daily backups, VPC, HA with standby nodes [9][10]./v2/kubernetes [12].brew install doctl. Supports Droplets, K8s, apps, databases, firewalls, load balancers, domains. Does not support Spaces [5].@aws-sdk/client-s3 for Spaces. For main API, use axios/fetch with token or community packages like digitalocean on npm.https://api.digitalocean.com/v2application/jsonAuthorization: Bearer droplet:create, app:read, database:delete)--http-retry-max or DIGITALOCEAN_HTTP_RETRY_MAX (set 0 to disable) [5]---
| Endpoint | Method | Description |
|---|---|---|
/v2/droplets | GET | List droplets |
/v2/droplets | POST | Create droplet |
/v2/droplets/:id | GET, DELETE | Get or destroy droplet |
/v2/droplets/:id/actions | POST | Resize, reboot, power, snapshot |
/v2/sizes | GET | List Droplet plans |
/v2/images | GET | List base images (Ubuntu, Docker, etc.) |
| Plan | RAM | vCPU | SSD | $/mo |
|---|---|---|---|---|
| Basic 512MB | 512 MiB | 1 | 10 GiB | $4 |
| Basic 1GB | 1 GiB | 1 | 25 GiB | $6 |
| Basic 2GB | 2 GiB | 1 | 50 GiB | $12 |
Bandwidth: free outbound (500–11,000 GiB depending on plan); overage $0.01/GiB. Inbound free [7].
Gotchas---
| Endpoint | Method | Description |
|---|---|---|
/v2/apps | GET, POST | List or create apps |
/v2/apps/:id | GET, PUT, DELETE | Get, update, delete app |
/v2/apps/:id/deployments | GET, POST | List or trigger deployments |
| Plan | CPUs | RAM | $/mo |
|---|---|---|---|
| Free static | — | — | $0 (3 apps, 1 GiB transfer each) |
| apps-s-1vcpu-0.5gb | 1 shared | 512 MiB | $5 |
| apps-s-1vcpu-1gb | 1 shared | 1 GiB | $12 |
| apps-d-1vcpu-1gb (dedicated) | 1 dedicated | 1 GiB | $34 |
xl-build flag deprecated [3][8]---
PostgreSQL, MySQL, MongoDB, Valkey (Redis-compatible), Kafka, OpenSearch
Key Endpoints| Endpoint | Method | Description |
|---|---|---|
/v2/databases | GET, POST | List or create clusters |
/v2/databases/:id | GET, DELETE | Get or destroy cluster |
/v2/databases/:id/users | GET, POST | Manage users |
/v2/databases/:id/dbs | GET, POST | Manage databases |
| Engine | Smallest Plan | $/mo |
|---|---|---|
| PostgreSQL/MySQL | 1 vCPU, 1 GiB | ~$15 |
| Valkey | 1 vCPU, 1 GiB | $15 |
| MongoDB | 1 vCPU, 1 GiB | ~$15 |
| OpenSearch | 1 vCPU, 2 GiB | ~$20 |
Storage: $0.215/GiB/mo (varies by engine)
Gotchas---
@aws-sdk/client-s3) or s3cmdhttps://.digitaloceanspaces.com | Item | Cost |
|---|---|
| Base subscription | $5/mo |
| Included storage | 250 GiB |
| Extra storage | $0.02/GiB/mo |
| Included bandwidth | 1,024 GiB |
| Overage bandwidth | $0.01/GiB |
CDN included. Same-region Droplet → Spaces transfer free for some region pairs [11].
Gotchas---
| Endpoint | Method | Description |
|---|---|---|
/v2/kubernetes/clusters | GET, POST | List or create clusters |
/v2/kubernetes/clusters/:id | GET, PUT, DELETE | Manage cluster |
/v2/kubernetes/options | GET | Node sizes, versions |
---
| Endpoint | Method | Description |
|---|---|---|
/v2/domains | GET, POST | List or add domains |
/v2/domains/:name/records | GET, POST | List or create DNS records |
/v2/domains/:name/records/:id | GET, PUT, DELETE | Manage record |
---
/v2/load_balancers/v2/firewalls---
---
brew install doctl (macOS)doctl auth initcompute, apps, databases, kubernetes, vpcs, etc.github.com/digitalocean/godo (official)axios/fetch or community digitalocean npm package@aws-sdk/client-s3 with custom endpoint---
| Product | Starting Price | Notes |
|---|---|---|
| Droplets | $4/mo | Per-second billing, 60s min |
| App Platform | $0 (static) | 3 free static sites |
| App Platform (paid) | $5/mo | Per component |
| Managed Databases | $15/mo | Postgres, MySQL, Valkey |
| Spaces | $5/mo | 250 GiB, 1,024 GiB transfer |
| Kubernetes | $12/mo | Worker nodes only |
| Load Balancers | $12/mo | — |
| Backups | 20–30% of Droplet | Weekly or daily |
| Bandwidth overage | $0.01/GiB | Across products |
---
| Aspect | DigitalOcean | AWS / GCP |
|---|---|---|
| Learning curve | Low | High |
| Pricing model | Flat, predictable | Complex, many variables |
| Service breadth | Focused (VMs, DB, K8s, storage) | Very broad |
| Ideal for | Solo devs, startups, side projects | Enterprises, complex workloads |
| API simplicity | REST v2, straightforward | Multiple APIs, SDK-heavy |
| Support | Community, paid tiers | Enterprise support available |
---
droplet:create only for provisioning scripts.---
static_sites component, github repo, source_dir, output_dir (e.g., build).POST /v2/apps with the spec.POST /v2/apps/:id/deployments.aws s3 sync build/ s3://bucket-name/ (or AWS SDK).---
POST /v2/droplets with: - image: docker-24-04 or docker-24-04-x64 (Docker 1-Click image)
- size: e.g., s-1vcpu-1gb
- region, name, ssh_keys
/v2/droplets/:id or use actions API.user_data to install Docker, run docker-compose, etc.Alternatively, use a standard Ubuntu image and provide user_data with Docker install script.
---