Question

Can you destroy multiple droplets at once?

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?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

@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

Here is an script that can be useful:

DigitalOcean-destroy-all-Droplets