Creating storage buckets  |  Cloud Storage  |  Google Cloud

Imported from google doc (always check for there for updates)

This page shows you how to create Cloud Storage buckets. For an overview of buckets, read the Key Termsarrow-up-right. If not otherwise specified in your request, buckets are created in the US multi-regionarrow-up-right and have a default storage class of Standard Storagearrow-up-right.

Console

  1. Open the Cloud Storage browser in the Google Cloud Console. Open the Cloud Storage browserarrow-up-right

  2. Click Create bucket to open the bucket creation form.

  3. Enter your bucket information and click Continue to complete each step:

  4. Click Done.

gsutil

Use the gsutil mbarrow-up-right command:

gsutil mb gs://[BUCKET_NAME]/

Where:

Set the following optional flags to have greater control over the creation of your bucket:

For example:

Code samples

REST APIS

JSON API

  1. Get an authorization access token from the OAuth 2.0 Playgroundarrow-up-right. Configure the playground to use your own OAuth credentials.

  2. Create a .json file that contains the following information:

    Where:

  3. Use cURLarrow-up-right to call the JSON APIarrow-up-right:

    Where:

    • [JSON_FILE_NAME] is name of the JSON file you created in Step 2.

    • [OAUTH2_TOKEN] is the access token you generated in Step 1.

    • [PROJECT_ID] is the ID of the project with which your bucket will be associated. For example, my-project.

XML API

  1. Get an authorization access token from the OAuth 2.0 Playgroundarrow-up-right. Configure the playground to use your own OAuth credentials.

  2. Create a .xml file that contains the following information:

    Where:

  3. Use cURLarrow-up-right to call the XML APIarrow-up-right:

    Where:

    • [XML_FILE_NAME] is name of the XML file you created in Step 2.

    • [OAUTH2_TOKEN] is the access token you generated in Step 1.

    • [PROJECT_ID] is the ID of the project with which your bucket will be associated. For example, my-project.

    • [BUCKET_NAME] is the name you want to give your bucket, subject to naming requirementsarrow-up-right. For example, my-bucket.

Last updated

Was this helpful?