Skip to main content
To mount a Google Cloud Storage (GCS) bucket on a Linux machine as a file system, the standard tool is Cloud Storage FUSE (gcsfuse). This tool allows you to access your bucket via standard file system commands (like ls, cp, cat), though it acts differently than a standard hard drive (higher latency, different consistency model).

Step 1: Install gcsfuse

First, you need to configure the Google Cloud package repository and install the tool. For Ubuntu/Debian:
For CentOS/RHEL:

Step 2: Authenticate

You need to provide credentials so the Linux machine can access your bucket.

Step 3: Mount the Bucket

Create a directory to serve as the mount point and run the mount command

Common Issues & Options

Empty Directories: GCS is an object store, not a true filesystem. It doesn’t really have “folders.” If you don’t see your folders, add the --implicit-dirs flag:
Permissions: By default, only the user who mounted the bucket can access it. To allow other users (like a web server) to access it, use allow_other

Step 4: Permanent Mount (Optional)

To have the bucket mount automatically when the server restarts, you must edit the /etc/fstab file.
  1. Open the file: sudo nano /etc/fstab
  2. Add a line at the bottom:
  1. Note: Ensure the user running the mount has read access to the key file.

Important Limitations

  • Latency: It is much slower than a local disk. Do not run a database (like MySQL or Postgres) on a mounted bucket.
  • Cost: Listing files (ls) and reading files counts as operations and can incur costs (Class A/B operations).
  • Consistency: It offers “close-to-open” consistency. You might not see a file immediately after writing it if you are checking from a different machine.