Configuration Reference
All server-level configuration lives in the .env file at the project root. After changing it, restart the web app and the worker — the scheduler picks the new values up on its next cron tick. A rebuild is not needed: env values are read at runtime, with one exception, the NEXT_PUBLIC_* variables, which are baked in at build time.
Two kinds of configuration
.env holds infrastructure settings (database, Redis, URLs, secrets). Integration credentials — payment gateways, Meta apps, AI keys, SMS providers — are entered in the admin panel and stored encrypted in the database. You will rarely touch .env after go-live.
Application
| Variable | Example | Description |
|---|---|---|
APP_NAME | WhatsMax | Application name used in emails and page titles. |
APP_URL | https://chat.example.com | Public base URL. Used to build links, OAuth callbacks and webhook URLs. Must be HTTPS in production. |
APP_ENV | production | production or development. |
APP_DEMO_MODE | false | When true, destructive actions are disabled (for public demos). Keep false in production. |
Database
| Variable | Example | Description |
|---|---|---|
DATABASE_URL | mysql://user:pass@127.0.0.1:3306/whatsmax | MySQL connection string. Special characters in the password must be URL-encoded (@ → %40, # → %23). |
Authentication & security
| Variable | Example | Description |
|---|---|---|
NEXTAUTH_URL | https://chat.example.com | Must equal APP_URL. |
AUTH_SECRET | (random) | Session signing secret. Generate with openssl rand -base64 32. |
AUTH_TRUST_HOST | true | Required when running behind a reverse proxy (Nginx). |
APP_ENCRYPTION_KEY | (64 hex chars) | AES-256-GCM key encrypting stored provider credentials. Generate with openssl rand -hex 32. Never change after go-live. |
Redis
| Variable | Example | Description |
|---|---|---|
REDIS_URL | redis://127.0.0.1:6379 | Redis connection for BullMQ queues, scheduling and caching. With a password: redis://:password@127.0.0.1:6379. |
Realtime (Pusher, optional)
Realtime inbox updates use Pusher Channels. Without it the inbox still works but updates on refresh/polling instead of instantly.
| Variable | Description |
|---|---|
PUSHER_APP_ID | From your Pusher app's "App Keys" page. |
PUSHER_APP_KEY | Server-side key. |
PUSHER_APP_SECRET | Server-side secret. |
PUSHER_APP_CLUSTER | e.g. mt1, eu, ap2. |
NEXT_PUBLIC_PUSHER_KEY | Same value as PUSHER_APP_KEY — exposed to the browser. Build-time — re-run npm run build after changing. |
NEXT_PUBLIC_PUSHER_CLUSTER | Same as PUSHER_APP_CLUSTER. Build-time — re-run npm run build after changing. |
See Realtime for the full setup.
AI defaults (optional)
Platform-level AI defaults. Workspace users can also bring their own keys in AI → Providers; admins manage platform AI in Admin → AI Dashboard.
| Variable | Example | Description |
|---|---|---|
AI_PROVIDER | openai | Default provider: openai, anthropic or gemini. |
OPENAI_API_KEY | sk-... | Fallback OpenAI key. |
OPENAI_MODEL | gpt-4o-mini | Default OpenAI model. |
Transactional email (password resets, invitations, ticket notifications). Campaign email servers are configured per-workspace in the app.
| Variable | Example | Description |
|---|---|---|
MAIL_TRANSPORT | smtp | smtp to send, log to write emails to the log instead (useful before SMTP is ready). |
MAIL_HOST | smtp.postmarkapp.com | SMTP host. |
MAIL_PORT | 587 | SMTP port (587 STARTTLS, 465 TLS). |
MAIL_USERNAME | — | SMTP username. |
MAIL_PASSWORD | — | SMTP password. |
MAIL_FROM_ADDRESS | hello@example.com | Default From address. |
MAIL_FROM_NAME | WhatsMax | Default From name. |
File storage
| Variable | Example | Description |
|---|---|---|
STORAGE_DRIVER | local | local (files under public/storage) or s3. |
AWS_ACCESS_KEY_ID | — | S3 credentials (also used for SNS SMS if enabled). |
AWS_SECRET_ACCESS_KEY | — | — |
AWS_REGION | us-east-1 | S3 region. |
AWS_BUCKET | whatsmax-media | Bucket name. |
AWS_ENDPOINT | (optional) | Set for S3-compatible providers (DigitalOcean Spaces, MinIO, Cloudflare R2). |
S3-compatible storage
Any S3-compatible service works — set AWS_ENDPOINT to the provider's endpoint and fill the credentials accordingly. If you scale to multiple app servers, S3 storage is required (local disk is per-server).
License
| Variable | Description |
|---|---|
LICENSE_SERVER_URL | License server endpoint (pre-configured in the distributed build). |
LICENSE_API_KEY | License server API key (pre-configured). |
LICENSE_PRODUCT_ID | Product identifier (pre-configured). |
You normally don't touch these — activation happens with your purchase code in Admin → System → License (guide).
Applying changes
# after editing .env
pm2 restart whatsmax-web whatsmax-worker
# only if you changed a NEXT_PUBLIC_* variable:
npm run build && pm2 restart whatsmax-web