Can you destroy multiple droplets at once?

January 25, 2017 730 views
Deployment

Hi,

I was wondering if it's possible to destroy multiple droplets at once or does it have to be done manually? having to close down 20-50 droplets manually is time consuming, so hopefully there's a better, more efficient way of handling this?

1 Answer

@AidanNewin

It's not currently possible from the DigitalOcean Control Panel, though you could use the API or even doctl, and write a script that would perform either the shutdown or destroy actions. You would need to write a script to handle interaction with the API or with doctl to automate this, but it can be done.

API

https://developers.digitalocean.com/documentation/v2/

doctl

https://www.digitalocean.com/community/tutorials/how-to-use-doctl-the-official-digitalocean-command-line-client

DigitalOcean's web based control panel provides a convenient, point-and-click interface for managing Droplets. There are many times, however, when a command-line tool may be a preferable alternative. doctl, the official DigitalOcean command-line client, leverages the DigitalOcean API to provide access to most account and Droplet features.
Have another answer? Share your knowledge.