GCS Fuse allows you to mount a Google bucket as a file system. It’s similar to S3FS.

Setup repo

sudo tee /etc/yum.repos.d/gcsfuse.repo > /dev/null 

Yum install

sudo yum install gcsfuse

For Ubuntu or Linux Mint, download the deb package.

curl -L -O https://github.com/GoogleCloudPlatform/gcsfuse/releases/download/v0.39.2/gcsfuse_0.39.2_amd64.deb
sudo dpkg --install gcsfuse_0.39.2_amd64.deb
rm gcsfuse_0.39.2_amd64.deb

Check if installed.

gcsfuse -v

Login.

gcloud auth login
gcloud auth application-default login

Setup mount.

mkdir -p /path/to/mount
chown username:username /path/to/mount

Mount it.

gcsfuse my-bucket /path/to/mount

Alternative using service account key.

gcsfuse my-bucket /path/to/mount --key-file /root/key.json --uid=xxx --gid=xxx -o rw,allow_other 

Automatic mount in /etc/fstab.

my-bucket /path/to/mount gcsfuse _netdev,allow_other,user,rw,uid=1000,gid=1000 0 0

Unmount

fusermount -u /path/to/mount