Go 1.11 has reached end of support
and will be deprecated
on January 31, 2026. After deprecation, you won't be able to deploy Go 1.11
applications, even if your organization previously used an organization policy to
re-enable deployments of legacy runtimes. Your existing Go
1.11 applications will continue to run and receive traffic after their
deprecation date. We
recommend that you migrate to the latest supported version of Go.
Stay organized with collections
Save and categorize content based on your preferences.
You can use a Cloud Storage bucket
to store and serve files, such as movies or images or other static content. This
document describes how to set up your environment to use the App Engine client
library for Cloud Storage.
Setting up your project
Create a Google Cloud project, and understand how Go 1.11 apps are
structured in App Engine. Write down and save your project ID for use
with your application.
Activating a Cloud Storage bucket
To use Cloud Storage, you'll need to activate at least one bucket.
You might want to use the default bucket which provides the first 5GB of
storage for free. You can activate and use another Cloud Storage
bucket. The default bucket includes
the first 5GB of storage for free. The default bucket
also includes a free quota for Cloud Storage I/O operations. See
Pricing, quotas, and limits
for more details.
To activate the default Cloud Storage bucket for your app:
Click Create under Default Cloud Storage Bucket in the
App Engine settings page for your project.
Notice the name of this bucket: it is in the form <project-id>.appspot.com.
If you need more storage than the 5GB limit, you can
increase this by enabling billing for your project,
making this a paid bucket. You will be charged for storage over the 5GB limit.
If you want to activate one or more paid buckets, follow the instructions under
Creating a bucket to activate
them.
Using the client library with the development app server
You can use the client library with the development server. However because
there is no local emulation of Cloud Storage, all requests to read and write
files must be sent over the Internet to an actual Cloud Storage bucket.
To use the client library with the development app server:
Run dev_appserver.py with the flag --default_gcs_bucket_name [BUCKET_NAME],
replacing [BUCKET_NAME] with the name of the Cloud Storage bucket you are
using.
This flag controls the bucket that will be returned when your application
calls file.DefaultBucketName(ctx).
Pricing, quotas, and limits
There are no bandwidth charges associated with making calls to Cloud Storage from
App Engine's client library. However, there are
operations charges.
In addition, the calls count against your
URL fetch quota
as the library uses the URL Fetch service to interact with Cloud Storage.
Notice that Cloud Storage is a pay-to-use service;
you will be charged according to the Cloud Storage price sheet.
Alternative ways to access Cloud Storage
Instead of using the client library, you could use the following:
Cloud Storage Browser in the
Google Cloud console, which is useful for uploading objects quickly.
gsutil, which is a command-line tool for working with
files in Cloud Storage.
[[["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-08-25 UTC."],[[["\u003cp\u003eCloud Storage buckets can be used to store and serve static content like movies or images, and this document details setting up the environment to use the App Engine client library for Cloud Storage.\u003c/p\u003e\n"],["\u003cp\u003eTo use Cloud Storage, you must activate at least one bucket, with the default bucket offering 5GB of free storage and a free quota for I/O operations.\u003c/p\u003e\n"],["\u003cp\u003eThe App Engine client library for Cloud Storage can be downloaded using the \u003ccode\u003ego\u003c/code\u003e tool, allowing you to interact with Cloud Storage from your application.\u003c/p\u003e\n"],["\u003cp\u003eWhen using the client library with the development app server, all read and write requests are sent over the Internet to a real Cloud Storage bucket, and the \u003ccode\u003edev_appserver.py\u003c/code\u003e must include a flag specifying the bucket name.\u003c/p\u003e\n"],["\u003cp\u003eWhile there are no bandwidth charges for calls from App Engine's client library to Cloud Storage, there are operations charges, and these calls count against the URL fetch quota.\u003c/p\u003e\n"]]],[],null,["# Setting Up Google Cloud Storage\n\nYou can use a Cloud Storage bucket\nto store and serve files, such as movies or images or other static content. This\ndocument describes how to set up your environment to use the App Engine client\nlibrary for Cloud Storage.\n| This API is supported for first-generation runtimes and can be used when [upgrading to corresponding second-generation runtimes](/appengine/docs/standard/\n| go\n| /services/access). If you are updating to the App Engine Go 1.12+ runtime, refer to the [migration guide](/appengine/migration-center/standard/migrate-to-second-gen/go-differences) to learn about your migration options for legacy bundled services.\n\nSetting up your project\n-----------------------\n\nCreate a Google Cloud project, and understand how Go 1.11 apps are\nstructured in App Engine. Write down and save your project ID for use\nwith your application.\n\nActivating a Cloud Storage bucket\n---------------------------------\n\nTo use Cloud Storage, you'll need to activate at least one bucket.\nYou might want to use the default bucket which provides the first 5GB of\nstorage for free. You can activate and use another Cloud Storage\nbucket. The default bucket includes\nthe first 5GB of storage for free. The default bucket\nalso includes a free quota for Cloud Storage I/O operations. See\n[Pricing, quotas, and limits](#pricing_quotas_and_limits)\nfor more details.\n\nTo activate the default Cloud Storage bucket for your app:\n\n1. Click **Create** under *Default Cloud Storage Bucket* in the\n [App Engine settings](https://console.cloud.google.com/appengine/settings) page for your project.\n Notice the name of this bucket: it is in the form `\u003cproject-id\u003e.appspot.com`.\n\n2. If you need more storage than the 5GB limit, you can\n increase this by [enabling billing](https://console.cloud.google.com/billing) for your project,\n making this a paid bucket. You will be charged for storage over the 5GB limit.\n\nIf you want to activate one or more paid buckets, follow the instructions under\n[Creating a bucket](/storage/docs/cloud-console#_creatingbuckets) to activate\nthem.\n| **Note:** When you create a default bucket, you also get a staging bucket with the same name except that `staging.` is prepended to it. You can use this staging bucket for temporary files used for staging and test purposes; it also has a 5 GB limit, but it is automatically emptied on a weekly basis.\n\n### Setting bucket and object permissions\n\nYou can find information on allowing your app's service account or other users\naccess the storage bucket and its contents in\n[Setting bucket permissions](/storage/docs/cloud-console#_bucketpermission) and\n[Setting object permissions](/storage/docs/cloud-console#_permissions).\n\nDownloading the client library\n------------------------------\n\nThe App Engine client library for Cloud Storage is available via the `go` tool.\nTo download the library:\n\n1. Set your `GOPATH` if needed. If you are using Linux and macOS, you can\n set your `GOPATH` as follows:\n\n mkdir -p $HOME/go\n export GOPATH=$HOME/go\n\n | **Note:** For Windows instructions, see the [Windows](https://golang.org/doc/install#windows) section of [Getting Started with the Go Programming Language](https://golang.org/doc/install).\n2. Download the `oauth2`, `storage`, and `appengine` packages:\n\n go get -u golang.org/x/oauth2\n go get -u cloud.google.com/go/storage\n go get -u google.golang.org/appengine/...\n\n | **Note:** These packages will be downloaded to your `GOPATH`'s `src` directory.\n\nFor details about installing the client library, see the [Cloud Storage Client Libraries](/storage/docs/reference/libraries) page.\n\nUsing the client library with the development app server\n--------------------------------------------------------\n\nYou can use the client library with the development server. However because\nthere is no local emulation of Cloud Storage, all requests to read and write\nfiles must be sent over the Internet to an actual Cloud Storage bucket.\n\nTo use the client library with the development app server:\n\n1. [Activate a Cloud Storage bucket](#activating_a_cloud_storage_bucket).\n\n2. Run `dev_appserver.py` with the flag `--default_gcs_bucket_name [BUCKET_NAME]`,\n replacing `[BUCKET_NAME]` with the name of the Cloud Storage bucket you are\n using.\n\n This flag controls the bucket that will be returned when your application\n calls `file.DefaultBucketName(ctx)`.\n\nPricing, quotas, and limits\n---------------------------\n\nThere are no bandwidth charges associated with making calls to Cloud Storage from\nApp Engine's client library. However, there are\n[operations charges](/storage/pricing#operations-pricing).\nIn addition, the calls count against your\n[URL fetch quota](/appengine/docs/quotas#UrlFetch)\nas the library uses the URL Fetch service to interact with Cloud Storage.\n\nNotice that Cloud Storage is a pay-to-use service;\nyou will be charged according to the Cloud Storage [price sheet](/storage/pricing).\n\nAlternative ways to access Cloud Storage\n----------------------------------------\n\nInstead of using the client library, you could use the following:\n\n- [Cloud Storage Browser](https://console.cloud.google.com/storage/browser) in the Google Cloud console, which is useful for uploading objects quickly.\n- [gsutil](/storage/docs/gsutil), which is a command-line tool for working with files in Cloud Storage.\n\nWhat's next\n-----------\n\n- Visit the [API Reference documentation](https://godoc.org/cloud.google.com/go/storage).\n- Learn how to [read and write to Cloud Storage](/appengine/docs/legacy/standard/go111/googlecloudstorageclient/read-write-to-cloud-storage) with the App Engine client library for Cloud Storage.\n- Review the [App Engine and Google Cloud Storage sample](/appengine/docs/legacy/standard/go111/googlecloudstorageclient/app-engine-cloud-storage-sample).\n- View the complete set of [Cloud Storage documentation](/storage/docs), including additional samples and tutorials."]]