doctl

  • Create a Personal Access Token (to avoid the need to authenticate each time)

  • Add as a local environment variable, for example in fish shell:

    > set -x DIGITALOCEAN_ACCESS_TOKEN "<YOUR_PERSONAL_TOKEN_HERE>"
    
  • List registered ssh keys:

    > doctl compute ssh-key list
    
  • List available distribution images:

    > doctl compute image list-distribution
    ID          Name                 Type        Distribution    Slug                  Public    Min Disk
    31354013    6.9 x32              snapshot    CentOS          centos-6-x32          true      20
    34902021    6.9 x64              snapshot    CentOS          centos-6-x64          true      20
    54203610    16.04.6 (LTS) x32    snapshot    Ubuntu          ubuntu-16-04-x32      true      20
    59416024    12.1 x64 ufs         snapshot    FreeBSD         freebsd-12-x64        true      20
    65416372    v1.5.6               snapshot    RancherOS       rancheros             true      20
    69439389    18.04 (LTS) x64      snapshot    Ubuntu          ubuntu-18-04-x64      true      15
    69439535    8.2 x64              snapshot    CentOS          centos-8-x64          true      15
    69440038    10 x64               snapshot    Debian          debian-10-x64         true      15
    69440042    9 x64                snapshot    Debian          debian-9-x64          true      15
    69451585    16.04 (LTS) x64      snapshot    Ubuntu          ubuntu-16-04-x64      true      15
    69452245    11.4 zfs x64         snapshot    FreeBSD         freebsd-11-x64-zfs    true      15
    69457626    31 x64               snapshot    Fedora          fedora-31-x64         true      15
    69463186    20.04 (LTS) x64      snapshot    Ubuntu          ubuntu-20-04-x64      true      15
    69500386    11.4 ufs x64         snapshot    FreeBSD         freebsd-11-x64-ufs    true      15
    69535713    7.6 x64              snapshot    CentOS          centos-7-x64          true      20
    69761316    12.1 zfs x64         snapshot    FreeBSD         freebsd-12-x64-zfs    true      15
    70639049    32 x64               snapshot    Fedora          fedora-32-x64         true      15
    
  • List available regions:

    > doctl compute region list
    Slug    Name               Available
    nyc1    New York 1         true
    sfo1    San Francisco 1    false
    nyc2    New York 2         false
    ams2    Amsterdam 2        false
    sgp1    Singapore 1        true
    lon1    London 1           true
    nyc3    New York 3         true
    ams3    Amsterdam 3        true
    fra1    Frankfurt 1        true
    tor1    Toronto 1          true
    sfo2    San Francisco 2    true
    blr1    Bangalore 1        true
    sfo3    San Francisco 3    true
    
  • List available droplet sizes:

    > doctl compute size list
    Slug            Memory    VCPUs    Disk    Price Monthly    Price Hourly
    s-1vcpu-1gb     1024      1        25      5.00             0.007440
    512mb           512       1        20      5.00             0.007440
    s-1vcpu-2gb     2048      1        50      10.00            0.014880
    1gb             1024      1        30      10.00            0.014880
    s-3vcpu-1gb     1024      3        60      15.00            0.022320
    s-2vcpu-2gb     2048      2        60      15.00            0.022320
    s-1vcpu-3gb     3072      1        60      15.00            0.022320
    s-2vcpu-4gb     4096      2        80      20.00            0.029760
    2gb             2048      2        40      20.00            0.029760
    s-4vcpu-8gb     8192      4        160     40.00            0.059520
    c-2             4096      2        25      40.00            0.059520
    4gb             4096      2        60      40.00            0.059520
    g-2vcpu-8gb     8192      2        25      60.00            0.089290
    gd-2vcpu-8gb    8192      2        50      65.00            0.096730
    s-6vcpu-16gb    16384     6        320     80.00            0.119050
    c-4             8192      4        50      80.00            0.119050
    8gb             8192      4        80      80.00            0.119050
    m-2vcpu-16gb    16384     2        50      90.00            0.133930
    
  • List registered ssh keys:

    > doctl compute ssh-key list
    ID          Name                               FingerPrint
    ...
    

References

  1. Command Line Interface (CLI) Reference for doctl (digitalocean.com)
updatedupdated2021-03-232021-03-23