LinuxCommandLibrary

doctl

Manage DigitalOcean cloud resources

SYNOPSIS

doctl [global-flags] <command> <subcommand> [flags] [arguments]

PARAMETERS

--access-token <token>
    Specify a DigitalOcean API access token. Overrides any token from the config file or environment variables.

--api-url <url>
    Specify the base URL for the DigitalOcean API. Rarely used in typical scenarios.

--config <path>
    Path to the doctl configuration file. Defaults to ~/.config/doctl/config.yaml.

--context <name>
    Use a specific configuration context. Useful for managing multiple DigitalOcean accounts or tokens.

--output <format>
    Output format for data. Supported formats include json, csv, text, and yaml. Defaults to text.

--trace
    Enable API call tracing, printing detailed request and response information to stderr.

--verbose
    Enable verbose output, providing more detailed information about operations.

--no-headers
    Disable table headers when using text or csv output format.

--wait
    Wait for the requested action to complete before returning. Applies to actions like Droplet creation.

DESCRIPTION

doctl is the official command-line interface (CLI) for managing DigitalOcean resources. It allows users to interact with the DigitalOcean API directly from their terminal, automating tasks and scripting operations on their cloud infrastructure. With doctl, you can provision and manage Droplets, Kubernetes clusters, databases, load balancers, domains, firewalls, and much more. It provides a powerful and efficient way for developers and system administrators to control their DigitalOcean account without needing to access the web control panel, supporting various output formats like JSON, CSV, and YAML for easy integration with other tools.

CAVEATS

Authentication is crucial: doctl requires a valid DigitalOcean API token. Ensure your token has the necessary permissions for the operations you intend to perform.
API rate limits apply, so excessive or rapid calls might temporarily block access.
Always verify the region and resource IDs when performing destructive actions, as these operations are irreversible.

AUTHENTICATION

Before using doctl, you must authenticate. The primary method is to initialize your configuration using doctl auth init, which will prompt you for a DigitalOcean API token. Tokens can be generated in the DigitalOcean control panel. Alternatively, you can specify a token directly via the --access-token flag or the DO_TOKEN environment variable.

COMMAND STRUCTURE

doctl commands follow a hierarchical structure: doctl <resource-type> <action>. For example, doctl compute droplet create to create a Droplet, or doctl kubernetes cluster list to list Kubernetes clusters. Each command and subcommand typically has its own set of flags to refine the operation.

HISTORY

doctl was developed by DigitalOcean to provide a native command-line experience for their users, complementing their web UI and API documentation. It has evolved significantly since its initial release, growing alongside the DigitalOcean platform to support new services and features. Its development reflects the broader industry trend of cloud providers offering robust CLI tools for automation and developer workflows.

SEE ALSO

curl(1), jq(1), aws(1), gcloud(1), az(1)

Copied to clipboard