# How to Delete Custom Images Custom images are Linux and Unix-like images you import to DigitalOcean. You can create Droplets based custom images, which lets you migrate and scale your workloads without spending time recreating your environment from scratch. ## Delete a Custom Image using the Automation ## How to Delete a Custom Image 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 image delete`. Basic usage looks like this, but you can [read the usage docs](https://docs.digitalocean.com/reference/doctl/reference/compute/image/delete/index.html.md) for more details: ```shell doctl compute image delete [flags] ``` The following example deletes an image with the ID `386734086`: ```shell doctl compute image delete 386734086 ``` ## How to Delete a Custom Image 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/images/{image_id}`](https://docs.digitalocean.com/reference/api/digitalocean//index.html.md#operation/images_delete). ### cURL Using cURL: ```shell curl -X DELETE \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $DIGITALOCEAN_TOKEN" \ "https://api.digitalocean.com/v2/images/7938391" ``` ### 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.Images.Delete(ctx, 7938391) } ``` ### 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.images.delete(id: 7938391) ``` ### 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.images.delete(image_id=134215) ``` ## Delete a Custom Image using the Control Panel To delete a custom image via the [control panel](https://cloud.digitalocean.com), in the left menu, click **Backups & Snapshots**, then click the **Custom Images** tab. ![Custom Images page listing uploaded images with image details, and a More dropdown menu for starting a Droplet or deleting the image.](https://docs.digitalocean.com/screenshots/custom-images/overview.c7f454638be3817115f1c638d877b59ed3cd004f20fa6401d8193ad4a0b3ffa6.png) Click the **More** menu for the custom image you want to delete, then choose **Delete**. A confirmation window titled **Confirm delete item** opens. Click **Delete Item** to confirm the deletion Droplets you’ve created from a custom image are not deleted when you delete the image from your account. You can [destroy Droplets](https://docs.digitalocean.com/products/droplets/how-to/destroy/index.html.md) from the control panel separately.