# How to Destroy a Droplet from the DigitalOcean Control Panel DigitalOcean Droplets are Linux-based virtual machines (VMs) that run on top of virtualized hardware. Each Droplet you create is a new server you can use, either standalone or as part of a larger, cloud-based infrastructure. Deleting a Droplet permanently and irreversibly destroys the Droplet. Optionally, you can also destroy a Droplet and its associated [snapshots](https://docs.digitalocean.com/products/snapshots/index.html.md), [volumes](https://docs.digitalocean.com/products/volumes/index.html.md), and [volume snapshots](https://docs.digitalocean.com/products/snapshots/how-to/snapshot-volumes/index.html.md). To save one or more of the backup images, [convert the backup into a snapshot](https://docs.digitalocean.com/products/backups/how-to/convert-to-snapshot/index.html.md) before deleting the Droplet. Destroying a Droplet does not destroy its automated backups. Automated backups remain for four weeks after creation and then expire. To save backup images, [convert the backups into snapshots](https://docs.digitalocean.com/products/backups/how-to/convert-to-snapshot/index.html.md). ## Destroy a Droplet from the Control Panel To destroy a Droplet from the [control panel](https://cloud.digitalocean.com), open the Droplet’s **More** menu and click **Destroy**. Alternately, you can click the Droplet’s name to access its main page and select **Destroy** from the left menu. On the **Destroy** page, in the **Destroy Droplet** section, click the **Destroy the Droplet** button. ![Destroy Droplet page](https://docs.digitalocean.com/screenshots/droplets/pages/destroy.7961270a4f80ac96f3939dd7113c7c7e85262cad2ba87ab26dcabeca342b2a98.png) In the confirmation window that opens, you can choose to destroy the Droplet. If the Droplet has associated resources, you can also choose to delete some or all of them, but they are not destroyed by default. Check the boxes next to any of the Droplet’s associated snapshots, volumes, or volume snapshots that you would like to destroy along with the Droplet. ![The Destroy Droplet confirmation window with associated resources](https://docs.digitalocean.com/screenshots/droplets/pages/destroy-droplet-confirmation.94f52ad6a18dfb966336e98dcf70509ac579c8ae93c75b44ffe656b3e49925b7.png) Type the name of the Droplet in the text field, then click **Destroy** to destroy the Droplet and any selected associated resources. Any resources that you do not destroy appear in their respective category in the control panel’s **Manage** section. ## Automate the Destruction of a Droplet ## How to Permanently Delete a Droplet Using the DigitalOcean CLI 1. [Install `doctl`](https://docs.digitalocean.com/reference/doctl/how-to/install/index.html.md), the official DigitalOcean CLI. 2. [Create a personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/index.html.md) and save it for use with `doctl`. 3. Use the token to grant `doctl` access to your DigitalOcean account. ```shell doctl auth init ``` 4. Finally, run `doctl compute droplet delete`. Basic usage looks like this, but you can [read the usage docs](https://docs.digitalocean.com/reference/doctl/reference/compute/droplet/delete/index.html.md) for more details: ```shell doctl compute droplet delete ... [flags] ``` The following example deletes a Droplet with the ID `386734086`: ```shell doctl compute droplet delete 386734086 ``` ## How to Delete an Existing Droplet Using the DigitalOcean API 1. [Create a personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/index.html.md) and save it for use with the API. 2. Send a DELETE request to [`https://api.digitalocean.com/v2/droplets/{droplet_id}`](https://docs.digitalocean.com/reference/api/digitalocean//index.html.md#operation/droplets_destroy). ### cURL Using cURL: ```shell curl -X DELETE \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ "https://api.digitalocean.com/v2/droplets/3164494" ``` ### Go Using [Godo](https://github.com/digitalocean/godo), the official DigitalOcean API client for Go: ```go import ( "context" "os" "github.com/digitalocean/godo" ) func main() { token := os.Getenv("DIGITALOCEAN_TOKEN") client := godo.NewFromToken(token) ctx := context.TODO() _, err := client.Droplets.Delete(ctx, 3164494) } ``` ### Ruby Using [DropletKit](https://github.com/digitalocean/droplet_kit), the official DigitalOcean API client for Ruby: ```ruby require 'droplet_kit' token = ENV['DIGITALOCEAN_TOKEN'] client = DropletKit::Client.new(access_token: token) client.droplets.delete(id: 3164494) ``` ### Python Using [PyDo](https://github.com/digitalocean/pydo), the official DigitalOcean API client for Python: ```python import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) resp = client.droplets.destroy(droplet_id=553456) ``` ## How to Destroy a Droplet and All of Its Associated Resources (Dangerous) Using the DigitalOcean API 1. [Create a personal access token](https://docs.digitalocean.com/reference/api/create-personal-access-token/index.html.md) and save it for use with the API. 2. Send a DELETE request to [`https://api.digitalocean.com/v2/droplets/{droplet_id}/destroy_with_associated_resources/dangerous`](https://docs.digitalocean.com/reference/api/digitalocean//index.html.md#operation/droplets_destroy_withAssociatedResourcesDangerous). ### cURL Using cURL: ```shell curl -X DELETE -H "X-Dangerous: true" \ -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ "https://api.digitalocean.com/v2/droplets/187000742/destroy_with_associated_resources/dangerous" ``` ### Python Using [PyDo](https://github.com/digitalocean/pydo), the official DigitalOcean API client for Python: ```python import os from pydo import Client client = Client(token=os.environ.get("DIGITALOCEAN_TOKEN")) resp = client.droplets.destroy_with_associated_resources_dangerous(droplet_id=524512) ```