doctl DigitalOcean CLI
Light · Postcard
102 × 152 mm · PDF
Dark · Postcard
102 × 152 mm · PDF
Ink saver · Postcard
102 × 152 mm · PDF
Light · A4 landscape
297 × 210 mm · PDF
Dark · A4 landscape
297 × 210 mm · PDF
Ink saver · A4 landscape
297 × 210 mm · PDF
Light · A3 landscape
420 × 297 mm · PDF
Dark · A3 landscape
420 × 297 mm · PDF
Ink saver · A3 landscape
420 × 297 mm · PDF
Start here
doctl auth initdoctl account get
doctl compute droplet list
doctl compute droplet create <name> --image
<slug> --size <slug> --region <slug>
doctl compute ssh <droplet>
doctl kubernetes cluster kubeconfig save
<cluster>
doctl databases list
doctl compute droplet delete <droplet>
Concepts
- auth init token in a context
- Create resource slugs for region, size, image
- Use it ssh, kubeconfig, connection
Auth and contexts
doctl auth initdoctl auth init --context <name>
doctl auth switch --context <name>
doctl account get
Output
-o json--format ID,Name,PublicIPv4
--no-headerDroplets
doctl compute droplet list
doctl compute droplet create <name> --image
<slug> --size <slug> --region <slug>
doctl compute droplet get <droplet>
doctl compute droplet delete <droplet>
doctl compute droplet create ... --wait
doctl compute droplet create ... --ssh-keys
<id-or-fingerprint>
doctl compute ssh <droplet>
Lookups
doctl compute region list
doctl compute size list
Kubernetes
doctl kubernetes cluster list
doctl kubernetes cluster create <name> --region
<slug>
doctl kubernetes cluster kubeconfig save
<cluster>
doctl kubernetes cluster delete <cluster>
Databases
doctl databases list
doctl databases get <db-id>
doctl databases connection <db-id>
doctl databases create <name> --engine
<pg|mysql|redis> --region <slug>
doctl databases firewalls list <db-id>
doctl databases firewalls append <db-id> --rule
<type>:<value>
Domains and firewalls
doctl compute domain list
doctl compute domain create <domain>
doctl compute domain records list <domain>
doctl compute domain records create <domain>
--record-type A --record-name <name> --record-data
<ip>
doctl compute firewall list
Recipes
doctl compute ssh-key list --format ID,Namedoctl compute droplet create web1 --image ubuntu-24-04-x64 \ --size s-1vcpu-1gb --region nyc1 --ssh-keys <key-id> --waitdoctl compute ssh web1
doctl compute droplet list --tag-name web \ --format PublicIPv4 --no-header
doctl kubernetes cluster listdoctl kubernetes cluster kubeconfig save <cluster>kubectl get nodes
IP=$(doctl compute droplet get web1 --format PublicIPv4 --no-header)doctl compute domain records create example.com \ --record-type A --record-name www --record-data "$IP"



