Skip to content

Environment Variables

Reference for configuring LaunchKit Pro. Use placeholder values in docs and .env.example only. Store real secrets in your server environment or secrets manager — never in git.

Quoting values with spaces

Quote env values that contain spaces, for example:

env
APP_NAME="LaunchKit Pro API"

Do not manually source .env in shell — parsing breaks. Use systemd EnvironmentFile= or your process manager.

Required before register/login

Set DATABASE_URL, JWT_ACCESS_SECRET, and JWT_REFRESH_SECRET before testing auth. Missing JWT secrets often cause /auth/register HTTP 500.

Backend — App

VariableExampleDescription
NODE_ENVdevelopmentdevelopment, production, or test
PORT4000API listen port
APP_NAMELaunchKit Pro APIDisplay name
APP_URLhttp://localhost:4000Public backend URL
FRONTEND_URLhttp://localhost:3000Allowed CORS origin and auth email links (also called app frontend URL in some guides)
CORS_ALLOWED_ORIGINShttp://localhost:3000,http://127.0.0.1:3000Comma-separated browser origins (FRONTEND_URL and localhost defaults are always merged)
CORS_ALLOW_PRIVATE_NETWORK_DEVfalseAllow CORS_DEV_LAN_REGEX matches in production (default off)
CORS_DEV_LAN_REGEX^http://192\.168\.0\.\d+:3000$Optional LAN origin pattern for local device testing

Local LAN frontend testing

To open the dashboard from a phone or another machine on your network (e.g. http://192.168.0.101:3000), add your IP to backend .env:

env
CORS_ALLOWED_ORIGINS=http://localhost:3000,http://127.0.0.1:3000,http://192.168.0.101:3000

Or rely on the dev LAN regex (active when NODE_ENV=development):

env
CORS_DEV_LAN_REGEX=^http://192\.168\.0\.\d+:3000$

In production, LAN regex is disabled unless you explicitly set CORS_ALLOW_PRIVATE_NETWORK_DEV=true. Never use a wildcard — list only trusted HTTPS origins:

env
CORS_ALLOWED_ORIGINS=https://app.launchkitlabs.com,https://launchkitlabs.com,https://docs.launchkitlabs.com

Backend — AI provider

Default AI_PROVIDER=MOCK — no OpenAI or Gemini keys required for install.

VariableExampleDescription
AI_PROVIDERMOCKActive provider: MOCK, OPENAI, or GEMINI
AI_DEFAULT_MODEL(empty)Optional model override
AI_OPENAI_MODELgpt-4.1-miniDefault OpenAI model when using OpenAI
AI_GEMINI_MODELgemini-2.5-flashDefault Gemini model when using Gemini
OPENAI_API_KEY(empty)Required only when AI_PROVIDER=OPENAI
GEMINI_API_KEY(empty)Required only when AI_PROVIDER=GEMINI
AI_MONTHLY_GENERATION_LIMIT100System ceiling combined with plan limits
AI_TEST_USER_MONTHLY_LIMIT5Monthly generation cap for test accounts
AI_TEST_USER_EMAILStestuser@launchkitlabs.com,test@launchkitlabs.comComma-separated test account emails
AI_DEMO_RESTRICTED_EMAILSdemo@launchkitlabs.comDemo accounts blocked from real generation
AI_DEMO_BLOCK_REAL_GENERATIONtrueBlock AI generate for demo emails
AI_DEMO_SHOW_SAMPLE_HISTORYtrueShow sample AI history for demo accounts

Rules:

  • AI_PROVIDER=MOCK requires no provider API key.
  • AI_PROVIDER=OPENAI requires only OPENAI_API_KEY — Gemini key can stay empty.
  • AI_PROVIDER=GEMINI requires only GEMINI_API_KEY — OpenAI key can stay empty.
  • Real AI usage requires buyer-owned keys and may incur OpenAI/Gemini costs.

See AI Module for endpoints, demo behavior, and troubleshooting.

Backend — Billing provider

Default BILLING_PROVIDER=MOCK — no Stripe or Lemon Squeezy keys required for install.

VariableExampleDescription
BILLING_PROVIDERMOCKActive provider: MOCK, STRIPE, or LEMON_SQUEEZY
BILLING_SUCCESS_URLhttp://localhost:3000/dashboard/billing/successRedirect after successful checkout
BILLING_CANCEL_URLhttp://localhost:3000/dashboard/billing/cancelRedirect when checkout is canceled
BILLING_SUPPORT_EMAILsupport@launchkitlabs.comBilling support contact

Stripe (when BILLING_PROVIDER=STRIPE)

VariableDescription
STRIPE_SECRET_KEYStripe secret API key (backend only)
STRIPE_WEBHOOK_SECRETWebhook signing secret for /billing/webhooks/stripe
STRIPE_PRICE_LITEStripe Price ID for Lite edition
STRIPE_PRICE_PROStripe Price ID for Pro edition
STRIPE_PRICE_ENTERPRISEStripe Price ID for Enterprise edition
STRIPE_CUSTOMER_PORTAL_ENABLEDtrue to enable customer portal URL foundation

Lemon Squeezy (when BILLING_PROVIDER=LEMON_SQUEEZY)

VariableDescription
LEMON_SQUEEZY_API_KEYLemon Squeezy API key (backend only)
LEMON_SQUEEZY_STORE_IDStore ID for checkout API
LEMON_SQUEEZY_WEBHOOK_SECRETWebhook signing secret for /billing/webhooks/lemon-squeezy
LEMON_SQUEEZY_VARIANT_LITEVariant ID for Lite
LEMON_SQUEEZY_VARIANT_PROVariant ID for Pro
LEMON_SQUEEZY_VARIANT_ENTERPRISEVariant ID for Enterprise

Rules:

  • BILLING_PROVIDER=MOCK requires no Stripe or Lemon keys.
  • Stripe config is validated only when creating Stripe checkout or checking provider status.
  • Lemon config is validated only when creating Lemon checkout or checking provider status.
  • Empty keys for inactive providers do not block app startup.
  • Provider secrets are buyer-owned; never put them in frontend env or git.

See Billing and Payment Webhooks.

Backend — Database

VariableExampleDescription
DATABASE_URLpostgresql://launchkit_user:replace_with_secure_password@127.0.0.1:5432/launchkit_appRequired. PostgreSQL connection string

Replace replace_with_secure_password locally — do not commit it. See Database Setup for pgAdmin field notes.

Backend — JWT / Auth

VariableExampleDescription
JWT_ACCESS_SECRETreplace_me_access_secretRequired — access token signing secret
JWT_REFRESH_SECRETreplace_me_refresh_secretRequired — refresh token signing secret
JWT_ACCESS_EXPIRES_IN15mAccess token TTL
JWT_REFRESH_EXPIRES_IN7dRefresh token TTL
PASSWORD_SALT_ROUNDS12bcrypt cost factor
PASSWORD_RESET_TOKEN_EXPIRES_MINUTES30Reset token lifetime
EMAIL_VERIFICATION_TOKEN_EXPIRES_HOURS24Verification token lifetime

Generate strong random secrets for production (32+ characters).

Backend — Email provider

VariableExampleDescription
EMAIL_PROVIDERMOCKDefault for installMOCK, SMTP, RESEND, or GMAIL when you connect real email
EMAIL_FROM_NAMELaunchKit ProSender display name
EMAIL_FROM_ADDRESSno-reply@yourdomain.comSender email
SUPPORT_EMAILsupport@yourdomain.comContact/support recipient

No SMTP credentials required while EMAIL_PROVIDER=MOCK.

Backend — Storage provider

VariableExampleDescription
STORAGE_PROVIDERLOCALDefault for installLOCAL, S3, R2, or CLOUDINARY
STORAGE_PUBLIC_BASE_URLhttp://localhost:4000/uploadsPublic base URL for local public assets
STORAGE_UPLOAD_DIRuploadsLocal upload directory
STORAGE_MAX_FILE_SIZE_MB25System-wide upload ceiling (MB); align with frontend and Nginx
STORAGE_ALLOWED_MIME_TYPESimage/jpeg,...Comma-separated MIME allow-list
STORAGE_SIGNED_URL_TTL_SECONDS900Signed URL TTL foundation
STORAGE_CLEANUP_ENABLEDfalseOrphan cleanup stays dry-run/disabled by default
STORAGE_ORPHAN_MAX_AGE_DAYS7Age threshold used by cleanup scans

S3-compatible:

VariableDescription
S3_ACCESS_KEY_ID / S3_SECRET_ACCESS_KEYBackend-only S3 credentials
S3_REGION / S3_BUCKET / S3_ENDPOINTBucket target; endpoint is optional for AWS S3, useful for S3-compatible services
S3_FORCE_PATH_STYLEtrue for MinIO/R2-like endpoints that need path-style URLs
S3_PUBLIC_BASE_URLOptional CDN/public bucket base URL

Cloudflare R2:

VariableDescription
R2_ACCESS_KEY_ID / R2_SECRET_ACCESS_KEYBackend-only R2 credentials
R2_ACCOUNT_ID / R2_BUCKET / R2_ENDPOINTR2 target; region defaults safely to auto
R2_PUBLIC_BASE_URLOptional public/custom domain base URL

Cloudinary:

VariableDescription
CLOUDINARY_CLOUD_NAME / CLOUDINARY_API_KEY / CLOUDINARY_API_SECRETBackend-only Cloudinary credentials
CLOUDINARY_FOLDERUpload folder prefix, default launchkit-pro

LOCAL requires no external keys. S3 validates only S3 vars, R2 only R2 vars, and Cloudinary only Cloudinary vars. Empty keys for inactive providers do not block app startup.

Backend — Redis & queues (optional)

VariableExampleDescription
QUEUES_ENABLEDfalseSafe default — set true only with Redis running
REDIS_URLredis://127.0.0.1:6379Full Redis URL (optional when queues disabled)
REDIS_HOST127.0.0.1Redis host — used to build URL when REDIS_URL is omitted
REDIS_PORT6379Redis port
REDIS_PASSWORD(empty)Redis password (optional)
REDIS_DB0Redis database index
QUEUE_PREFIXlaunchkitBullMQ key prefix
QUEUE_DASHBOARD_ENABLEDfalseOptional Bull Board dashboard (future)
QUEUE_WORKER_EMAIL_ENABLEDtrueEnable email queue processor
QUEUE_WORKER_AI_ENABLEDtrueEnable AI queue processor
QUEUE_WORKER_WEBHOOK_ENABLEDtrueEnable webhook queue processor
QUEUE_WORKER_NOTIFICATION_ENABLEDtrueEnable notification queue processor
QUEUE_WORKER_MAINTENANCE_ENABLEDtrueEnable maintenance queue processor
QUEUE_DEFAULT_ATTEMPTS3Default job retries
QUEUE_DEFAULT_BACKOFF_MS30000Backoff delay (ms)
QUEUE_JOB_REMOVE_ON_COMPLETE100Keep last N completed jobs
QUEUE_JOB_REMOVE_ON_FAIL500Keep last N failed jobs
MAINTENANCE_SCHEDULER_ENABLEDfalseDaily dry-run maintenance jobs (disabled by default)
MAINTENANCE_CLEANUP_CRON0 3 * * *Cleanup cron expression (foundation)
MAINTENANCE_DEMO_RESET_CRON0 4 * * *Demo reset cron expression (placeholder)
MAINTENANCE_STORAGE_CLEANUP_CRON0 5 * * *Storage cleanup cron expression (foundation)

See Background Queues.

Backend — API docs

VariableExampleDescription
API_DOCS_ENABLEDtrueEnable Swagger UI and OpenAPI JSON
API_DOCS_PATHapi-docsSwagger UI path
API_DOCS_JSON_PATHapi-docs-jsonOpenAPI JSON path
API_DOCS_AUTH_ENABLEDfalseRequire HTTP basic auth before Swagger (typically enforced at Nginx in production)
API_DOCS_USERNAMEreplace_me_docs_userDocs basic auth username — placeholder only
API_DOCS_PASSWORDreplace_me_docs_passwordDocs basic auth password — placeholder only
ModeSettings
DisabledAPI_DOCS_ENABLED=false
PublicAPI_DOCS_ENABLED=true
ProtectedAPI_DOCS_ENABLED=true + reverse-proxy basic auth (recommended) or auth middleware when enabled

Recommendation: enable on local/staging; use protected or disabled on production and public demos.

See API Documentation.

Backend — Security

VariableExampleDescription
RATE_LIMIT_ENABLEDtrueAPI rate limiting
RATE_LIMIT_*see .env.examplePer-tier limits
CAPTCHA_PROVIDERMOCKMOCK, TURNSTILE, or RECAPTCHA
CAPTCHA_ENABLEDfalseMaster CAPTCHA toggle
CAPTCHA_REQUIRED_FOR_*falsePer-form CAPTCHA flags
SECURITY_HEADERS_ENABLEDtrueHelmet on API
TRUST_PROXYtrueUse X-Forwarded-For behind Nginx
CORS_STRICT_MODEtrueDisable dev localhost port bypass
AUDIT_LOG_ENABLEDtrueAppend-only audit trail
AUDIT_LOG_RETENTION_DAYS90Retention policy (docs)

See Security Hardening, Rate Limiting, and Audit Logs.

Backend — Monitoring / logging

Local monitoring foundation — no paid error-tracking service required.

VariableExampleDescription
MONITORING_ENABLEDtrueEnable admin monitoring APIs and in-memory store
LOG_LEVELinfoNestJS log level
ERROR_LOGGING_ENABLEDtrueRecord safe errors to store and server logs
ERROR_LOG_RETENTION_DAYS14Retention policy (docs)
REQUEST_LOGGING_ENABLEDtrueRecord recent HTTP requests to the in-memory buffer
REQUEST_LOG_SLOW_MS1000Slow request threshold in milliseconds
REQUEST_LOG_RING_BUFFER_SIZE300Max recent requests kept in memory
ERROR_LOG_RING_BUFFER_SIZE200Max recent errors kept in memory

See Monitoring.

Backend — Analytics

Local usage and demo tracking — no third-party analytics required.

VariableExampleDescription
ANALYTICS_ENABLEDtrueMaster switch; false = no-op
ANALYTICS_PROVIDERLOCALLOCAL or DISABLED
ANALYTICS_DEMO_TRACKING_ENABLEDtrueTrack demo-specific events
ANALYTICS_RETENTION_DAYS90Retention policy (docs)

See Analytics.

Backend — Tests

VariableExampleDescription
TEST_DATABASE_URL(empty)Optional isolated DB for integration tests
TEST_USE_SQLITEfalseExperimental SQLite test mode

See Testing.

VariableExampleDescription
SEARCH_PROVIDERLOCALLOCAL, DISABLED, ALGOLIA, or MEILISEARCH
SEARCH_ENABLEDtrueMaster search toggle
SEARCH_MAX_RESULTS20Max results per query
SEARCH_MIN_QUERY_LENGTH2Minimum query length
SEARCH_INDEXING_ENABLEDtrueAllow admin reindex endpoint
ALGOLIA_APP_ID / ALGOLIA_SEARCH_API_KEY(empty)Algolia foundation — optional
MEILISEARCH_HOST / MEILISEARCH_API_KEY(empty)Meilisearch foundation — optional

Frontend:

VariableExampleDescription
NEXT_PUBLIC_DOCS_URLhttps://docs.launchkitlabs.comDocs links from search results
NEXT_PUBLIC_SEARCH_SHORTCUT_ENABLEDtrueEnable ⌘K / Ctrl+K shortcut

See Dashboard Search.

Backend — Demo mode

VariableExampleDescription
DEMO_MODE_ENABLEDfalseMaster demo guards
DEMO_USER_EMAILSdemo@example.comDemo user accounts
DEMO_ADMIN_EMAILSadmin-demo@example.comDemo admin accounts
DEMO_READONLY_ADMIN_EMAILSadmin-demo@example.comRead-only admin (no mutations)
DEMO_PROTECTED_EMAILSdemo@...,admin-demo@...Legacy alias — protected emails
DEMO_PUBLIC_ACCOUNTS_ENABLEDfalseShow safe demo labels on login page
DEMO_RESET_ENABLEDfalseAllow destructive demo reset
DEMO_RESET_DRY_RUNtrueReset logs only by default
DEMO_SEED_ENABLEDtrueAllow admin seed API
DEMO_SEED_ON_STARTUPfalseAuto-seed on API boot
DEMO_UPLOADS_DISABLED / DEMO_BLOCK_UPLOADStrueBlock demo uploads
DEMO_REAL_AI_DISABLED / DEMO_BLOCK_AI_GENERATIONtrueBlock real AI for demo
DEMO_REAL_BILLING_DISABLED / DEMO_BLOCK_REAL_BILLINGtrueBlock real checkout
DEMO_REAL_WEBHOOK_DELIVERY_DISABLED / DEMO_BLOCK_WEBHOOK_DELIVERYtrueNo outbound webhook calls
DEMO_API_KEY_CREATION_DISABLED / DEMO_BLOCK_API_KEY_CREATIONfalseBlock API key create
DEMO_LICENSE_ACTIVATION_DISABLED / DEMO_BLOCK_LICENSE_ADMINfalseBlock license admin actions

Do not put demo passwords in documentation or git. Use server env only.

See Demo Mode.

Backend — Developer API keys and outbound webhooks

VariableExampleDescription
WEBHOOK_DELIVERY_ENABLEDtrueSet false to record disabled/dry-run deliveries without external calls
WEBHOOK_QUEUE_ENABLEDfalseUse BullMQ when queues are enabled and ready; direct delivery works without Redis
WEBHOOK_MAX_RETRIES3Max attempts per delivery
WEBHOOK_TIMEOUT_MS10000HTTP timeout per webhook POST
WEBHOOK_RETRY_BACKOFF_SECONDS30,120,300Retry schedule foundation
WEBHOOK_USER_AGENTLaunchKit-Pro-Webhooks/1.0Outbound User-Agent
WEBHOOK_DEMO_DELIVERY_DISABLEDtrueDemo users record disabled deliveries instead of external calls
API_KEY_AUTH_ENABLEDtrueEnable /public-api/* API-key authentication
API_KEY_HEADER_NAMEX-API-KeyHeader used for API keys
API_KEY_PREFIXlk_Prefix for newly generated keys
API_KEY_HASH_SECRET(empty locally)Optional local/dev; set a strong value in production for secret encryption context

API keys are stored hashed and full keys are shown only once. Webhook signing secrets are shown only once and encrypted at rest for outbound signing. | DEMO_READONLY_ADMIN_EMAILS | admin-demo@example.com | Read-only demo admin emails | | DEMO_PUBLIC_ACCOUNTS_ENABLED | false | Show safe demo account labels on login |

Do not put demo passwords in env or git.


License activation (optional foundation)

Default LICENSE_ENFORCEMENT_ENABLED=false — app works without license activation.

VariableDefaultDescription
LICENSE_ENFORCEMENT_ENABLEDfalseBlock access when no valid license (buyer opt-in)
LICENSE_PROVIDERMOCKMOCK for admin-generated keys; extend for Payhip/Gumroad/Lemon Squeezy
LICENSE_KEY_PREFIXLKPPrefix for generated keys
LICENSE_MAX_ACTIVATIONS_DEFAULT3Default max activations per key
LICENSE_ALLOW_OFFLINE_MODEtrueReserved for offline verification flows
LICENSE_SUPPORT_EMAILsupport@launchkitlabs.comLicense support contact

See License Activation for API routes and UI paths.


Product updates (optional foundation)

Default UPDATE_CHECK_ENABLED=true with static release catalog — no database migration.

VariableDefaultDescription
LAUNCHKIT_VERSION1.2.0Installed product version returned by /updates/status
UPDATE_CHANNELstableRelease channel label
UPDATE_CHECK_ENABLEDtrueCompare installed vs latest catalog version
UPDATE_PROVIDERMOCKExtend for marketplace or storage-backed downloads
UPDATE_SUPPORT_EMAILsupport@launchkitlabs.comSupport contact on updates UI

See Product Updates for endpoints, UI paths, and secure download placeholders.


Minimum backend .env for fresh install

env
DATABASE_URL=postgresql://launchkit_user:replace_with_secure_password@127.0.0.1:5432/launchkit_app
JWT_ACCESS_SECRET=replace_me_access_secret
JWT_REFRESH_SECRET=replace_me_refresh_secret
JWT_ACCESS_EXPIRES_IN=15m
JWT_REFRESH_EXPIRES_IN=7d
PASSWORD_SALT_ROUNDS=12
APP_URL=http://localhost:4000
FRONTEND_URL=http://localhost:3000
EMAIL_PROVIDER=MOCK
STORAGE_PROVIDER=LOCAL
LOCAL_UPLOAD_DIR=./uploads
MAX_UPLOAD_SIZE_MB=10
QUEUES_ENABLED=false
API_DOCS_ENABLED=true
DEMO_MODE_ENABLED=false
AI_PROVIDER=MOCK
BILLING_PROVIDER=MOCK
LICENSE_ENFORCEMENT_ENABLED=false
LICENSE_PROVIDER=MOCK
LAUNCHKIT_VERSION=1.2.0
UPDATE_CHANNEL=stable
UPDATE_CHECK_ENABLED=true
UPDATE_PROVIDER=MOCK

Optional when enabling queues:

env
# REDIS_URL=redis://127.0.0.1:6379
# QUEUES_ENABLED=true

Frontend

Copy .env.example to .env.local:

env
NEXT_PUBLIC_APP_NAME=LaunchKit Pro
NEXT_PUBLIC_API_URL=http://localhost:4000
NEXT_PUBLIC_MAX_UPLOAD_SIZE_MB=10
VariableDescription
NEXT_PUBLIC_API_URLBackend API base URL (required for auth)
NEXT_PUBLIC_APP_NAMEApp display name
NEXT_PUBLIC_MAX_UPLOAD_SIZE_MBClient pre-validation; backend + Nginx enforce real limit
NEXT_PUBLIC_MARKETING_URLMarketing site link (optional)
NEXT_PUBLIC_DOCS_URLDocumentation link (optional; public docs hosting not required)
NEXT_PUBLIC_SUPPORT_EMAILsupport@launchkitlabs.com
NEXT_PUBLIC_SEARCH_SHORTCUT_ENABLEDtrue
NEXT_PUBLIC_ANALYTICS_ENABLEDtrue
NEXT_PUBLIC_ANALYTICS_PROVIDERLOCAL

WARNING

NEXT_PUBLIC_* variables are exposed to the browser. Never put private API keys or secrets in frontend env vars.


Production example (placeholders only)

env
NODE_ENV=production
APP_URL=https://api.yourdomain.com
FRONTEND_URL=https://app.yourdomain.com
DATABASE_URL=postgresql://launchkit_user:<YOUR_DB_PASSWORD>@127.0.0.1:5432/launchkit_app
JWT_ACCESS_SECRET=<strong-random-secret>
JWT_REFRESH_SECRET=<strong-random-secret>
API_DOCS_ENABLED=false
QUEUES_ENABLED=false
EMAIL_PROVIDER=MOCK
STORAGE_PROVIDER=LOCAL

Replace placeholders with values from your secrets manager — never commit them.


Mock providers and real adapters

LaunchKit Pro v1.0 intentionally defaults to MOCK billing, AI, and email plus LOCAL storage so you can install without vendor API keys. Billing supports MOCK, Stripe, and Lemon Squeezy provider adapters — switch BILLING_PROVIDER and add buyer-owned keys when going live. The AI module is provider-ready (OpenAI/Gemini adapters). Module boundaries are prepared so you can connect SMTP, S3, and similar providers when you go live.


LaunchKit Pro by LaunchKit Labs — buyer documentation. No secrets in this site.