> ## 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 an app from Codex

> Set up OpenAI's Codex CLI to deploy your app to floo from a GitHub repository or a floo-hosted one, then paste one prompt to get a live https://<app>-dev.getfloo.app URL.

Codex runs the floo CLI to write the config, push it, and deploy. Any language works when the repository has a `Dockerfile` that serves on `0.0.0.0:$PORT`; `floo init` offers to write one for a detected runtime.

## Set up your agent

Install the CLI and sign in from your own terminal, before starting Codex:

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

From the project root, install the floo skill where Codex reads skills, and point `AGENTS.md` at the agent guide:

```bash theme={null}
floo skills install --path .agents/skills/floo
echo 'For floo work, read https://getfloo.com/docs/guides/agent-setup.' >> AGENTS.md
```

Every floo command calls `https://api.getfloo.com`. When Codex runs in its `workspace-write` sandbox, allow network access in `~/.codex/config.toml`:

```toml ~/.codex/config.toml theme={null}
[sandbox_workspace_write]
network_access = true
```

## Agent prompt

Paste into Codex. Replace `my-app` with your app name.

```text theme={null}
Deploy this app to floo. App name: my-app.
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 my-app`. Set the port in floo.app.toml to the port the app listens on, and declare any Postgres, Redis, or Storage the app needs under [managed.<name>].
3. Run `floo preflight --json` and fix every error.
4. Commit and push to the default branch.
5. Have me open https://github.com/apps/getfloo/installations/new, choose the repository's owner, and select this repository. Wait for me to confirm.
6. Run `floo apps github setup --no-browser` and give me the printed link. Wait for me to confirm GitHub access.
7. Run `floo apps github connect <owner>/<repo> --no-browser`.
8. Run `floo deploys status --app my-app --json` until the deploy is live, then report the URL.
```

## floo.app.toml

The smallest config `floo init` writes for one web service:

```toml floo.app.toml theme={null}
[app]
name = "my-app"

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

Add `[managed.default]` with `type = "postgres"` for a database, `access_mode = "accounts"` under `[app]` for App sign-in, and `[cron.<name>]` for scheduled jobs. Patterns: [Configuring an app](https://getfloo.com/docs/guides/configuration.md).

## CLI commands

The same deploy by hand. Replace `owner/my-app` with your repository.

```bash theme={null}
floo init my-app
floo preflight
git add . && git commit -m "chore: deploy to floo"
git push origin main
floo apps github setup
floo apps github connect owner/my-app
floo deploys watch --app my-app
```

`floo apps github setup` needs the floo GitHub App installed on the repository's owner first. See [Quickstart steps 2 and 3](https://getfloo.com/docs/introduction.md#2-give-floo-access-to-your-github-repository).

## Verify

```bash theme={null}
floo deploys status --app my-app --json
floo logs query --app my-app --error
```

`deploys status` reports the live URL once the deploy is live. Load the URL, then read `logs query --error` for anything the app raised while serving it.

Every push to `main` deploys to dev. To publish to prod, run `gh release create v1 --repo <owner>/<repo>`. See [Environments](https://getfloo.com/docs/guides/environments.md#the-flow).

## Start without GitHub

floo can host the repository. `floo projects create` makes a Next.js app with App sign-in and managed Postgres, deploys it, and returns its URL, with no GitHub steps:

```bash theme={null}
floo projects create my-app
floo projects clone my-app
```

Start Codex in the cloned folder. Every push deploys to dev; `floo releases promote --app my-app` publishes to prod. See [projects](https://getfloo.com/docs/cli/projects.md).

## Next steps

> **[Build with your stack](https://getfloo.com/docs/build/nextjs.md)**
>
> End-to-end guides for Next.js, Rails, FastAPI, Django, and Express.

> **[Agent setup](https://getfloo.com/docs/guides/agent-setup.md)**
>
> JSON output, verification, and credential rules for agents.

> **[Logs and debugging](https://getfloo.com/docs/guides/logs.md)**
>
> Runtime logs, build logs, and a debug loop for a failed deploy.

> **[Agent webhooks](https://getfloo.com/docs/guides/agent-webhooks.md)**
>
> Send failed deploys and repeated errors to your agent.


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