doctl Verified current stable Not installed? Cloud Infrastructure

Doctl / List Droplets

List Droplets

Command to list all droplets in the DigitalOcean account.

$
Terminal
doctl compute d ls

When To Use

During routine infrastructure audits before scaling activities.

Pro Tip

Use the `--format` flag to customize output columns. Combining this with `--tagged` can optimize the view for specific environments.

Terminal Output

Expected runtime feedback

Simulated preview
>
Output
ID            Name            Public IPv4      Status
12345678      web-server-1    192.0.2.1       active
87654321      db-server-1     192.0.2.2       active
23456789      app-server-1    192.0.2.3       off

Anatomy of Output

Understanding the result

ID Name Status Size Region Tags Header

Describes the columns returned.

123456 droplet-1 active s-1vcpu-1gb lon1 webserver,production Droplet Entry

Each entry corresponds to a droplet with its metadata.

123457 droplet-2 off s-1vcpu-1gb nyc1 staging Droplet Entry

Status indicates if it is running or stopped.

Power User Variants

Optimized versions

doctl compute droplet list --format ID,Name,Status

Retrieves a selective view of droplet details.

Unix Pipeline

Shell combinations

doctl compute droplet list --tagged webserver

Lists droplets associated with the 'webserver' tag.

Troubleshooting

Common pitfalls

Error: Unauthorized

Solution: Check if your access token is valid and has the required permissions.

Error: No droplets found

Solution: Verify that there are droplets in the specified account.

Error: Invalid request

Solution: Confirm that the command syntax adheres to the documentation.

Command Breakdown

What each part is doing

doctl
Base Command
The executable that performs this operation. Here it runs Doctl before the shell applies any redirect operators.
d
d|droplet
The value supplied for d|droplet.
ls
ls|list
The value supplied for ls|list.

How To Run

Execution path

  1. Step 1

    Run `doctl compute droplet list` to view all droplets.

  2. Step 2

    Check the status and IP addresses for scaling decisions.

Alternative Approaches

Comparable commands in other tools

Alternative cloud infrastructure tools for the same job.