FeaturesUse CasesDocumentationAboutContact
    Contact us
    Documentation
    • Introduction
    • Installation
    • Quickstart
    • CLI Reference
    • Overview
    • Core Packages
    • App Structure
    • Modules & Routes
    • API Conventions
    • Module Anatomy
    • Backend Module
    • Frontend Module
    • Quotas
    • Full Example
    • Overview
    • Docker
    • Environment Variables
    • Licensing
    Deployment

    Environment Variables

    Every variable a Crudy deployment reads.

    The backend reads its configuration from environment variables and validates them at boot. Missing or weak secrets cause the process to exit before the server starts listening.

    Required at boot

    The framework's assertSecretsHardened check runs first. It enforces these and any module-declared secrets.

    VariableRequiredNotes
    JWT_SECRETyesAt least 32 characters. Must not match known defaults (changeme, password, secret, admin, ...). Must have at least 8 unique characters of entropy.
    LICENSE_FILEyesPath to the license.lic file Crudy issued for your deployment. Read once at boot.
    LICENSE_PUBLIC_KEY or LICENSE_PUBLIC_KEY_FILEyesThe verification key Crudy shipped alongside your license. Inline PEM or a path.

    If any check fails the backend logs the failures with the [secrets] prefix and exits.

    Warning

    Never deploy with a placeholder secret. The check rejects common default values (including changeme, change-this-to-a-long-random-secret-in-production, postgres, admin, test, dev) and any string under 32 characters or with low entropy.

    Database

    VariableDefaultNotes
    DB_HOSTlocalhostPostgreSQL hostname. In the generated compose file this is postgres.
    DB_USERrequiredPostgreSQL role used by the backend.
    DB_PASSWORDrequiredPassword for that role.
    DB_NAMErequiredDatabase name.

    The generated docker-compose.yml reads DB_USER, DB_PASSWORD and DB_NAME from your .env.

    Admin account

    VariableDefaultNotes
    ADMIN_EMAILbreak-glass@crudy.invalidIdentifier of the sealed break-glass account created on first boot, the only one holding every permission. It has no password and cannot sign in until crudy admin reset unseals it for 4 hours; it must enrol a second factor at first sign-in and every sign-in notifies the holders of the audit view. Use it to create named users, then let it reseal. Read only on first boot. Older installs keep their admin account; crudy admin seal turns it into the break-glass account.
    Note

    Do not set ADMIN_EMAIL=admin@example.com for the global admin. That email is used by dev seeds for an org-scoped admin and conflating the two creates a misleading permission state.

    Network and CORS

    VariableDefaultNotes
    CORS_ORIGINhttp://localhost:3001Comma-separated list of allowed origins for the API.
    TRUSTED_PROXIESloopback,linklocal,uniquelocalHops allowed to set X-Forwarded-For: IPs, CIDRs, those keywords, or none. List your proxy or CDN ranges when they have public addresses. An invalid value stops boot.
    BACKEND_PORT3000Host port the backend container publishes.
    FRONTEND_PORT3001Host port the frontend container publishes.
    API_URLhttp://localhost:3000URL the browser uses to reach the backend. Read by the frontend at runtime, so changing it needs a restart, not a rebuild. Required in production.

    Email

    Outgoing mail uses the active email connector when one exists, otherwise these variables. An app whose signIn.methods lists email_code or email_link refuses to boot when neither is set.

    VariableDefaultNotes
    SMTP_HOSTunsetSMTP server. Unset means no environment provider.
    SMTP_PORT587465 implies implicit TLS.
    SMTP_SECUREtrue on 465true for implicit TLS, false for STARTTLS.
    SMTP_USER / SMTP_PASSunsetSet both or neither. The password is never logged.
    SMTP_FROMrequired with SMTP_HOSTSender, e.g. App <no-reply@example.com>.
    SMTP_ALLOW_INSECURE_HOSTSunsetComma-separated hosts allowed without TLS. Loopback is always allowed.
    AUTH_CODE_PEPPERrequired with email sign-in32+ random characters.
    APP_URLrequired with email sign-inPublic frontend origin that emailed links point at.

    Operational toggles

    VariableDefaultNotes
    NODE_ENVrequired by Docker imagesdevelopment or production.
    DISABLE_RATE_LIMITunsetSet to true only for local load testing. Never in production.

    Module-declared secrets

    A module can declare additional required secrets in its BackendModule.requiredSecrets array. The framework adds them to the boot-time check:

    ts
    requiredSecrets: [
        { name: 'SMTP_PASSWORD', minLength: 16, description: 'SMTP relay password' },
    ]

    If the module is wired into the app, the variable must be present at boot. The same length and entropy checks apply.

    Where to put values

    • Local dev: .env in the app root, loaded by docker compose and by the generated Makefile targets.
    • Production: your secrets manager. Mount values into the backend container.
    • Never commit .env files to source control. The framework ships .env.example as the documented template.

    Verifying

    After setting variables, make health confirms the backend is up and reports db: connected. If the backend fails to start, its logs (make dev-logs or docker logs <container>) will show the [secrets] failures or the license verification error.

    PreviousDockerNext Licensing

    Build internal tools your teams actually use. Powered by a framework built for developers.

    Product

    • Features
    • Use Cases

    Company

    • About
    • Contact

    © 2026 Crudy. All rights reserved.