Skip to main content
Mount a cloud storage bucket inside a sandbox with a FUSE driver so your code reads and writes objects as ordinary files. This talks to the bucket directly, with no caching layer in between, which is the simplest option when a sandbox just needs to reach an existing S3, GCS, or R2 bucket. For a faster, cache-backed filesystem over object storage, use Archil; for a versioned, branchable workspace, use Mesa. The setup has two parts: bake the FUSE driver into a template, then mount at runtime with sandbox.commands.run.
These commands run as root (the template’s default user, unless a user build step changed it), so none of them use sudo.

Amazon S3

Install s3fs in a template.
At runtime, write the credentials file s3fs expects (ACCESS_KEY_ID:SECRET_ACCESS_KEY), then mount the bucket.
-o allow_other lets every process in the sandbox read the mount. Set endpoint and url to your bucket’s region: the example shows us-east-1, but s3fs needs them set explicitly for any other region (e.g. us-east-2). For the full option list, see the s3fs flags.

Google Cloud Storage

Google Cloud Storage uses gcsfuse. You’ll need a bucket and a service account with the Storage Object User role on it, plus a service account key. Install gcsfuse from Google’s apt repository in a template.
At runtime, write the service account key into the sandbox and mount with --key-file.
For the full option list, see the gcsfuse flags.

Cloudflare R2

R2 is S3-compatible, so it reuses the same s3fs template. The only difference is the mount command, which points s3fs at your R2 endpoint.