LinuxCommandLibrary
GitHubF-DroidGoogle Play Store

doctl

official DigitalOcean command-line interface

TLDR

Authenticate with DigitalOcean
$ doctl auth init
copy
List all droplets
$ doctl compute droplet list
copy
Create a droplet
$ doctl compute droplet create [name] --size [s-1vcpu-1gb] --image [ubuntu-22-04-x64] --region [nyc1]
copy
Delete a droplet
$ doctl compute droplet delete [droplet_id]
copy
List Kubernetes clusters
$ doctl kubernetes cluster list
copy
Get kubeconfig
$ doctl kubernetes cluster kubeconfig save [cluster_name]
copy
List available regions
$ doctl compute region list
copy
List all databases
$ doctl databases list
copy
List Spaces (object storage buckets)
$ doctl spaces list
copy
Create a container registry
$ doctl registry create [name]
copy
List SSH keys
$ doctl compute ssh-key list
copy
Output as JSON
$ doctl compute droplet list --output json
copy

SYNOPSIS

doctl command [subcommand] [options]

DESCRIPTION

doctl is the official command-line interface for DigitalOcean, providing access to all DigitalOcean services including Droplets, Kubernetes, App Platform, Databases, and more.The tool enables infrastructure automation, CI/CD integration, and scriptable management of DigitalOcean resources. It supports multiple authentication contexts for managing different accounts or teams.doctl mirrors the DigitalOcean API functionality, allowing complete control over cloud resources from the command line without using the web console.

PARAMETERS

COMMAND

Resource type: account, auth, compute, apps, databases, kubernetes, monitoring, projects, registry, serverless, spaces, vpcs, etc.
auth init
Authenticate with API token.
auth list
List available authentication contexts.
compute droplet ACTION
Manage Droplets (create, list, delete, get, etc.).
compute volume ACTION
Manage block storage volumes.
compute domain ACTION
Manage DNS domains and records.
compute firewall ACTION
Manage cloud firewalls.
compute load-balancer ACTION
Manage load balancers.
kubernetes cluster ACTION
Manage Kubernetes clusters.
apps ACTION
Manage App Platform applications.
databases ACTION
Manage managed database clusters.
spaces ACTION
Manage Spaces object storage.
registry ACTION
Manage container registries.
serverless ACTION
Manage serverless functions.
monitoring ACTION
Manage monitoring alert policies and uptime checks.
projects ACTION
Organize and assign resources to projects.
--access-token TOKEN
DigitalOcean API token. Overrides config and DIGITALOCEANACCESSTOKEN.
--output FORMAT
Output format: text, json.
--format COLUMNS
Comma-separated list of columns to display in table output.
--context NAME
Use named authentication context.
--trace
Show a log of network activity while performing a command.
--verbose
Enable verbose output.
--help
Display help information.

CAVEATS

Requires DigitalOcean account and API token. Actions may incur charges. Some operations are irreversible. Rate limits apply to API requests.

HISTORY

doctl was developed by DigitalOcean as the official CLI for their cloud platform. It provides programmatic access to DigitalOcean services, supporting DevOps workflows and infrastructure as code practices.

SEE ALSO

kubectl(1), terraform(1), aws(1), gcloud(1)

Copied to clipboard
Kai