This page shows you how to delete Cloud Storage buckets. For an overview of buckets, read the Key Terms.
To delete a bucket:
Console
- Open the Cloud Storage browser in the Google Cloud Console.
Open the Cloud Storage browser Select the checkbox of the bucket you want to delete.
Click Delete.
In the overlay window that appears, confirm you want to delete the bucket and its contents by clicking Delete.
gsutil
Use the gsutil rm
command with the -r
flag:
gsutil rm -r gs://[BUCKET_NAME]
Where [BUCKET_NAME]
is the name of the bucket to delete. For example, my-bucket
.
The response looks like the following example:
Removing gs://[BUCKET_NAME]/...
Code samples
For more information, see the
Cloud Storage C++ API reference documentation
.
For more information, see the
Cloud Storage C# API reference documentation
.
For more information, see the
Cloud Storage Go API reference documentation
.
For more information, see the
Cloud Storage Java API reference documentation
.
For more information, see the
Cloud Storage Node.js API reference documentation
.
For more information, see the
Cloud Storage PHP API reference documentation
.
For more information, see the
Cloud Storage Python API reference documentation
.
For more information, see the
Cloud Storage Ruby API reference documentation
.
C++
C#
Go
Java
Node.js
PHP
Python
Ruby
REST APIs
JSON API
- Get an authorization access token from the OAuth 2.0 Playground. Configure the playground to use your own OAuth credentials.
Use
cURL
to call the JSON API with aDELETE
Bucket request:curl -X DELETE -H "Authorization: Bearer [OAUTH2_TOKEN]" \ "https://storage.googleapis.com/storage/v1/b/[BUCKET_NAME]"
Where:
[OAUTH2_TOKEN]
is the access token you generated in Step 1.[BUCKET_NAME]
is the name of the bucket to delete. For example,my-bucket
.
If successful, the response contains a 204 status code.
XML API
- Get an authorization access token from the OAuth 2.0 Playground. Configure the playground to use your own OAuth credentials.
Use
cURL
to call the XML API with aDELETE
Bucket request:curl -X DELETE -H "Authorization: Bearer [OAUTH2_TOKEN]" \ "https://storage.googleapis.com/[BUCKET_NAME]"
Where:
[OAUTH2_TOKEN]
is the access token you generated in Step 1.[BUCKET_NAME]
is the name of the bucket to delete. For example,my-bucket
.