Stay organized with collections Save and categorize content based on your preferences.
This page shows you how to get the size of your Cloud Storage buckets.
Required rolesIn order to get the required permissions for getting the size of a Cloud Storage bucket, ask your administrator to grant you the Storage Object Viewer (roles/storage.objectViewer
) role on the bucket. If you plan on using the Google Cloud console, ask your administrator to grant you the Monitoring Viewer (roles/monitoring.viewer
) role on the project that contains the bucket instead.
These roles contain the permissions required to get the size of a bucket. To see the exact permissions that are required, expand the Required permissions section:
Required permissionsstorage.objects.list
To see the permissions associated with roles/monitoring.viewer
, refer to the Monitoring Viewer documentation.
You might be able to get the required permission with other predefined roles or custom roles. For instructions on granting roles on buckets, see Set and manage IAM policies on buckets. For instructions on granting roles on projects, see Manage access to projects.
Determine a bucket's size Console Note: Monitoring measures bucket size once a day and does not report empty buckets. To measure bucket size at a given moment for any bucket, usegcloud storage
instead.
To view the metrics for a monitored resource by using the Metrics Explorer, do the following:
In the Google Cloud console, go to the leaderboard Metrics explorer page:
If you use the search bar to find this page, then select the result whose subheading is Monitoring.
Total bytes (v2)
in the filter bar, and then use the submenus to select a specific resource type and metric:
To add filters, which remove time series from the query results, use the Filter element.
To combine time series, use the menus on the Aggregation element. For example, to display the CPU utilization for your VMs, based on their zone, set the first menu to Mean and the second menu to zone.
All time series are displayed when the first menu of the Aggregation element is set to Unaggregated. The default settings for the Aggregation element are determined by the metric type you selected.
You can also use the Metrics Explorer to measure other bucket metrics such as storage.googleapis.com/storage/object_count and storage.googleapis.com/storage/v2/total_byte_seconds, which measure the daily number of objects and the daily storage consumed, respectively. See the Google Cloud metrics documentation for a complete list of available metrics and Metrics, time series, and resources for more information about using the Metrics Explorer.
Command line Caution: Thegcloud storage du
command calculates the current space usage by making a series of object listing requests, which can take a long time for large buckets. If the number of objects in your bucket is hundreds of thousands or more, or if you want to monitor your bucket size over time, use Monitoring instead, as described in the Console tab.
Use the gcloud storage du
command with a --summarize
flag:
gcloud storage du gs://BUCKET_NAME --summarize
where BUCKET_NAME
is the name of the relevant bucket.
The response looks like the following example:
134620 gs://my-bucket
In this example, the size of the bucket named my-bucket
is 134,620 bytes.
If you're new to Google Cloud, create an account to evaluate how Cloud Storage performs in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
Try Cloud Storage freeExcept 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-10-02 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-10-02 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