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

# Environment variables reference

> Reference for all environment variables that control Rootprint behavior.

Rootprint reads its configuration from environment variables at startup. For Docker deployments, set these under the `environment` key of the `rootprint` service in `docker-compose.yml`.

<Note>
  `QUICKWIT_URL` must point at a Quickwit `0.9` or later instance. Rootprint does not support
  older Quickwit releases.
</Note>

## Required

| Variable       | Description                                                                                                                                                                                     |
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `DATABASE_URL` | PostgreSQL connection string (e.g. `postgres://rootprint:rootprint@db:5432/rootprint`). No default.                                                                                             |
| `ORIGIN`       | Canonical public URL of this Rootprint instance (e.g. `https://logs.example.com`). Used for Better Auth callbacks, invite links, CORS allow-list, and cookies. No default. Must be a valid URL. |
| `QUICKWIT_URL` | Quickwit REST endpoint (e.g. `http://quickwit:7280`). No default. Must be a valid URL.                                                                                                          |

Rootprint refuses to start if any required variable is missing, empty, or (for URL variables) not parseable as an `http://` or `https://` URL.

## Optional

| Variable             | Default          | Description                                                                                                                                                                                                                          |
| -------------------- | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `BETTER_AUTH_SECRET` | Auto-generated   | Secret used to sign session tokens. If unset, Rootprint generates a random 32-byte secret on first boot and persists it in the `app_settings` table; subsequent boots read the row. If set, must be ≥32 characters or startup fails. |
| `FRONTEND_URL`       | Same as `ORIGIN` | Additional allowed CORS origin. Use this only in split deployments where the SPA is hosted on a different origin than the API. Cookie domain, invite link host, and Better Auth `baseURL` always derive from `ORIGIN`, not this.     |
| `PORT`               | `8282`           | HTTP listen port. Remap the port with the compose `ports:` block instead of changing this.                                                                                                                                           |

## Docker Compose example

```yaml theme={"theme":"github-light"}
services:
  rootprint:
    image: ghcr.io/rootprint/rootprint:latest
    environment:
      DATABASE_URL: postgres://rootprint:rootprint@db:5432/rootprint
      ORIGIN: https://logs.example.com
      QUICKWIT_URL: http://quickwit:7280
    ports:
      - '8282:8282'
```
