A cloud storage bucket is the basic container for object storage on Google Cloud, and learning to create one correctly saves you from expensive mistakes later. Teams use a cloud storage bucket to store backups, static website assets, media files, log archives, machine learning datasets, and application uploads. Unlike a traditional filesystem, object storage scales almost without limit, keeps multiple copies of your data, and charges you mainly for what you actually store and transfer.
In this guide you will create a bucket with both the Google Cloud Console and the command line, choose the right location and storage class, lock it down with IAM and uniform bucket-level access, enable versioning, and add lifecycle rules that automatically move old data to cheaper storage. If you already automate server backups, combine this guide with our tutorial on how to automate Linux backups with rsync and cron and then sync those backups into Google Cloud for off-site protection.
Prerequisites Before You Create a Cloud Storage Bucket
Before you create your first cloud storage bucket, make sure you have the following ready:
- A Google Cloud account with billing enabled and a project selected.
- The Cloud Storage API enabled in that project.
- Permission to create buckets, ideally the Storage Admin role on the project for this tutorial.
- The Google Cloud CLI (
gcloud) installed and authenticated if you want to follow the command-line steps. - A naming plan: bucket names are globally unique across all of Google Cloud, so include your company or project name in the name.
Authenticate the CLI and set your default project with these commands:
gcloud auth login
gcloud config set project YOUR_PROJECT_ID
gcloud services enable storage.googleapis.com
For the official reference, see the Google Cloud Storage documentation, which covers every option mentioned in this article in greater depth.
Step 1: Create a Cloud Storage Bucket in the Console and CLI
In the Console, open Cloud Storage > Buckets and click Create. Enter a globally unique name, for example mycompany-backups-2026, then work through the location, storage class, and access settings described below. The Console is ideal for a first bucket because it explains each choice as you go.
On the command line, the modern tool is gcloud storage, while the older gsutil command still works:
# Modern command
gcloud storage buckets create gs://mycompany-backups-2026 --location=US --default-storage-class=STANDARD
# Legacy gsutil equivalent
gsutil mb -l US -c STANDARD gs://mycompany-backups-2026
# Verify the bucket exists
gcloud storage buckets list
gcloud storage buckets describe gs://mycompany-backups-2026
Bucket names must be 3 to 63 characters, use only lowercase letters, numbers, dashes, and underscores, and cannot start with the word google. Choose carefully, because a bucket cannot be renamed after creation — you would need to create a new bucket and copy the objects across.
Step 2: Choose Location Type and Storage Class
Location types: region, dual-region, and multi-region
A region bucket stores data in one specific location such as us-central1. It is the cheapest option and offers the lowest latency for users or compute in that region. A dual-region bucket replicates data across two named regions for higher availability, while a multi-region bucket such as US or EU spreads data across a large geographic area and suits content delivered to a wide audience. Pick the location closest to your users and check data-residency rules if you handle regulated data.
Storage classes: Standard, Nearline, Coldline, and Archive
- Standard — frequently accessed data, websites, and working files. No minimum storage duration.
- Nearline — data accessed less than once a month, such as monthly backups. 30-day minimum duration.
- Coldline — data accessed less than once a quarter, such as quarterly archives. 90-day minimum duration.
- Archive — long-term retention accessed less than once a year, such as compliance archives. 365-day minimum duration.
Cheaper classes cost less per gigabyte but charge more for retrieval and carry early-deletion fees if you remove objects before the minimum duration. Start with Standard for active data and let lifecycle rules move objects to colder classes automatically, as shown below.

Step 3: Set Permissions on Your Cloud Storage Bucket
Uniform bucket-level access vs fine-grained ACLs
Google Cloud offers two access models. The legacy fine-grained model mixes IAM policies with per-object access control lists (ACLs), which quickly becomes hard to audit. The recommended uniform bucket-level access model disables object ACLs entirely, so permissions are managed in one place with IAM only. Enable it on every new bucket:
gcloud storage buckets update gs://mycompany-backups-2026 --uniform-bucket-level-access
Grant IAM roles to users and service accounts
Grant the least-privilege role each identity needs. Common roles are roles/storage.objectViewer for read-only access, roles/storage.objectUser for reading and writing objects, and roles/storage.objectAdmin for full control of objects without bucket administration rights. Reserve roles/storage.admin for administrators.
# Read-only access for a user
gcloud storage buckets add-iam-policy-binding gs://mycompany-backups-2026 \
--member=user:[email protected] --role=roles/storage.objectViewer
# Object admin for a service account used by a backup job
gcloud storage buckets add-iam-policy-binding gs://mycompany-backups-2026 \
--member=serviceAccount:backup@YOUR_PROJECT_ID.iam.gserviceaccount.com \
--role=roles/storage.objectAdmin
# Review the current policy
gcloud storage buckets get-iam-policy gs://mycompany-backups-2026
Prefer service accounts for applications and scripts instead of personal accounts, and review bindings regularly with the Policy Analyzer or a simple quarterly audit.
Enable public access prevention
Public access prevention blocks anyone from making the bucket public, even by accident. Turn it on unless the bucket intentionally hosts a public website:
gcloud storage buckets update gs://mycompany-backups-2026 --public-access-prevention
This single setting prevents one of the most common cloud data leaks: a bucket accidentally exposed to allUsers or allAuthenticatedUsers.
Step 4: Enable Versioning and Lifecycle Rules
Object versioning keeps previous versions of an object when it is overwritten or deleted, which protects you against accidents and ransomware-style overwrites. Enable it with:
gcloud storage buckets update gs://mycompany-backups-2026 --versioning
Remember that old versions still consume storage, so pair versioning with a lifecycle rule that cleans up noncurrent versions.
Lifecycle rules automate transitions and deletions based on object age or other conditions. The following policy moves objects to Nearline after 30 days, moves them to Coldline after 90 days, deletes noncurrent versions after 30 days, and deletes live objects after 365 days:
{
"lifecycle": {
"rule": [
{
"action": {"type": "SetStorageClass", "storageClass": "NEARLINE"},
"condition": {"age": 30, "matchesStorageClass": ["STANDARD"]}
},
{
"action": {"type": "SetStorageClass", "storageClass": "COLDLINE"},
"condition": {"age": 90}
},
{
"action": {"type": "Delete"},
"condition": {"age": 365}
},
{
"action": {"type": "Delete"},
"condition": {"daysSinceNoncurrentTime": 30, "isLive": false}
}
]
}
}
# Save the JSON above as lifecycle.json, then apply it
gcloud storage buckets update gs://mycompany-backups-2026 --lifecycle-file=lifecycle.json
# Confirm the policy
gcloud storage buckets describe gs://mycompany-backups-2026 --format="json(lifecycle)"
Lifecycle actions can take up to 24 hours to take effect, so do not panic if objects do not move immediately after you apply a rule.
Step 5: Upload and Download Objects
Use gcloud storage cp to copy files in and out. It supports parallel transfers, recursive copies, and checksums:
# Upload a single file
gcloud storage cp backup.tar.gz gs://mycompany-backups-2026/backups/
# Upload a whole directory recursively
gcloud storage cp -r ./site-assets gs://mycompany-backups-2026/
# Download an object
gcloud storage cp gs://mycompany-backups-2026/backups/backup.tar.gz ./
# List objects and sync a folder
gcloud storage ls gs://mycompany-backups-2026/backups/
gcloud storage rsync -r ./site-assets gs://mycompany-backups-2026/site-assets
Troubleshooting Common Bucket Problems
403 Access Denied
A 403 usually means the caller lacks an IAM role, or uniform bucket-level access is enabled and you are trying to use a legacy ACL command. Check the effective policy with get-iam-policy, confirm you are authenticated as the right account with gcloud auth list, and grant roles at the bucket level rather than editing ACLs. Also verify that public access prevention or an organization policy is not blocking the grant you expect.
Bucket name already taken
Bucket names live in a single global namespace, so a name taken by any other customer is unavailable to you. Add a unique prefix or suffix such as your company name, project number, or region, for example mycompany-backups-eu-2026, instead of generic names like backups or test.
Objects deleted too early or bills higher than expected
Check the lifecycle policy and the storage class minimum durations. Deleting a Nearline object after 10 days still bills you for 30 days, and versioning without a noncurrent-version cleanup rule quietly accumulates old copies.
Conclusion
You now know how to create a bucket in the Console and with the CLI, choose a location type and storage class, secure it with uniform access, IAM roles, and public access prevention, and automate costs with versioning and lifecycle rules. Start with one well-configured bucket, monitor its usage in the Console for a month, and then standardize the same settings across your projects. A carefully configured bucket is cheaper, safer, and far easier to audit than a pile of defaults nobody reviewed.