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

# Install fleet-rlm

> Install fleet-rlm from source with uv, provision the Daytona snapshot, initialize Postgres to the Alembic head, and pin the pi-tui workspace.

fleet-rlm is distributed as a source repository. Install it with [uv](https://docs.astral.sh/uv/) and, if you plan to use the supervised `fleet cli` command, install the pi-tui workspace with pnpm.

## Prerequisites

* **Python 3.13**
* **[uv](https://docs.astral.sh/uv/)** package manager
* **Daytona API key** for Sandbox execution
* **Postgres** (`FLEET_DATABASE_URL`) for durable deployments; local SQLite works for development
* **Node 22.19+ and [pnpm](https://pnpm.io/)** if you want `fleet cli` to launch the pi-tui terminal client

## 1. Clone and sync

```bash theme={null}
git clone https://github.com/qredence/fleet-rlm.git
cd fleet-rlm
uv sync --all-extras --dev
```

`--all-extras --dev` installs the runtime, benchmarks, and test extras.

Verify the CLI entrypoints:

```bash theme={null}
uv run fleet --help
uv run fleet-rlm --help
```

## 2. Select a runtime profile

Non-secret policy lives in `config/fleet.toml`. Set `[config] default_profile` to one of the shipped profiles (`daytona`, `daytona-recursive`, `daytona-managed`, `daytona-bench`, `daytona-bench-40`) before starting the backend. The committed default is `daytona-recursive`.

Only the environment variables named by the selected profile are read. Unknown keys, missing profiles, invalid variable references, and absent TOML fail startup. See the [configuration reference](/fleet-rlm/reference/configuration) for the full env matrix.

## 3. Configure credentials

Copy the shipped template and fill only the variables named by the selected profile:

```bash theme={null}
cp .env.example .env
```

At minimum for the interactive profiles:

```ini theme={null}
FLEET_DAYTONA_API_KEY=...
FLEET_DATABASE_URL=postgresql+asyncpg://user:pass@host/db
FLEET_OPENCODE_GO_API_KEY=...
FLEET_OPENCODE_GO_BASE_URL=https://<gateway>/v1
```

Process exports override `.env` for those named values.

## 4. Provision the Daytona base snapshot

Fleet child sandboxes bootstrap from a reusable base snapshot. Build or refresh it once:

```bash theme={null}
make daytona-snapshot-check
# or, to rebuild explicitly:
uv run fleet-rlm daytona-snapshot --refresh
```

## 5. Bring the database to the Alembic head

Runtime startup never applies migrations. Initialize the configured database explicitly:

```bash theme={null}
uv run python scripts/db_init.py
uv run alembic upgrade head
uv run alembic check
```

`fleet cli` verifies the head before starting the backend and refuses to proceed otherwise. Recover from a mismatch by re-running `scripts/db_init.py` and retrying.

## 6. (Optional) Install pi-tui

`fleet cli` supervises the backend and runs the pi-tui terminal client in the foreground. Install its workspace once:

```bash theme={null}
cd tools/fleet-tui
pnpm install --frozen-lockfile
cd ../..
```

You can also connect a standalone pi-tui to an already-running backend:

```bash theme={null}
pnpm --dir tools/fleet-tui start -- --session <session-uuid>
```

Set `FLEET_API_URL` to point pi-tui at a non-default host, for example `http://127.0.0.1:9000`.

## 7. Verify

Run the Daytona doctor to validate settings, database head, provider auth, Volume visibility, mount scoping, and interpreter execution:

```bash theme={null}
uv run fleet doctor daytona
```

Then start Fleet:

```bash theme={null}
uv run fleet cli
# or, backend only:
uv run fleet-rlm serve-api --port 8000
```

## Common Makefile targets

| Target                        | What it does                                                              |
| ----------------------------- | ------------------------------------------------------------------------- |
| `make check`                  | Run the standard quality gate.                                            |
| `make check-security`         | Run security scanners.                                                    |
| `make build-release`          | Build the release artifacts.                                              |
| `make check-release`          | Run the release-readiness gate.                                           |
| `make api-sync`               | Regenerate `openapi.yaml` and `tools/fleet-tui/src/generated/openapi.ts`. |
| `make api-check`              | Verify both regenerated artifacts match the source.                       |
| `make daytona-snapshot-check` | Verify the required Daytona base snapshot exists.                         |

## Next steps

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/fleet-rlm/quickstart">
    Stream your first Turn.
  </Card>

  <Card title="Configuration reference" icon="gear" href="/fleet-rlm/reference/configuration">
    `config/fleet.toml` profiles and the full env matrix.
  </Card>

  <Card title="CLI reference" icon="terminal" href="/fleet-rlm/reference/cli">
    `fleet cli`, `fleet doctor daytona`, `fleet-rlm serve-api`.
  </Card>

  <Card title="Deployment" icon="cloud-arrow-up" href="/fleet-rlm/guides/deployment">
    Run the backend under process supervision.
  </Card>
</CardGroup>
