# Configuration variables reference (https://docs.opensequence.dev/reference/configuration)

Every SEQ_* environment variable the service reads, with its type and default, validated once at boot.

<Note>This page is generated from `apps/server/src/config/env.ts` by `pnpm generate`. Do not edit it by hand; change the source and regenerate.</Note>

The process refuses to start when a required value is missing or malformed, with a sentence that says which one. Values come from the environment only; there is no configuration file.

| Variable | Type | Required | Default | Meaning |
| --- | --- | --- | --- | --- |
| `SEQ_DB_DSN` | string | yes |  | Postgres connection string. Only Postgres is supported. A transaction pooler is fine: no session-level features are used. |
| `SEQ_QUEUE` | `postgres`, `redis`, `memory` | no | `"postgres"` | The queue backend. `postgres` needs nothing else and is a transactional outbox; `redis` needs SEQ_REDIS_DSN; `memory` is for development and tests only. |
| `SEQ_REDIS_DSN` | string | with `SEQ_QUEUE=redis` |  | Redis connection, required when SEQ_QUEUE=redis. Enable persistence on the Redis side. |
| `SEQ_ENCRYPTION_KEYS` | string | yes |  | Encryption keys for every stored secret, `id:base64key[,id:base64key...]`; the first entry encrypts, every entry decrypts. Generate one with `oseq secrets new-key`. Back it up with the database: without it the stored secrets are unreadable and must be re-entered. |
| `SEQ_ADMIN_TOKEN` | string | for `api` and `all` |  | The operator token that creates projects and keys (`/v1/admin/*`). Required by the `api` and `all` roles. Long and random. |
| `SEQ_PUBLIC_URL` | URL | no | `"http://localhost:8080"` | The base URL providers call back: inbound webhooks and the opt-out links. The OpenAPI document served by the instance lists it as its server. |
| `SEQ_PORT` | number | no | `8080` | HTTP port. The API for `api` and `all`; `/healthz` and `/readyz` only for `worker`. |
| `SEQ_HOST` | string | no | `"0.0.0.0"` | The interface to bind. |
| `SEQ_ROLES` | `api`, `worker`, `all` | no | `"all"` | `api` serves HTTP, `worker` runs the scheduler and the queue consumers, `all` does both in one process. |
| `SEQ_RUN_MIGRATIONS` | flag: `1` or `true` | no |  | Apply the `seq` and `seq_auth` migrations at boot, serialized by a row lock so replicas starting together do not race. |
| `SEQ_CONCURRENCY` | number | no | `8` | Messages in flight per queue per replica. |
| `SEQ_DISABLED_CHANNELS` | comma-separated list | no |  | Platform-wide kill switch per channel, comma-separated (`sms`). Steps on a disabled channel are deferred, not skipped. |
| `SEQ_PAUSED` | flag: `1` or `true` | no |  | Platform-wide stop: the planner claims nothing while it is on. In-flight steps finish. |
| `SEQ_DEV_MOCK_PROVIDERS` | flag: `1` or `true` | no |  | Every project uses the `mock` adapters: nothing reaches a mail server, Allo or Attio, sends land in the timeline, and `POST /hooks/mock/\{slug\}` simulates replies, bounces and calls. Refused when NODE_ENV=production. |
| `SEQ_LOG_LEVEL` | `fatal`, `error`, `warn`, `info`, `debug`, `trace` | no | `"info"` | Pino log level. |
| `SEQ_METRICS` | flag: `1` or `true` | no |  | Reserved for a Prometheus `/metrics` endpoint. Accepted by the schema; the endpoint is not served yet. |
| `SEQ_DB_POOL` | number | no | `10` | Postgres connections per process. |
| `NODE_ENV` | string | no | `"development"` | `production` turns off pretty logs and refuses SEQ_DEV_MOCK_PROVIDERS. |

Three rules are checked after parsing: `SEQ_QUEUE=redis` needs `SEQ_REDIS_DSN`; the `api` and `all` roles need `SEQ_ADMIN_TOKEN`; `SEQ_DEV_MOCK_PROVIDERS` is refused when `NODE_ENV=production`.
