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 Python version.
- System packages, such as
ffmpeg, Chromium for headless browsing, orlibpq, each oneapt-get installline. - The build steps and the start command, including the Gunicorn worker count.
- 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
The application isapp.py with an app instance, and its dependencies are in requirements.txt:
requirements.txt
Dockerfile
COPY requirements.txt, so the layer is cached across pushes:
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.
floo.app.toml
migrate_command = "flask --app app db upgrade" under [services.web] if you use Flask-Migrate. Include the migrations/ folder in the image. It 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, 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.
floo deploy --hosted has floo host the repository. See Deploy without GitHub.
When it’s done:
Your Flask app is live at
https://my-flask-app.getfloo.app.Every git push origin main ships to dev.4. Add a Postgres database
floo.app.toml
MANAGED_CREDS_TO_WEB because the web service receives the database credentials. That is expected when the web service queries the database.
DATABASE_URL is injected into the runtime. psycopg 3 reads it as is, TLS settings included. Open one connection per request and close it when the request ends:
db.py
app.py
psycopg_pool.ConnectionPool or Flask-SQLAlchemy with postgresql+psycopg://. Dev and prod each get a separate Postgres database and credentials, with no shared state.
5. 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 Flask app.
app.py
floo dev --fixture-user (see section 7) or send the headers yourself with curl -H 'X-Floo-User-Email: you@example.com' .... Access modes and identity headers in full: App sign-in.
6. Add a custom domain
Declare the domain infloo.app.toml:
owner/repo with your GitHub repository. For a floo-hosted project, see Environments.
show prints, then watch
activation:
ProxyFix from Common gotchas, Flask reads the host from X-Forwarded-Host. DNS setup and troubleshooting: Custom domains.
7. Local development with dev credentials
Install the dependencies in a virtualenv first:dev_command locally with DATABASE_URL and readable env vars from the app’s dev environment: a real connection to your dev Postgres, 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.
The database exists after the first deploy that declares [managed.default]. Before that deploy, floo dev starts without DATABASE_URL.
To test signed-in flows, 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.
Common gotchas
-
/healthzis reserved. floo’s edge intercepts that exact path. Use/healthor/livez. -
Bind to
0.0.0.0. floo cannot reach127.0.0.1. -
Wrap the app in
ProxyFix. floo’s edge terminates TLS and forwardsX-Forwarded-Proto: https. WithoutProxyFix,url_for(..., _external=True)buildshttp://links and secure cookies misbehave: -
Set
SECRET_KEYfrom the environment if you use Flask sessions or flash messages:floo env set SECRET_KEY --stdin --secret --app my-flask-app, thenapp.secret_key = os.environ["SECRET_KEY"]. -
A
.dockerignorelisting.venvand__pycache__.COPY . .otherwise copies your local virtualenv into the image.
Next steps
App sign-in
Identity headers, access policies, and access modes in detail.
Cron jobs
Run a Flask CLI command on a schedule in the same image.
Dockerfiles
Layer order for fast pushes and recommended multi-stage builds.
Production environments
Dev vs prod, promotion, env overrides.