Skip to main content
Use this guide when your app needs object storage for uploads, generated assets, or other blobs.

1. Provision The Bucket

The command is idempotent — re-running is safe. It provisions a private GCS bucket, injects STORAGE_BUCKET and STORAGE_URL into your app’s environment, and updates .floo/services.lock. Commit the lock file alongside other changes. Dev and prod get separate bucketsSTORAGE_BUCKET differs per environment, so they never share object state. See Managed Services → Dev and prod isolation.

2. Ship The First Deploy

The first deploy bakes the storage env vars into the runtime.

3. How Your App Authenticates

floo runs your container as a dedicated per-app service account that already holds read/write (roles/storage.objectAdmin) on your bucket — and only your bucket. So your app reaches storage directly with the native Google Cloud Storage SDK: the SDK picks up that service account automatically through Application Default Credentials (ADC) on Cloud Run. You do not manage a key file, a JSON credential, or a project id. The only value your code needs is the bucket name:

4. Read And Write Objects

Use the native GCS SDK for your language with STORAGE_BUCKET. No credentials are passed in code — ADC supplies them at runtime.

5. Rails Active Storage

Point Active Storage at the google service. There is no credentials: and no project: — both come from ADC at runtime:
config/storage.yml
config/environments/production.rb
Use proxy mode (rails_storage_proxy, above): Rails streams blobs through your app with the SDK, and uploads go through your controllers (has_one_attached + a normal form post). Both are server-side and need no URL signing — the next section explains why that matters.

What floo Storage Grants (And What It Doesn’t)

floo grants your app read/write on its bucket, but deliberately not URL-signing — the permission a compromised container could abuse to mint links to any object. That boundary shapes what works:
  • Server-side read/write with the GCS SDK (sections 4–5).
  • Rails proxy-mode serving (rails_storage_proxy) and controller uploads (has_one_attached).
  • App-generated signed URLs, browser direct uploads, and Active Storage redirect-mode serving (rails_blob_url redirecting to a signed GCS URL). All need signing the app isn’t granted; proxy mode + server-side uploads cover the same use cases.
  • S3-compatible SDKs (aws-sdk-s3, Active Storage :amazon). floo mints no S3/HMAC keys — use the native GCS SDK / Active Storage :google.
STORAGE_URL is a floo operator endpoint: the dashboard and CLI call it with an admin key to mint short-lived signed URLs. It is not your app’s runtime path to storage — your app authenticates with the SDK as above, never by calling STORAGE_URL.

6. Debugging Checklist

If reads or writes fail:
Look for:
  • a missing STORAGE_BUCKET — confirm storage is in this service’s managed = [...] attachment
  • a 403 / permission error — the SDK isn’t using ADC; don’t pass an explicit key file, let the runtime supply credentials
  • code trying to sign a URL or use an S3 client — unsupported (see above), switch to proxy-mode serving and the native SDK

Managed Services Setup

See how storage and other managed services are provisioned.

Build a Rails app

End-to-end Rails on floo, including Active Storage.