cheat-sheets

DigitalOcean

DigitalOcean offers simple, predictably priced Droplets (VPS), Spaces object storage, cloud firewalls, DNS and managed Kubernetes. Covers the doctl CLI and the billing details that matter for a homelab.

Documentation: doctl reference · Droplet pricing · Spaces pricing · Terraform DigitalOcean provider (see Terraform) Project: digitalocean/doctl

Verification: doctl syntax and pricing were checked against the DigitalOcean docs and the doctl README (November 2026). The CLI was not installed or run. Items marked (unverified) were not confirmed.

Services a Self-Hoster Uses #

NEEDSERVICENOTES
Virtual machineDropletBilled per second
FirewallCloud FirewallApplied by Droplet or tag
Extra diskVolumeBlock storage
Object storageSpacesS3-compatible
Snapshots and backupsSnapshots, BackupsBackups are a percentage surcharge
DNSDomainsFree DNS hosting for domains you point at DigitalOcean
KubernetesDOKSSee doctl kubernetes below
Container registryDOCRdoctl registry login

Authentication #

Create a personal access token in the control panel (API, Tokens). Treat it as a secret.

COMMANDDESCRIPTION
doctl auth initAuthenticate (prompts for the token)
doctl auth init --context <NAME>Save the token under a named context
doctl auth listList contexts
doctl auth switch --context <NAME>Switch context
doctl account getShow account details and limits
export DIGITALOCEAN_ACCESS_TOKEN=<TOKEN>Token via environment (applies to the default context only)

Droplets #

COMMANDDESCRIPTION
doctl compute droplet create <NAME> --region <REGION> --size <SIZE> --image <IMAGE>Create a Droplet
doctl compute droplet create <NAME> --region <REGION> --size <SIZE> --image <IMAGE> --ssh-keys <KEY_ID_OR_FINGERPRINT> --vpc-uuid <VPC_ID> --tag-name <TAG> --user-data-file <FILE> --enable-backupsCreate with options
doctl compute droplet listList Droplets
doctl compute ssh <DROPLET>SSH in
doctl compute droplet delete <ID_OR_NAME>Delete a Droplet (destroys its data)
doctl compute size listList sizes (unverified)
doctl compute region listList regions (unverified)

Snapshots #

COMMANDDESCRIPTION
doctl compute droplet-action snapshot <DROPLET_ID> --snapshot-name <NAME>Snapshot a Droplet
--enable-backups (on create)Weekly automatic backups

Snapshots and backups stay in DigitalOcean, so they are not an off-site copy. Use restic or BorgBackup elsewhere too.

Firewalls #

COMMANDDESCRIPTION
doctl compute firewall create --name <NAME> --inbound-rules "protocol:tcp,ports:22,address:203.0.113.10/32" --outbound-rules "protocol:tcp,ports:443,address:0.0.0.0/0" --tag-names <TAG>Create a firewall applied to tagged Droplets (use --droplet-ids to target Droplets directly)
doctl compute firewall listList firewalls (unverified)

Rules are a comma-separated list of key:value pairs. A Droplet source uses droplet_id: in place of address:.

Volumes and DNS #

COMMANDDESCRIPTION
doctl compute volume create <NAME> --region <REGION> --size 10GiBCreate a volume
doctl compute domain create example.com --ip-address <IP>Add a domain
doctl compute domain records create example.com --record-type A --record-name @ --record-data <IP>Add a record

Spaces #

doctl has no commands for objects; doctl spaces keys manages access keys only. Use an S3 client with the endpoint https://<REGION>.digitaloceanspaces.com (see rclone, restic or the AWS CLI with --endpoint-url). Source: Spaces and AWS SDKs. Prefer per-bucket keys over full-access keys (unverified).

Kubernetes and Registry #

COMMANDDESCRIPTION
doctl kubernetes cluster kubeconfig save <CLUSTER>Merge the cluster’s kubeconfig (see Kubectl)
doctl registry loginLog Docker in to the DigitalOcean registry

Billing and Pitfalls #

PITFALLDETAIL
Per-second billing, monthly cap60 second minimum, capped at 672 hours per month (pricing)
Powered-off Droplets still billedDestroy the Droplet (after a snapshot) to stop charges
BackupsWeekly is 20% of the Droplet price, daily is 30% (backups pricing)
Spaces$5 per month includes 250 GiB storage and 1,024 GiB outbound transfer, shared across buckets; overage $0.02 per GiB storage and $0.01 per GiB transfer (Spaces pricing)
SnapshotsBilled per GB until deleted (unverified rate)
Token scopeA full-access token controls the whole team; create scoped tokens and revoke on leak

See Also #

Search all sheets

Tip: / or Ctrl/Cmd+K to open, Esc to close.