Stay organized with collections Save and categorize content based on your preferences.
gcloud storage buckets create
URL
[URL
…] [--additional-headers
=HEADER
=VALUE
] [--default-encryption-key
=DEFAULT_ENCRYPTION_KEY
, -k
DEFAULT_ENCRYPTION_KEY
] [--default-storage-class
=DEFAULT_STORAGE_CLASS
, -c
DEFAULT_STORAGE_CLASS
, -s
DEFAULT_STORAGE_CLASS
] [--enable-hierarchical-namespace
] [--enable-per-object-retention
] [--ip-filter-file
=IP_FILTER_FILE
] [--lifecycle-file
=LIFECYCLE_FILE
] [--location
=LOCATION
, -l
LOCATION
] [--[no-]pap
, --[no-]public-access-prevention
] [--placement
=[REGION
,…]] [--recovery-point-objective
=SETTING
, --rpo
=SETTING
] [--retention-period
=RETENTION_PERIOD
] [--soft-delete-duration
=SOFT_DELETE_DURATION
] [--[no-]uniform-bucket-level-access
, -b
] [--autoclass-terminal-storage-class
=AUTOCLASS_TERMINAL_STORAGE_CLASS
--[no-]enable-autoclass
] [GCLOUD_WIDE_FLAG …
]
my-bucket
and a second bucket named my-other-bucket
:
gcloud storage buckets create gs://my-bucket gs://my-other-bucket
The following command creates a bucket with the
default storage class in the nearline
location:asia
gcloud storage buckets create gs://my-bucket --default-storage-class=nearline --location=asia
URL
[URL
…]
header1=value1,header2=value2
. Overrides the default storage/additional_headers
property value for this command invocation.
--default-encryption-key
=DEFAULT_ENCRYPTION_KEY
, -k
DEFAULT_ENCRYPTION_KEY
projects/[project-id]/locations/[location]/keyRings/[key-ring]/cryptoKeys/[my-key]
.
--default-storage-class
=DEFAULT_STORAGE_CLASS
, -c
DEFAULT_STORAGE_CLASS
, -s
DEFAULT_STORAGE_CLASS
--enable-hierarchical-namespace
--enable-per-object-retention
--ip-filter-file
=IP_FILTER_FILE
{ "mode": "Enabled", "publicNetworkSource": { "allowedIpCidrRanges": ["0.0.0.0/0"] }, "vpcNetworkSources": [ { "network": "projects/PROJECT_NAME/global/networks/NETWORK_NAME", "allowedIpCidrRanges": ["0.0.0.0/0"] }, ] }
For more information about supported configurations, see Cloud Storage bucket IP filtering configurations
--lifecycle-file
=LIFECYCLE_FILE
{ "rule": [ { "action": {"type": "Delete"}, "condition": {"age": 365} } ] }
--location
=LOCATION
, -l
LOCATION
us
. A bucket's location cannot be changed after creation.
--[no-]pap
, --[no-]public-access-prevention
--public-access-prevention
to enable and --no-public-access-prevention
to disable.
--placement
=[REGION
,…]
--recovery-point-objective
=SETTING
, --rpo
=SETTING
DEFAULT
option is valid for multi-region and dual-regions buckets. ASYNC_TURBO
option is only valid for dual-region buckets. If unspecified when the bucket is created, it defaults to DEFAULT
for dual-region and multi-region buckets. For more information, see replication in Cloud Storage. SETTING
must be one of: ASYNC_TURBO
, DEFAULT
.
--retention-period
=RETENTION_PERIOD
--retention-period=P1Y1M1DT5S
. Objects added to the bucket cannot be deleted until they've been stored for the specified length of time. Default is no retention period. Only available for Cloud Storage using the JSON API.
--soft-delete-duration
=SOFT_DELETE_DURATION
gcloud topic datetimes
for more information on the duration format. Setting 0
will disable soft delete policy on the bucket. Default is 7 days.
--[no-]uniform-bucket-level-access
, -b
--uniform-bucket-level-access
to enable and --no-uniform-bucket-level-access
to disable.
--autoclass-terminal-storage-class
=AUTOCLASS_TERMINAL_STORAGE_CLASS
--[no-]enable-autoclass
--enable-autoclass
to enable and --no-enable-autoclass
to disable.
--access-token-file
, --account
, --billing-project
, --configuration
, --flags-file
, --flatten
, --format
, --help
, --impersonate-service-account
, --log-http
, --project
, --quiet
, --trace-token
, --user-output-enabled
, --verbosity
.
Run $ gcloud help
for details.
gcloud alpha storage buckets create
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-07-22 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-07-22 UTC."],[],[]]
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.5