Skip to content

Environment Variables

A plain-language reference for every .env variable. This page is for when you want to know what a setting does, whether it's required, or you're hand-editing .env for full manual control.

The short version

For a normal deploy you don't touch any of this by hand — the scaffolding wizard fills it all in. The only things it asks you to decide are your Postgres password, your dashboard password, your CKB key passphrase, and your domain. Everything else (the API secret, the webhook encryption key, the session secret) is generated for you.

AI-facing canonical version (kept in sync with this page): .context/architecture/env-vars.md.

Which file do I need?

Your situationFile to copy
Recommended merchant deploy (docker-compose.release.yml, published image, no repo clone).env.release.example.env
Full manual control / building the image yourself from a repo clone (docker-compose.yml).env.example (root) → .env
Contributing to apps/web and running pnpm dev outside Dockerapps/web/.env.exampleapps/web/.env.local (on top of root .env)
Trying the reference storefront integrationapps/demo-storefront/.env.example.env.local

Never commit any of the copied .env/.env.local files — they're already gitignored.

Secrets used by every path (root .env.example / .env.release.example)

VarRequired?What it's for
POSTGRES_USER, POSTGRES_DBConfigurable (default fibergate)Database name/user, shared by the postgres container and fibergate-core.
POSTGRES_PASSWORDRequiredDatabase password. No safe default — pick your own.
FIBER_SECRET_KEY_PASSWORDRequiredUnlocks your CKB testnet signing key file. Must match the passphrase you used when the key was encrypted, not a new password you invent.
DOMAINRequiredYour public domain, DNS-pointed at this host, with ports 80/443/8228 reachable from the internet. Without it, nginx can't serve a usable HTTPS config.
CERTBOT_EMAILOptionalOnly used for the one-time real-certificate step in Public HTTPS deploy; safe to leave blank until then.
ADMIN_PASSWORD_HASH_B64RequiredYour dashboard login, base64-encoded. Not the raw bcrypt hash — see the login-troubleshooting note in Troubleshooting for why. create-fibergate generates this correctly for you.
DASHBOARD_SESSION_SECRETRequiredSigns your dashboard session cookie. Keep it different from FIBERGATE_INTERNAL_SECRET below — they serve different purposes.
FIBERGATE_INTERNAL_SECRETRequiredThe API key your storefront/checkout app uses to call FiberGate's API. Whatever you set here, your storefront's own .env must match it exactly.
WEBHOOK_SECRET_ENCRYPTION_KEYRequiredProtects webhook secrets at rest (a 64-char hex key). create-fibergate generates this for you.
CRON_SECRETOptionalOnly needed if you plan to manually trigger the poll endpoint; safe to leave blank otherwise.
FIBER_NODE_RPC_AUTH_TOKENOptionalNot needed by default — your Fiber node has no public IP in this setup.

.env.release.example only additionally needs:

VarRequired?What it's for
GHCR_NAMESPACERequiredWhoever published the fibergate-core image (a GitHub username/org).
FIBERGATE_CORE_TAGOptionalPin to a specific build instead of the latest one.

Root .env.example only (build-from-source path) additionally has:

VarRequired?What it's for
FIBER_PAYER_SECRET_KEY_PASSWORDOnly if you use the optional fiber-node-payer test helperA second, throwaway test wallet for paying your own demo invoices locally. Not part of a normal deploy.

apps/web/.env.local — only if you're running pnpm dev outside Docker

Just 3 overrides on top of the root .env (everything else is shared):

VarDefaultWhy it's different here
POSTGRES_HOSTlocalhostDocker Compose uses the internal name postgres; outside Docker you need localhost, which works because the postgres container publishes its port to 127.0.0.1.
POSTGRES_PORT5432
FIBER_NODE_URLhttp://localhost:8227The root .env value points at Docker's internal DNS name, which doesn't resolve outside the Docker network.

apps/demo-storefront/.env.local — the reference storefront app

This app is a standalone integration, same as any third-party merchant app would be — it does not read apps/web's vars or the root .env at all.

VarRequired?What it's for
FIBERGATE_BASE_URLRequiredWhere your FiberGate deployment lives (no /api/v1 suffix).
FIBERGATE_INTERNAL_SECRETRequiredMust be the exact same value you set for fibergate-core above.
DEMO_WEBHOOK_SECRETRequiredMust match the secret you used when registering this app's webhook endpoint.

Generating secrets