[Cloud Storage FUSE](https://docs.cloud.google.com/storage/docs/cloud-storage-fuse/overview.md.txt) lets you mount a Cloud Storage bucket as a local
file system, so you can interact with your objects using standard file system
semantics. In this quickstart, you install Cloud Storage FUSE on Debian or Ubuntu,
mount a bucket as a folder on your machine, and upload an object to the bucket.

You'll use the [Google Cloud CLI](https://docs.cloud.google.com/sdk/gcloud.md.txt) to create and manage
the object in your storage bucket, and you'll use the
[Cloud Storage FUSE CLI](https://github.com/GoogleCloudPlatform/gcsfuse) to mount your bucket to your machine.

## Before you begin

To set up a project, complete the following steps:

1. Have a Cloud Storage bucket that you want to mount. If you don't already have one, [create a new
   bucket](https://docs.cloud.google.com/storage/docs/creating-buckets).

<br />

## Install Cloud Storage FUSE

To install Cloud Storage FUSE, follow the instructions in [Install Cloud Storage FUSE](https://docs.cloud.google.com/storage/docs/cloud-storage-fuse/install.md.txt).

## Mount the bucket

To mount the bucket to your local file system, complete the following steps:

1. Generate Application Default Credentials using the
   `gcloud auth application-default login` command:

   ```
   gcloud auth application-default login
   ```

   Cloud Storage FUSE automatically loads the credentials.
2. Create a directory to mount the storage bucket to:

   ```
   mkdir "$HOME/mount-folder"
   ```
3. Mount your storage bucket using the `gcsfuse` command:

   ```
   gcsfuse BUCKET_NAME "$HOME/mount-folder"
   ```

   Replace <var translate="no">BUCKET_NAME</var> with the name of the bucket you want to mount.

   If successful, the command returns output which contains text similar to the following:

   ```
   File system has been successfully mounted.
   ```

## Upload an object into the bucket

To download an example object and upload it to the mounted bucket, complete the
following steps:

![The image of a kitten to upload into the bucket.](https://docs.cloud.google.com/static/storage/images/kitten.png)

1. Right-click the image and save it somewhere on your computer,
   such as on the desktop.

   You can also download the image using the cURL command
   `curl -O https://cloud.google.com/storage/images/kitten.png`.
2. Copy the image from its saved location to the folder where your bucket is
   mounted, using the `cp` command:

   ```
   cp kitten.png "$HOME/mount-folder/kitten.png"
   ```
3. Verify that the image was copied to your local file system and uploaded to the
   bucket successfully by following the steps:

   1. To check that `kitten.png` was copied to your local file system, run `ls`
      on the folder where your bucket is mounted:

      ```
      ls "$HOME/mount-folder"
      ```

      If the copy operation was successful, `kitten.png` is returned in the
      output.
   2. To list the contents of your bucket, use the `gcloud storage ls`
      command:

      ```
      gcloud storage ls gs://BUCKET_NAME
      ```

      Replace <var translate="no">BUCKET_NAME</var> with the name of your bucket.

      If the image was successfully uploaded to your bucket, `kitten.png` is
      returned in the output.

## Clean up

To avoid incurring charges to your Google Cloud account for the resources used
on this page, delete the resources by completing the following steps:

1. Unmount the storage bucket from your Linux machine by using the `fusermount`
   tool:

   ```
   fusermount -u "$HOME/mount-folder"
   ```
2. To delete the bucket and everything inside of it, use the
   `gcloud storage rm` command with the `--recursive` flag:

   ```
   gcloud storage rm gs://BUCKET_NAME --recursive
   ```

   Replace <var translate="no">BUCKET_NAME</var> with the name of your bucket.

   If successful, the command returns output similar to the following:

   <br />

   ```
   Removing gs://my-bucket/kitten.png#1676488739323620...
    Removing gs://my-bucket/...
   ```

   <br />

## What's next

- Get a [detailed overview of Cloud Storage FUSE](https://docs.cloud.google.com/storage/docs/cloud-storage-fuse/overview.md.txt).

- Read about ways to [mount buckets for different use cases](https://docs.cloud.google.com/storage/docs/cloud-storage-fuse/mount-bucket.md.txt#examples).

- Learn how to use [Cloud Storage agent skills](https://docs.cloud.google.com/storage/docs/agents-skills-overview.md.txt#fuse-skill) to automate
  mounting and cache configuration with AI coding assistants.

<!-- -->

- Learn how [Vertex AI uses Cloud Storage FUSE](https://docs.cloud.google.com/gemini-enterprise-agent-platform/machine-learning/training/code-requirements.md.txt#fuse) to mount Cloud Storage buckets for custom training jobs.