Skip to content
← Blog

How to deploy an app built with Claude Code, with sign-in and Postgres

Step-by-step: take an app Claude Code built from your laptop to a live URL with invite-only sign-in, a Postgres database, and a daily job. One prompt, one floo.app.toml, one floo deploy.

floo team

TL;DR

To deploy an app built with Claude Code, paste one line into Claude Code: Read https://getfloo.com/docs/introduction.md and deploy this app to floo. It writes a floo.app.toml, runs floo deploy, and hands you a live URL. Three short blocks in that file add invite-only sign-in, Postgres, and a daily job.

  • You approve one sign-in in your browser. Claude Code runs everything else.
  • Sign-in is one config line, and your code reads the signed-in person from request headers.
  • Postgres is one block, and DATABASE_URL appears in the app's environment.
  • Every push after the first deploys again, so the next change ships the same way.

Claude Code can build a working app in an afternoon. To make it something other people open, you need three more things: a URL that stays up, a database that keeps its data, and a way to let in only the people you choose. This guide does all three from the Claude Code session you already have open.

1. Ask Claude Code to deploy it

In the project folder, paste:

Read https://getfloo.com/docs/introduction.md and deploy this app to floo.

Claude Code reads the guide and works through it:

  1. It installs the floo CLI and runs floo auth login. You approve the sign-in in your browser.
  2. It adds a Dockerfile if the app has none. floo builds and runs that image, so Claude Code picks the language version, the system packages, and the start command.
  3. It runs floo init, which writes floo.app.toml, then floo deploy --preflight to check it.
  4. It commits and runs floo deploy.

If the project pushes to GitHub, the first deploy may stop once with a link to install the floo GitHub App on that repository. Open it, pick the repository, and tell Claude Code to continue. If the project has no GitHub repository, Claude Code asks whether to use floo deploy --hosted, which has floo keep the code.

When the deploy finishes, the app is live at https://<your-app>.getfloo.app.

2. Add invite-only sign-in

Ask Claude Code to set the access mode, or edit floo.app.toml yourself:

[app]
name = "stock-tracker"
access_mode = "accounts"

From the next deploy, floo's gateway sends anyone who isn't signed in to a hosted sign-in page and lets in only people you invite. Every request that reaches the app carries the signed-in person:

X-Floo-User-Email: dana@example.com
X-Floo-User-Id: u_123
X-Floo-User-Name: Dana

So Claude Code writes no login form, no session handling, and no user table. It reads one header. Invite people from the terminal:

floo apps invite dana@example.com --app stock-tracker

3. Add a Postgres database

Add one block:

[managed.default]
type = "postgres"

The next deploy creates the database and sets DATABASE_URL in the app's environment. Most Postgres libraries read that variable as is. If the app keeps its data in a local SQLite file or in memory, ask Claude Code to move it to Postgres now, because a container's files reset on every deploy.

To run database migrations on each deploy, add the command to the web service:

[services.web]
type = "web"
path = "."
port = 3000
ingress = "public"
migrate_command = "npm run migrate"

A failed migration stops the deploy before any traffic moves, so a bad change never reaches the people using the app.

4. Add a daily job

Many apps Claude Code builds need one thing to happen on a schedule: a morning report, a reminder, a sync. Add a cron block:

[cron.daily-report]
schedule = "0 8 * * *"
command = "node scripts/daily-report.js"
service = "web"

The job runs in the app's own image, in UTC, with the same database and secrets.

5. Keep changing it

Commit and push, and the app deploys again. A few things make the next fifty changes easy:

  • Secrets stay out of git. floo env set STRIPE_KEY --stdin --app stock-tracker stores a value the app reads from its environment.
  • Errors name the fix. When a deploy stops, the error says what to run next, and Claude Code runs it.
  • Rollback is one command. floo deploys --app stock-tracker lists past deploys, and floo rollback stock-tracker <deploy-id> puts one back.
  • Your agent can watch it. floo status --app stock-tracker --json gives Claude Code the state of the app without reading logs.

The whole file

[app]
name = "stock-tracker"
access_mode = "accounts"

[services.web]
type = "web"
path = "."
port = 3000
ingress = "public"
migrate_command = "npm run migrate"

[managed.default]
type = "postgres"

[cron.daily-report]
schedule = "0 8 * * *"
command = "node scripts/daily-report.js"
service = "web"

One file in git describes the app, its sign-in, its database, and its schedule. Claude Code reads it and changes it like any other file, and you review the change in a normal diff.

Next steps

Frequently asked questions

How do I deploy an app built with Claude Code?

Paste "Read https://getfloo.com/docs/introduction.md and deploy this app to floo." into Claude Code in the project. It installs the floo CLI, writes floo.app.toml and a Dockerfile if the app has none, and runs floo deploy. You approve one sign-in in the browser. The app goes live at a getfloo.app URL, and every later push deploys again.

How do I add sign-in to an app Claude Code built?

Set access_mode = "accounts" in floo.app.toml. floo's gateway puts invite-only sign-in in front of the app and passes the signed-in person to your code as request headers, so Claude Code writes no auth code. Invite people with floo apps invite.

How do I add a Postgres database?

Add a [managed.default] block with type = "postgres" to floo.app.toml. The next deploy creates the database and sets DATABASE_URL in the app's environment. Dev and prod get separate databases.

Does Claude Code need a GitHub repository to deploy?

No. floo deploys from a GitHub repository when the project has one. Without one, floo deploy --hosted has floo keep the code, and the app deploys the same way.

Get your app live.

read https://getfloo.com/agents.md and set me up on floo

Get an API key
Usage-based pricing. See plans →