Stay organized with collections Save and categorize content based on your preferences.
Linux Windows
You can only delete custom images that you, or someone who has access to the project, have added.
Warning: Deleting a custom image is irreversible. You can't recover a deleted custom image.If you want to retain a backup of the image, export the custom image to Cloud Storage before deleting it.
Before you beginSelect the tab for how you plan to use the samples on this page:
ConsoleWhen you use the Google Cloud console to access Google Cloud services and APIs, you don't need to set up authentication.
gcloudInstall the Google Cloud CLI. After installation, initialize the Google Cloud CLI by running the following command:
gcloud init
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update
.To use the Python samples on this page in a local development environment, install and initialize the gcloud CLI, and then set up Application Default Credentials with your user credentials.
Install the Google Cloud CLI.
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
Note: If you installed the gcloud CLI previously, make sure you have the latest version by runninggcloud components update
.
If you're using a local shell, then create local authentication credentials for your user account:
gcloud auth application-default login
You don't need to do this if you're using Cloud Shell.
If an authentication error is returned, and you are using an external identity provider (IdP), confirm that you have signed in to the gcloud CLI with your federated identity.
For more information, see Set up authentication for a local development environment.
RESTTo use the REST API samples on this page in a local development environment, you use the credentials you provide to the gcloud CLI.
Install the Google Cloud CLI.
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
For more information, see Authenticate for using REST in the Google Cloud authentication documentation.
Use one of the following methods to delete the image.
ConsoleIn the Google Cloud console, go to the Images page.
Check the box to the left of the image you want to delete.
Click Delete at the top of the page. Your image is deleted.
Use the gcloud compute images delete
command to delete an image:
gcloud compute images delete IMAGE_NAME
Replace IMAGE_NAME
with the name of the image to delete.
Make a POST
request to the images().delete
method. Specify the name of the image you want to delete.
POST https://compute.googleapis.com/compute/v1/projects/PROJECT_ID/global/images/RESOURCE_ID
Replace the following:
PROJECT_ID
: the project to which the image belongs.RESOURCE_ID
: the name of the image that you want to delete.Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-08-07 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["Custom images can only be deleted by the user who created them or someone with project access, and this action is irreversible, so exporting a backup to Cloud Storage beforehand is recommended."],["Before deleting an image, it is recommended to read the Images document and set up authentication, which varies depending on whether you're using the Console, gcloud CLI, Python, or REST API."],["Deleting an image can be done through the Google Cloud console by navigating to the **Images** page, selecting the image, and clicking **Delete**, or through the `gcloud compute images delete` command in the gcloud CLI."],["The provided code samples demonstrate how to programmatically delete images using Go, Java, and Python, including the necessary steps for setting up the environment and handling potential errors."],["To delete an image using the REST API, you need to make a `POST` request to the `images().delete` method, specifying the project ID and the name of the image you want to delete."]]],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4