Skip to content

next-site environment

Generation creates .env from .env.example and fills PAYLOAD_SECRET and PREVIEW_SECRET with random values (yarn env:init does the same later).

VariableWhat to set
DATABASE_URL
default postgres://root:postgres@localhost:5432/main

Postgres, from compose.yml.

Production: postgresql://<user>:<password>@<host>:5432/<db>?sslmode=require.

Where to get it: Your PostgreSQL provider.

Payload's own database. In development Payload pushes schema changes straight to it; in production pending migrations run when the server starts. See PostgreSQL.
PAYLOAD_SECRET
empty by default

Signs Payload's session tokens. Any long random string; changing it signs everyone out. Generate one with: openssl rand -hex 32

Production: A long random string, different per environment.

Where to get it: openssl rand -hex 32; yarn env:init fills an empty one.

Signs Payload's session tokens. Changing it signs everyone out, owner and customers alike.
NEXT_PUBLIC_SERVER_URL
default http://localhost:3000

The site's public origin, used for absolute links (emails, SEO, previews).

Production: The site's public origin, e.g. https://example.com.

Inlined at build time (a Docker build argument, not runtime env), so an image is pinned to one origin. Used for absolute links in emails, SEO metadata and previews.
PREVIEW_SECRET
empty by default

Lets the admin's live preview open drafts. Any random string.

Production: A random string.

Where to get it: yarn env:init fills an empty one.

Lets the admin's live preview open draft pages. Anyone holding it can view drafts.
SMTP_HOST
default localhost

Outgoing email. The compose stack's Mailpit catches everything sent to localhost:1025 (UI on http://localhost:8025). Leave SMTP_HOST empty and emails are written to the server log instead of sent.

Production: Your mail provider's SMTP host.

See Email (SMTP), including a local catcher.
SMTP_PORT
default 1025

Outgoing email. The compose stack's Mailpit catches everything sent to localhost:1025 (UI on http://localhost:8025). Leave SMTP_HOST empty and emails are written to the server log instead of sent.

Production: 465 (TLS) or 587.

1025 for the compose stack's Mailpit. Port 465 turns on TLS.
SMTP_USER
empty by default

Outgoing email. The compose stack's Mailpit catches everything sent to localhost:1025 (UI on http://localhost:8025). Leave SMTP_HOST empty and emails are written to the server log instead of sent.

Production: The SMTP username.

Where to get it: Your mail provider.

Optional: leave empty for a server without authentication, such as Mailpit.
SMTP_PASS
empty by default

Outgoing email. The compose stack's Mailpit catches everything sent to localhost:1025 (UI on http://localhost:8025). Leave SMTP_HOST empty and emails are written to the server log instead of sent.

Production: The SMTP password.

Where to get it: Your mail provider.

Only sent when SMTP_USER is set.
MAIL_FROM_ADDRESS
default no-reply@example.com

Outgoing email. The compose stack's Mailpit catches everything sent to localhost:1025 (UI on http://localhost:8025). Leave SMTP_HOST empty and emails are written to the server log instead of sent.

Production: An address on a domain your mail provider is allowed to send for.

The sender of every email the site sends (orders, form submissions, password resets). A domain without SPF/DKIM for your provider lands in spam.
MAIL_FROM_NAME
default Acme Corp

Outgoing email. The compose stack's Mailpit catches everything sent to localhost:1025 (UI on http://localhost:8025). Leave SMTP_HOST empty and emails are written to the server log instead of sent.

Production: The business's name.

Shown as the sender name in inboxes.
COMPANY_NAME
default Acme Corp

Shown in the footer and SEO metadata.

Production: The legal or trading name.

Shown in the footer copyright line; falls back to SITE_NAME.
SITE_NAME
default Acme Corp

Shown in the footer and SEO metadata.

Production: The business's display name.

The default page title, link-preview site name, and the header text until the owner uploads a logo.
MEDIA_DIR
empty by default

Where uploaded media is stored. Defaults to ./media; the Docker image uses /app/media, which should be a volume.

Production: Leave unset in the Docker image (/app/media).

Where uploads are stored; defaults to ./media. In Docker, mount a volume at /app/media or uploads vanish with the container.
OPENOBSERVE_URL
default https://o2.aurostack.co
feature telemetry

OpenTelemetry → OpenObserve (server): traces, logs and metrics. Leave empty and telemetry stays off. OPENOBSERVE_TOKEN is the org's ingestion token (IAM → Ingestion Tokens, o2oi_…). Any other OTLP backend: set OTEL_EXPORTER_OTLP_ENDPOINT/HEADERS instead.

Production: Your OpenObserve instance.

Telemetry is on only when the URL, org and token are all set. See OpenObserve.
OPENOBSERVE_ORG
empty by default
feature telemetry

OpenTelemetry → OpenObserve (server): traces, logs and metrics. Leave empty and telemetry stays off. OPENOBSERVE_TOKEN is the org's ingestion token (IAM → Ingestion Tokens, o2oi_…). Any other OTLP backend: set OTEL_EXPORTER_OTLP_ENDPOINT/HEADERS instead.

Production: The project's organization identifier.

Where to get it: OpenObserve → organization settings (or the org segment of its URLs).

OPENOBSERVE_TOKEN
empty by default
feature telemetry

OpenTelemetry → OpenObserve (server): traces, logs and metrics. Leave empty and telemetry stays off. OPENOBSERVE_TOKEN is the org's ingestion token (IAM → Ingestion Tokens, o2oi_…). Any other OTLP backend: set OTEL_EXPORTER_OTLP_ENDPOINT/HEADERS instead.

Production: The organization's ingestion token (o2oi_…).

Where to get it: OpenObserve → IAM → Ingestion Tokens.

Write-only, but secret: never use it in a browser app (front ends use a RUM token).
OTEL_SERVICE_NAME
default acme-site
feature telemetry

OpenTelemetry → OpenObserve (server): traces, logs and metrics. Leave empty and telemetry stays off. OPENOBSERVE_TOKEN is the org's ingestion token (IAM → Ingestion Tokens, o2oi_…). Any other OTLP backend: set OTEL_EXPORTER_OTLP_ENDPOINT/HEADERS instead.

Production: A distinct name per site, e.g. kofi-bakery.

The service name on every server span and the default stream name. Browser data is sent as <name>-web.
NEXT_PUBLIC_OPENOBSERVE_URL
default https://o2.aurostack.co
feature telemetry

Browser monitoring (RUM). The client token is a RUM token (Ingestion → RUM): write-only and meant to ship in the bundle — never the ingestion token above. The instance must list this site's origin in ZO_CORS_ALLOWED_ORIGINS.

Production: Your OpenObserve instance.

Browser monitoring is on only when the URL, org and client token are all set. Inlined at build time. See OpenObserve.
NEXT_PUBLIC_OPENOBSERVE_ORG
empty by default
feature telemetry

Browser monitoring (RUM). The client token is a RUM token (Ingestion → RUM): write-only and meant to ship in the bundle — never the ingestion token above. The instance must list this site's origin in ZO_CORS_ALLOWED_ORIGINS.

Production: The project's organization identifier.

Where to get it: OpenObserve → organization settings.

NEXT_PUBLIC_OPENOBSERVE_CLIENT_TOKEN
empty by default
feature telemetry

Browser monitoring (RUM). The client token is a RUM token (Ingestion → RUM): write-only and meant to ship in the bundle — never the ingestion token above. The instance must list this site's origin in ZO_CORS_ALLOWED_ORIGINS.

Production: A RUM client token.

Where to get it: OpenObserve → Ingestion → RUM.

Write-only and meant to ship in the bundle. Never the server's ingestion token. The instance must list the site's origin in ZO_CORS_ALLOWED_ORIGINS.