Connecting to Cloud Storage buckets

Google Cloud Storage is a flexible, scalable, and durable storage option for your virtual machine instances. You can write files to Cloud Storage buckets from almost anywhere, so you can use buckets as common storage between your instances, Google App Engine, your on-premises systems, and other cloud services.

If Cloud Storage buckets do not meet your performance and latency requirements, you can use Cloud Storage in combination with other instance storage options.

Before you begin

Writing data to Google Cloud Storage buckets

Write files to Google Cloud Storage buckets through the gsutil tool or the Cloud Storage API.

gsutil


By default, the gsutil tool command is installed on all virtual machine instances that use supported operating systems.

  1. Connect to your instance through SSH. For this example, go to the VM instances page and click the SSH button next to the instance.

  2. If you have never used gsutil on this instance before, use the gcloud tool to set up credentials.

    gcloud init

    Alternatively, if your instance is configured to use a service account with a Google Cloud Storage scope, you can skip this step.

  3. Use the gsutil tool to create buckets and write data to those buckets. Optionally, you can also stream data to Cloud Storage.

API


If you configured your instance to use a service account with a Google Cloud Storage scope, you can use the Cloud Storage APIs to write data to Cloud Storage buckets.

  1. Connect to your instance through SSH. For this example, go to the VM instances page and click the SSH button next the instance.

  2. Install and configure a client library for your preferred language.

  3. Follow one of the insert examples and include code in your application that writes a file to a Cloud Storage bucket.

Mounting a bucket as a file system

You can use the Google Cloud Storage FUSE tool to mount a Cloud Storage bucket to your Compute Engine instance. The mounted bucket behaves similarly to a persistent disk even though Cloud Storage buckets are object storage.

To learn how to mount a Cloud Storage bucket on your instance, read Using Cloud Storage FUSE.

Monitor your resources on the go

Get the Google Cloud Console app to help you manage your projects.

Send feedback about...

Compute Engine Documentation