DigitalOcean CheatSheet

Installing doctl Link to heading

brew install doctl
brew install bash-completion
source $(brew --prefix)/etc/bash_completion
source ~/.bashrc

Upgrading doctl Link to heading

brew upgrade doctl

Authenticating with DigitalOcean Link to heading

doctl auth init
# You should get someting like this
# 6f600d1e574f4f5c2a3ce558db898581d190d7cbc68f5a57692104bf50fd5d2f

Droplets Link to heading

List all Droplets Link to heading

doctl compute droplet list

Create a Droplet Link to heading

doctl compute droplet create <name> --region <region-slug> --image <image-slug> --size <size-slug>

doctl compute droplet create pythontesting  --wait --region fra1 --image 56427524 --size s-1vcpu-2gb --ssh-keys 25855785

#DO_IMAGE_ID=`doctl compute image list --public | grep ubuntu-18-04-x64 | grep "18.04.3 (LTS) x64" | cut -f1 -d' '`


DO_REGION=`doctl compute region list | grep "Toronto 1" | cut -f1 -d' '`
DO_IMAGE_ID=`doctl compute image list --public | grep debian-10-x64 | cut -f1 -d' '`
DO_VM_SIZE=g-2vcpu-8gb
DO_VM_NAME=gitlab.obay.cloud
doctl compute droplet create --wait $DO_VM_NAME --region $DO_REGION --image $DO_IMAGE_ID --size $DO_VM_SIZE --ssh-keys 25855785
doctl compute ssh $DO_VM_NAME

Delete a Droplet Link to heading

doctl compute droplet delete 173281908

Get Droplets Details Link to heading

doctl compute droplet get 173281908

SSH to Droplet Link to heading

doctl compute ssh pythontesting

Regions Link to heading

List all regions Link to heading

doctl compute region list

Images Link to heading

List all public images Link to heading

doctl compute image list --public | grep debian


# 53893565 ubuntu-14-04-x64
# 53893572 ubuntu-18-04-x64

Sizes Link to heading

List all sizes Link to heading

doctl compute size list
List K8s Clusters on DigitalOcean Link to heading
doctl kubernetes cluster list