Kurir / Configuration

Configuration

Kurir is configured through environment variables in a .env file. If you used the one-command installer, this file lives at /opt/kurir/.env and secrets were generated automatically. For manual setups, copy .env.production.example and fill in the values.

All secrets can be generated with:

openssl rand -base64 32

Domain

VariableRequiredDescription
DOMAINYesYour server’s public domain name (e.g. mail.example.com). Caddy uses this to auto-provision HTTPS via Let’s Encrypt.
ACME_EMAILYes (installer)Email address for Let’s Encrypt certificate notifications. Set automatically by the installer.

Database

VariableRequiredDefaultDescription
POSTGRES_PASSWORDYesPassword for the PostgreSQL database. Generate with openssl rand -base64 32.
POSTGRES_USERNokurirPostgreSQL username.
POSTGRES_DBNokurirPostgreSQL database name.

The app connects using a DATABASE_URL constructed from these values internally:

postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}?connection_limit=10

Redis

VariableRequiredDescription
REDIS_PASSWORDYesPassword for the Redis instance. Generate with openssl rand -base64 32.

Redis is configured with a 256 MB memory limit and allkeys-lru eviction policy. It stores BullMQ job queues and application cache data.

Application Secrets

VariableRequiredDescription
NEXTAUTH_SECRETYesSecret key for signing NextAuth.js session tokens. Generate with openssl rand -base64 32.
ENCRYPTION_KEYYesAES-256-GCM key for encrypting stored email passwords. Generate with openssl rand -base64 32. Without this key, encrypted passwords in the database cannot be decrypted.

WebAuthn (optional)

Passkey / WebAuthn support for passwordless login.

VariableRequiredDefaultDescription
WEBAUTHN_RP_NAMENoKurirDisplay name shown during passkey registration prompts.
WEBAUTHN_RP_IDNoValue of DOMAINThe relying party identifier. Automatically derived from your domain in the Docker Compose setup.

Push Notifications (optional)

Web push notifications require VAPID (Voluntary Application Server Identification) keys. The one-command installer generates these automatically using OpenSSL.

VariableRequiredDescription
VAPID_PRIVATE_KEYNoVAPID private key (URL-safe base64).
NEXT_PUBLIC_VAPID_PUBLIC_KEYNoVAPID public key (URL-safe base64). Exposed to the browser for push subscription.

To generate VAPID keys manually:

npx web-push generate-vapid-keys

If these variables are omitted, push notification features are disabled.

OAuth Providers (optional)

OAuth enables “Sign in with Google” and “Sign in with Microsoft” buttons for connecting email accounts without app passwords. When the corresponding environment variables are not set, the OAuth buttons simply do not appear in the UI.

Microsoft (Azure AD / Entra)

VariableRequiredDescription
MICROSOFT_CLIENT_IDNoApplication (client) ID from your Azure App Registration.
MICROSOFT_CLIENT_SECRETNoClient secret value from Certificates & secrets.

See Email Accounts for the full Azure setup walkthrough.

Google

VariableRequiredDescription
GOOGLE_CLIENT_IDNoOAuth 2.0 Client ID from Google Cloud Console.
GOOGLE_CLIENT_SECRETNoOAuth 2.0 Client Secret.

See Email Accounts for the full Google OAuth setup walkthrough.

Example configuration

Here is a minimal .env for a production deployment:

DOMAIN=mail.example.com

POSTGRES_PASSWORD=<generated>
REDIS_PASSWORD=<generated>

NEXTAUTH_SECRET=<generated>
ENCRYPTION_KEY=<generated>

And a more complete one with all optional features enabled:

DOMAIN=mail.example.com
ACME_EMAIL=admin@example.com

POSTGRES_PASSWORD=<generated>
REDIS_PASSWORD=<generated>

NEXTAUTH_SECRET=<generated>
ENCRYPTION_KEY=<generated>

WEBAUTHN_RP_NAME=Kurir

VAPID_PRIVATE_KEY=<generated>
NEXT_PUBLIC_VAPID_PUBLIC_KEY=<generated>

MICROSOFT_CLIENT_ID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
MICROSOFT_CLIENT_SECRET=<secret>

GOOGLE_CLIENT_ID=xxxxxxxxxxxx.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=<secret>