Skip to content

Environment Variables

Amanbig edited this page Jul 20, 2026 · 2 revisions

Environment Variables

The README's Configuration Parameters table covers the essentials. This is the full list, including a few that don't show up there yet.

Core

Variable Description Default Required
PORT Port the backend server listens on. 7780 No
DB_TYPE PGLITE for the embedded database, or anything else to use DATABASE_URL against an external Postgres. PGLITE Yes
DB_DIR Directory to persist PGlite's data files. ./manup Only for DB_TYPE=PGLITE
DATABASE_URL Connection string for an external Postgres instance. postgres://postgres:password@localhost:5432/manup Only if DB_TYPE is not PGLITE
MASTER_KEY 32-character hex key used to encrypt/decrypt secret values at rest. Losing this makes all stored secrets unrecoverable — back it up outside the container. Yes
JWT_SECRET Signs short-lived access-token cookies. Yes
REFRESH_TOKEN_SECRET Signs long-lived (7-day) refresh tokens. Must be a different value from JWT_SECRET — it's a separate secret specifically so access and refresh tokens can't be swapped for each other. Yes
ALLOWED_ORIGINS Comma-separated list of origins allowed by CORS. If unset, defaults to same-origin (http://localhost:<PORT>) plus http://localhost:5173 for local Vite dev. No

Signup gating & default admin

Variable Description Default
ENABLE_SIGNUP true/false. If set, always wins. If unset: disabled once DEFAULT_ADMIN_EMAIL/DEFAULT_ADMIN_PASSWORD are both set, enabled otherwise. unset
DEFAULT_ADMIN_EMAIL If set together with DEFAULT_ADMIN_PASSWORD, a default org owner is created on first startup.
DEFAULT_ADMIN_PASSWORD Must be 8-128 characters, same as any user password.
DEFAULT_ADMIN_NAME Display name for the seeded admin. Admin
DEFAULT_ADMIN_USERNAME Username for the seeded admin. admin

The seed runs on every startup but is idempotent — it checks for a user with DEFAULT_ADMIN_EMAIL first and skips if one already exists, so it's safe across restarts/redeploys. It creates a full tenant (organization + owner user + a "Default Project" + a "development" environment), the same as going through /register by hand.

This is meant for single-admin self-hosted deployments: set the two vars, leave ENABLE_SIGNUP unset, and you get one bootstrapped admin account with public registration closed — no one else can create an organization on your instance. If you want an open multi-tenant instance instead (anyone can sign up and get their own org), just don't set DEFAULT_ADMIN_EMAIL/DEFAULT_ADMIN_PASSWORD (or set ENABLE_SIGNUP=true explicitly to keep signup open even with a default admin configured).

Email (optional — org member invites)

Only used to email temporary credentials when inviting a new member to an organization. If any of these are missing, invite emails are silently skipped (the invite still succeeds — you'll just need to relay the credentials another way).

Variable Description Default
SMTP_HOST SMTP server host. — (unset = email sending disabled)
SMTP_PORT SMTP server port. 465 is treated as implicit TLS. 587
SMTP_USER SMTP auth username.
SMTP_PASS SMTP auth password.
SMTP_FROM From: address on outgoing invite emails. ManUp Secure Vault <no-reply@manup.io>

Production checklist

  • Never run with the default JWT_SECRET/MASTER_KEY/REFRESH_TOKEN_SECRET values (development / development-refresh) — the server refuses to start with those in NODE_ENV=production.
  • Generate JWT_SECRET and REFRESH_TOKEN_SECRET as two independent random values — don't reuse one for both.
  • MASTER_KEY must be a 32-character hex string. Store it somewhere durable outside the container/volume (a secrets manager, a password manager, etc.) — it's not recoverable from the database.

Clone this wiki locally