rails new) to a live app at https://<app>.getfloo.app, with managed Postgres, signed-in users, and your own domain.
New to floo? Start with the Quickstart.
What your agent controls
floo builds theDockerfile in your repository. Add one that specifies the runtime for your app:
- The base image and the exact Ruby version.
- System packages, such as
libvipsfor image processing,ffmpeg, or Chromium, each oneapt-get installline. - The build steps and the start command.
- More services from the same repository, such as a background worker or a cron job.
floo.app.toml. Store secrets outside git.
1. Add a Dockerfile
This walkthrough uses Postgres from the first deploy. Start a new app withrails new myapp --database=postgresql, or add the pg gem and run bundle install in your existing app before continuing.
rails new on Rails 7.1+ writes a production-ready Dockerfile. If yours has none, generate one with the dockerfile-rails gem:
Dockerfile
RAILS_ENV=production is set before assets:precompile so the production asset pipeline runs, and SECRET_KEY_BASE_DUMMY=1 lets Rails 7.1+ precompile without the real secret, which is not available at build time.
2. Initialize the floo config
Install the CLI and sign in:curl -fsSL https://getfloo.com/install.sh | bash, then floo auth login. An agent can run the same journey over the HTTP API instead, starting from getfloo.com/agents.md.
From the repo root:
floo.app.toml. For a single-service Rails app:
floo.app.toml
migrate_command runs as a one-off job with the new image before traffic
moves to it. A failed migration stops the deploy. Use
expand-then-contract migrations
to keep the schema compatible with both old and new code.
3. Connect the repo and deploy
floo builds from your GitHub repository (public or private), not local files, so commit first.floo deploy pushes the commit and waits until the dev URL is live. The first time, it stops with one link if the floo GitHub App can’t read the repository yet: a human opens it and installs the App on the account that owns the repository, then you run floo deploy again. See Give floo access to your GitHub repository.
Rails can’t boot without SECRET_KEY_BASE, and floo sets env vars only on an app that exists. So the first floo deploy creates the app and its deploy fails at boot. That is expected: set the secret, then rebuild. The asset-build dummy is not a runtime secret.
Your Rails app is live at
https://my-rails-app.getfloo.app.Every git push origin main ships to dev.4. Add a Postgres database
The declaration in step 2 provisions Postgres on the first deploy and injectsDATABASE_URL plus the standard PG* component variables. Use Postgres for persistent application data; a default SQLite database in the container filesystem is ephemeral.
Rails reads DATABASE_URL automatically. Confirm config/database.yml has the production block:
config/database.yml
bin/rails db:migrate against the database. Dev and prod each get a separate database and credentials, with no shared state and no cross-environment leaks.
DATABASE_URL is a normal PostgreSQL URI that ActiveRecord parses directly, with no custom socket parsing in config/database.yml.
floo deploy --preflight also warns if a local env file still contains the old socket-style DATABASE_URL shape (postgresql://user:pass@/db?host=/cloudsql/...), which Ruby’s URI parser rejects before Rails can boot.
Need embeddings? Add CREATE EXTENSION IF NOT EXISTS vector; to your first migration, then declare a bare vector column (t.vector :embedding, limit: 1536, or the neighbor gem). See Postgres → Vector search.
5. Add Redis (cache, jobs, Action Cable)
Managed Redis is cache-only: treat its contents as disposable. floo makes no backup, restore, or durability guarantee for it; keep authoritative data in Postgres.floo.app.toml
REDIS_URL_CACHE (a rediss:// URL). One instance can back Rails cache, Sidekiq, and Action Cable at once:
config/environments/production.rb
config/initializers/sidekiq.rb
config/cable.yml
web and worker declare redis:cache, so floo injects the same REDIS_URL_CACHE into both. A worker takes no deployed HTTP traffic, and its ingress defaults to internal. The local floo dev runner requires a distinct port in the config even for a worker. Because the worker shares the web build, it must declare its own command:
floo.app.toml
SECRET_KEY_BASE too. floo env set stores a value on the service it targets and needs that service to exist, so commit and push to deploy the worker, then give it the same secret as web and restart dev:
$SECRET_KEY_BASE holds the value you set in step 3; secrets cannot be read back, so keep it in your password manager. With two services, floo env set needs --service to name the one it targets.
Want cache and queue on physically separate instances? Declare named ones ([managed.cache], [managed.queue]) and read REDIS_URL_CACHE / REDIS_URL_QUEUE. See Redis.
6. Add file storage (Active Storage)
floo.app.toml
STORAGE_BUCKET_UPLOADS and the STORAGE_S3_*_UPLOADS keys. Add it to the web service’s existing attachment list: managed = ["postgres", "redis:cache", "storage:uploads"]. Add gem "aws-sdk-s3", require: false and configure Active Storage:
config/storage.yml
config/environments/production.rb
:google service remains an alternative with Application Default Credentials:
config/storage.yml
:google, use config.active_storage.service = :google and config.active_storage.resolve_model_to_route = :rails_storage_proxy; upload through a Rails controller. Services created before v2026.09.27.1 have no S3 keys; use :google, or migrate and verify data in a new named service before removing the old one. New buckets allow browser POST uploads through floo’s signed policy, but Rails direct uploads use PUT, which the default CORS policy does not allow. See Cloud storage.
7. Add per-user auth
Setaccess_mode = "accounts" and floo handles sign-in:
floo.app.toml
- Redirects unauthenticated requests to a hosted login page.
- Validates the session cookie on every request.
- Injects identity headers into every request that reaches your Rails app.
app/controllers/application_controller.rb
floo dev --fixture-user (see section 9). It injects the same X-Floo-User-* headers floo’s gateway adds in production, so the controller above works locally with no conditional code. Access modes and identity headers in full: App sign-in.
8. Add a custom domain
Declare the domain infloo.app.toml:
floo env set targets dev unless you pass --env prod, so prod starts without SECRET_KEY_BASE. Give prod its own secret on both services before the first release:
Replace owner/repo with your GitHub repository. For a floo-hosted project, see Environments.
show prints, then watch
activation:
request.host for request-scoped URLs. Mailers have no request context: set config.action_mailer.default_url_options = { host: "app.example.com", protocol: "https" } in the production environment config. DNS setup and troubleshooting: Custom domains.
9. Local development with dev credentials
After the first deploy, iterate locally against dev without redeploying.Local dev server
dev_command (the bin/rails server line in floo.app.toml) locally with DATABASE_URL and readable env vars from the app’s dev environment: a real connection to your dev Postgres from your laptop, with no credentials in your shell history. Write-only secrets are withheld; supply separate local values when needed. Prod credentials never reach a local session.
To test signed-in flows without a fixture-user shim in your Rails code, add --fixture-user:
floo dev then puts a proxy in front of each accounts-mode service that injects the same X-Floo-User-* headers floo’s gateway adds in production. The output table shows the raw service URL and the auth-proxied URL; use the auth-proxied one for any path that reads identity headers.
One-shot commands: rake tasks, console, db:seed
floo run executes one command, with no server, using the same dev-environment env vars floo dev injects. Pass the command after --:
floo run inherits stdin, stdout, and stderr, so interactive commands like bin/rails console and byebug work as they do locally. The difference is that the command sees floo-injected env vars instead of your local .env.
Common gotchas
/healthzis reserved. floo’s edge intercepts that exact path. Use/healthor/livezfor health checks.bind: 0.0.0.0, notlocalhost. Rails binds to localhost by default in some configs, which floo cannot reach.- Asset compilation. The Dockerfile above sets
RAILS_SERVE_STATIC_FILES=1so Rails serves precompiled assets directly. - Force-SSL. Rails 7+ defaults
config.force_ssl = truein production. floo’s edge terminates TLS and forwardsX-Forwarded-Proto: https, so this works without extra config. - Schema dumps. See Postgres → Schema portability across dev and prod.
Next steps
App sign-in
Identity headers, access policies, and access modes in detail.
Managed services
Postgres, Redis, Storage: what they cost and how isolation works.
Custom domains
DNS, verification, multi-service routing.
Production environments
Dev vs prod, promotion, env overrides.