doctl Verified current stable Not installed? Cloud Infrastructure

Doctl / Delete Droplet

Delete Droplet

Deletes a specified droplet based on ID or name, permanently removing the instance.

$
Terminal
doctl compute d d <droplet_id|droplet_name>

When To Use

During resource cleanup after project completion or to revoke access to unused resources.

Pro Tip

Verify droplet dependencies before deletion to avoid data loss from linked resources.

Warning

Destructive operation. Confirm the target path and keep a backup before executing.

Terminal Output

Expected runtime feedback

Simulated preview
>
Output
$ doctl compute droplet delete 12345678

Droplet 12345678 will be deleted.

Are you sure? (y/n): y

Droplet 12345678 deleted successfully.

Anatomy of Output

Understanding the result

Deleted Droplet: old-droplet Deletion Confirmation

Indicates the droplet has been successfully removed.

Status: Success Execution Status

Confirms the operation completed without errors.

Remaining Droplets: 4 Count of Remaining Instances

Shows the number of droplets remaining after deletion.

Power User Variants

Optimized versions

doctl compute droplet delete old-droplet -f

Force delete without confirmation prompt.

doctl compute droplet delete 56789012 --force

Delete droplet using ID with force flag.

Troubleshooting

Common pitfalls

Error: Droplet not found

Solution: Verify the ID or name; ensure the droplet exists.

Error: Unable to delete active droplet

Solution: Shut down the droplet first before deletion.

Error: Permission denied

Solution: Ensure the API token has appropriate scopes for deletion operations.

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.
d
d|delete
The value supplied for d|delete.
<droplet_id|droplet_name>
droplet id|droplet name
The value supplied for droplet id|droplet name.

How To Run

Execution path

  1. Step 1

    Run `doctl compute droplet delete <droplet_id>` in your terminal.

  2. Step 2

    Confirm the deletion by typing 'y' when prompted.

Alternative Approaches

Comparable commands in other tools

Alternative cloud infrastructure tools for the same job.