Validated on 5 Jun 2019 • Last edited on 23 May 2024
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
To delete a custom image via the command-line, follow these steps:
Use the token to grant doctl access to your
DigitalOcean account.
doctl auth init
Finally, delete a custom image with
doctl compute image delete. The basic usage looks
like this, but you'll want to read the usage docs for more details:
doctl compute image delete <image-id> [flags]
The following example deletes an image with the ID 386734086
doctl compute image delete 386734086
How to delete a custom image using the DigitalOcean API
To delete a custom image using the DigitalOcean API, follow these steps:
Ruby developers can use DropletKit,
the official DigitalOcean V2 API client for Ruby. To delete a custom image with DropletKit, use the
following code:
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, click Images in the main navigation, then click the Custom Images tab.
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 from the control panel separately.