doctl(1)
doctl is the command-line interface for DigitalOcean's cloud platform, managing droplets, databases, Kubernetes clusters, and other cloud resources.
Synopsis
doctl [COMMAND] [SUBCOMMAND] [FLAGS]Description
doctl is the official command-line tool for interacting with DigitalOcean's API. It allows you to create and manage virtual machines (droplets), block storage, databases, Kubernetes clusters, networking resources, and more directly from your terminal.
Authentication requires a DigitalOcean API token, typically stored via doctl auth init. Most operations support output in JSON, YAML, or tabular format, and can target specific regions or resource IDs.
Common options
| Flag | What it does |
|---|---|
--help, -h | display help information for command or subcommand |
--output, -o | output format: text (default), json, or yaml |
--format | comma-separated list of columns to display in text output |
--no-header | omit column headers from output |
--sort | column to sort results by |
--context | authentication context to use (default is 'default') |
--verbose, -v | enable verbose output for debugging |
--access-token | DigitalOcean API token (overrides stored configuration) |
Examples
interactively configure doctl with your DigitalOcean API token
doctl auth initlist all droplets with custom columns showing name, status, memory, and region
doctl compute droplet list --format Name,Status,Memory,Regioncreate a new Ubuntu 20.04 droplet in New York region with 512MB memory
doctl compute droplet create my-droplet --region nyc3 --size s-1vcpu-512mb-10gb --image ubuntu-20-04-x64permanently delete the droplet with ID 12345678 without confirmation
doctl compute droplet delete 12345678 --forcelist all Kubernetes clusters in JSON format and extract cluster names
doctl kubernetes cluster list -o json | jq '.[] | .name'display all managed databases with their engine type and current status
doctl database list --format Name,Engine,Statusupload your public SSH key to DigitalOcean for droplet access
doctl compute ssh-key create --public-key-path ~/.ssh/id_rsa.pub my-ssh-keypower on a droplet by its ID
doctl compute droplet-action power-on 12345678