The official command line interface for the DigitalOcean API.
500K+
docker pull digitalocean/doctl:<TAG>
The following tags are available:
latest - The most recent doctl release<version> - A specific version of doctl, e.g.: 1.27.0 (list of available versions)1-latest - The most recent release in the 1.x series (doctl uses semantic versioning)When using doctl with Docker, you must set the DIGITALOCEAN_ACCESS_TOKEN
environment variable inside the container. Many commands require user input,
so it is recommended to pass the --interactive and --tty flags as well.
For example:
docker run --rm --interactive --tty \
--env=DIGITALOCEAN_ACCESS_TOKEN=<YOUR-DO-API-TOKEN> \
digitalocean/doctl account get
Some commands may require additional arguments, including:
doctl allows you to connect to a Droplet over SSH without knowing its IP address by providing its ID. In order to use this feature with Docker, you must mount your SSH private key from your local file system into the container. For example:
docker run --rm --interactive --tty \
--env=DIGITALOCEAN_ACCESS_TOKEN=<YOUR-DO-API-TOKEN> \
-v $HOME/.ssh/id_rsa:/root/.ssh/id_rsa \
digitalocean/doctl compute ssh <DROPLET-ID>
To upload an SSH public key to your DigitalOcean account using Docker, you must make it accessible inside the container by mounting it as a volume. For example:
docker run --rm --interactive --tty \
--env=DIGITALOCEAN_ACCESS_TOKEN=<YOUR-DO-API-TOKEN> \
-v $HOME/path/to/id_rsa.pub:/root/id_rsa.pub \
digitalocean/doctl compute ssh-key import <SSH-KEY-NAME> \
--public-key-file /root/id_rsa.pub
doctl is maintained on GitHub. View the source, contribute, or report issues at:
For more information about doctl, see:
Content type
Image
Digest
sha256:516654476…
Size
28.2 MB
Last updated
about 7 hours ago
docker pull digitalocean/doctl