NextCRM

Environment variables

Every environment variable the app reads, from .env.example and the code.

Every variable listed in .env.example or read as process.env.NAME in the app code (tests, scripts and the docs app excluded). Required is "yes" when the .env.example comment says so and empty when it says nothing; Purpose is that comment. Variables read under a computed name are not listed. What each variable does and when you need it: Configuration reference.

59 variables.

VariableRequiredIn .env.examplePurposeRead in
ANTHROPIC_API_KEYyesAI. Leave empty to use keys saved in the admin panel.lib/enrichment/e2b/agent-script.ts
BETTER_AUTH_SECRETyesBetter Authlib/auth.ts
BETTER_AUTH_URLyesBetter Authlib/auth.ts, proxy.ts
CInoprisma/seeds/seed.ts
COMPANY_NAMEnolib/enrichment/e2b/agent-script.ts
COMPANY_WEBSITEnolib/enrichment/e2b/agent-script.ts
DATABASE_URLyesyesPostgreSQL connection string (required). Default: the local Docker Postgres from docker-compose.dev.yml (pnpm db:up).lib/prisma-base.ts, prisma/seeds/seed.ts
E2B_API_KEYnoinngest/functions/enrich-target-contact.ts, inngest/functions/enrich-target.ts, lib/enrichment/target-enrichment-keys.ts
E2B_ENRICHMENT_TEMPLATEnoinngest/functions/enrich-target-contact.ts, inngest/functions/enrich-target.ts
EMAIL_ENCRYPTION_KEYyesEncrypts stored mailbox passwords and API keys — generate with: openssl rand -hex 32 Set once and never change it, or the stored values become unreadable.lib/email-crypto.ts
EMAIL_FROMyesverified sender for login codes, e.g. noreply@yourdomain.comactions/admin/send-mail-to-all/index.ts, actions/admin/users/activate-user.ts, actions/admin/users/invite-user.ts +15 more
EMAIL_HOSTnolib/sendmail.ts
EMAIL_PASSWORDnolib/sendmail.ts
EMAIL_USERNAMEnolib/sendmail.ts
FIRECRAWL_API_KEYyesget from https://firecrawl.dev
GOOGLE_CALENDAR_CLIENT_IDyesGoogle Calendar sync — Workspace-internal OAuth applib/crm/calendar/google.ts
GOOGLE_CALENDAR_CLIENT_SECRETyesGoogle Calendar sync — Workspace-internal OAuth applib/crm/calendar/google.ts
GOOGLE_IDyesGoogle OAuthlib/auth.ts
GOOGLE_SECRETyesGoogle OAuthlib/auth.ts
HOMEnolib/enrichment/e2b/agent-script.ts
INNGEST_APP_NAMEnoinngest/client.ts
INNGEST_EVENT_KEYnoinngest/client.ts
INNGEST_IDnoinngest/client.ts
INNGEST_SIGNING_KEYnoinngest/client.ts
KNOWN_DOMAINnolib/enrichment/e2b/agent-script.ts
MAILTRAP_API_KEYnolib/mailtrap.ts
MAIL_ALLOW_PRIVATE_HOSTSnolib/net/host-guard.ts
MINIO_ACCESS_KEYyesMinIO / S3 object storage MINIO_ENDPOINT is what the server uses; MINIO_PUBLIC_ENDPOINT is what browsers use (presigned uploads and file links). Leave it empty when both are the same URL.lib/minio.ts
MINIO_BUCKETyesMinIO / S3 object storage MINIO_ENDPOINT is what the server uses; MINIO_PUBLIC_ENDPOINT is what browsers use (presigned uploads and file links). Leave it empty when both are the same URL.lib/minio.ts
MINIO_ENDPOINTyesMinIO / S3 object storage MINIO_ENDPOINT is what the server uses; MINIO_PUBLIC_ENDPOINT is what browsers use (presigned uploads and file links). Leave it empty when both are the same URL.lib/minio.ts
MINIO_PUBLIC_ENDPOINTyesMinIO / S3 object storage MINIO_ENDPOINT is what the server uses; MINIO_PUBLIC_ENDPOINT is what browsers use (presigned uploads and file links). Leave it empty when both are the same URL.
MINIO_SECRET_KEYyesMinIO / S3 object storage MINIO_ENDPOINT is what the server uses; MINIO_PUBLIC_ENDPOINT is what browsers use (presigned uploads and file links). Leave it empty when both are the same URL.lib/minio.ts
NEXTCRM_E2E_TEST_OTPyesDev/e2e only: capture sign-in OTPs and serve them at /api/auth/test-otp (1 = yes). Ignored when NODE_ENV=production. Never set it on a shared or deployed instance.lib/test-otp.ts
NEXTCRM_TOKENnoapp/api/crm/contacts/create-from-remote/route.ts, app/api/crm/leads/create-lead-from-web/route.ts
NEXT_PUBLIC_APP_DOMAINnoactions/invoices/send-invoice-email.ts
NEXT_PUBLIC_APP_NAMEnoactions/admin/send-mail-to-all/index.ts, actions/admin/users/activate-user.ts, actions/admin/users/invite-user.ts +27 more
NEXT_PUBLIC_APP_URLnoactions/admin/users/activate-user.ts, actions/crm/opportunities/approval.ts, actions/feedback/send-feedback.ts +26 more
NEXT_PUBLIC_DISCORD_INVITE_URLnocomponents/support.tsx
NEXT_PUBLIC_GITHUB_ISSUES_URLnocomponents/support.tsx
NEXT_PUBLIC_GITHUB_REPO_APInoactions/github/get-repo-stars.ts
NEXT_PUBLIC_GITHUB_REPO_URLnoapp/[locale]/(auth)/layout.tsx
NEXT_PUBLIC_GITHUB_TOKENnoactions/github/get-repo-stars.ts
NEXT_PUBLIC_NEXT_VERSIONnoapp/[locale]/(routes)/components/Footer.tsx
NEXT_RUNTIMEnoinstrumentation.ts
NODE_ENVnoapp/api/profile/calendar-connections/google/authorize/route.ts, app/api/profile/calendar-connections/google/callback/route.ts, lib/auth.ts +4 more
OPENAI_API_KEYyesAI. Leave empty to use keys saved in the admin panel.inngest/functions/documents/enrich-document.ts, inngest/lib/embedding-utils.ts
PATHnolib/enrichment/e2b/agent-script.ts
PLUGIN_HTTP_ALLOW_PRIVATE_HOSTSnolib/plugins/http.ts
PLUGIN_HTTP_HOST_MAPyesPlugin HTTP: dial these hosts at a fixed IP ("host=ip[,host=ip]"), private or not, e.g. the Docker gateway when the server cannot reach its own public IP. TLS and the Host header keep the hostname. Only listed hosts skip the private-address check.lib/plugins/http.ts
RESEND_API_KEYyesEmail Service (Resend). Leave the key empty to use the one saved in Admin > Resend; an env value always wins over the admin panel.inngest/functions/crm/kill-rule.ts, inngest/functions/crm/recycle-targets.ts, lib/crm/auto-task.ts
RESEND_FROM_EMAILyese.g. noreply@yourdomain.cominngest/functions/campaigns/send-step.ts, inngest/functions/crm/kill-rule.ts, inngest/functions/crm/recycle-targets.ts +2 more
RESEND_WEBHOOK_SECRETyesResend webhook signing secret (whsec_…, Svix-signed)lib/campaigns/resend-signature.ts
SEED_CONTACT_EMAILnoprisma/seeds/seed.ts
SEED_DEMO_DATAyesSeed the demo CRM dataset on pnpm db:seed (1 = yes)prisma/seeds/seed.ts
SKIP_ENV_VALIDATIONnoinstrumentation.ts
TARGET_EMAILnolib/enrichment/e2b/agent-script.ts
TARGET_NAMEnolib/enrichment/e2b/agent-script.ts
TEST_USER_EMAILnoprisma/seeds/seed.ts
UPSTASH_REDIS_REST_URLnolib/enrichment/rate-limit.ts