> ## Documentation Index
> Fetch the complete documentation index at: https://getfloo.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Deploy a customer-facing app built with AI

> Deploy a customer-facing app with Postgres, a public prod URL, and private dev and preview environments.

Deploy your app with managed Postgres and a custom domain. Customers use prod, which runs the versions you release. Dev and previews use invite-only sign-in while you review changes. For customer sign-up and sign-in, add [User accounts](https://getfloo.com/docs/guides/user-accounts.md).

Requires the app's source in a GitHub repository with a `Dockerfile` that serves on `0.0.0.0:$PORT`. [Dockerfiles](https://getfloo.com/docs/guides/dockerfiles.md) has one to copy for Next.js, Rails, Django, FastAPI, and Express. The examples use Next.js on port 3000.

## Set up your agent

```bash theme={null}
curl -fsSL https://getfloo.com/install.sh | bash
floo auth login
```

For Claude Code, also run `floo skills install --path .claude/skills/floo`. Cursor, Codex, and other agents: [Agent setup](https://getfloo.com/docs/guides/agent-setup.md).

## Agent prompt

Paste into your agent. Replace `storefront` with your app name.

```text theme={null}
Deploy this app to floo for customers, with Postgres. App name: storefront.
1. Confirm the floo org with `floo orgs list`. If the org has no plan, have me run `floo billing upgrade`.
2. Run `floo init storefront`. In floo.app.toml, set access_mode = "public" under [app], set port 3000 on [services.web], and add [managed.default] with type = "postgres".
3. Add [environments.dev] and [environments.preview], each with access_mode = "accounts", so only invited people see unreleased work.
4. Read DATABASE_URL from the environment on the server only. Never send it, or any secret, to the browser.
5. Run `floo deploy --preflight --json` and fix every error.
6. Commit everything with git.
7. Run `floo deploy --json`. It deploys from the GitHub repository this folder pushes to. If the folder has no remote, ask me whether to run `floo deploy --github --json` (a new private repository) or `floo deploy --hosted --json` (floo hosts the code).
8. If it stops with a link in `next[0].open`, give me the link and wait for me to confirm I installed the floo GitHub App on the repository's owner, then run `floo deploy --json` again.
9. Report the dev URL. `floo status --app storefront --json` shows whether it is live and, if not, why.
```

## floo.app.toml

```toml floo.app.toml theme={null}
[app]
name = "storefront"
access_mode = "public"

[services.web]
type = "web"
path = "."
port = 3000
ingress = "public"

[managed.default]
type = "postgres"

[environments.dev]
access_mode = "accounts"

[environments.preview]
access_mode = "accounts"

[domains."shop.example.com"]
service = "web"
```

`[app] access_mode = "public"` opens prod to anyone. The two `[environments.<env>]` overrides keep dev and previews invite-only. Dev and prod each get their own Postgres with separate credentials, injected as `DATABASE_URL`. The first prod release creates the domain.

## Deploy to dev, then release to prod

```bash theme={null}
floo init storefront
floo deploy --preflight
git add . && git commit -m "feat: deploy storefront to floo"
floo deploy
```

Every push to the default branch deploys to dev at `https://storefront.getfloo.app`, signed in. When a version is ready for customers, replace `owner/repo` with your GitHub repository and release it:

```bash theme={null}
floo status --wait --app storefront
gh release create v1 --repo owner/repo
```

Once the release's commit is live in dev, floo deploys it to prod at `https://storefront-prod.getfloo.app`. A push never changes prod. For an app floo hosts, run `floo promote --app storefront` instead.

## Point your domain at prod

The first prod release prints the DNS records for `shop.example.com`. Read them again at any time:

```bash theme={null}
floo domains show shop.example.com --app storefront
```

Publish the records at your DNS provider. floo activates the domain once they resolve. See [Custom domains](https://getfloo.com/docs/guides/custom-domains.md) for apex domains and troubleshooting.

## Verify

```bash theme={null}
floo status --app storefront --json
floo deploys --app storefront --env prod
curl -I https://storefront-prod.getfloo.app
```

The `curl` returns your page with no redirect to sign-in. Opening the dev URL in a private window shows floo's sign-in page.

## Next steps

> [card] [Custom domains](https://getfloo.com/docs/guides/custom-domains.md)
>
> DNS records, activation, apex domains, and per-service domains.

> [card] [Production environments](https://getfloo.com/docs/guides/environments.md)
>
> Releases, per-environment env vars, and the two URLs.

> [card] [Releases and rollbacks](https://getfloo.com/docs/guides/rollbacks.md)
>
> Put the previous version back when a release goes wrong.

> [card] [Preview environments](https://getfloo.com/docs/guides/preview-environments.md)
>
> Review each pull request on its own URL and database branch.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.