# Configuration options

Reference of environment variables for a self-hosted dimmi server, with defaults and descriptions.

Every operator setting you can configure in `/opt/dimmi/.env`. See [How configuration works](/self-hosting/configuration/) to update values with `dimmictl set`.

## Server

Written to `/opt/dimmi/.env` during installation:

| Variable | Default | Description |
| --- | --- | --- |
| `APP_DOMAIN` | From `--domain` | Public hostname dimmi serves on. |
| `ACME_EMAIL` | From `--email` | Email for Let's Encrypt certificate notices. |
| `IMAGE` | Installed release | Container image tag (updated by `dimmictl update`). |
| `DIMMI_APP__KEY` | Generated | Encryption key for database secrets. Never change it. |
| `COMPOSE_PROFILES` | Empty | Set `clamav` to run malware scanning (enabled by `--clamav`). |
| `NETWORK_SUBNET` | `172.29.0.0/24` | Private Docker network CIDR. |
| `DIMMI_LOG__LEVEL` | `info` | Log level: `debug`, `info`, `warn`, or `error`. |
| `DIMMI_GATE__ENABLED` | `false` | Locks the entire instance behind one shared password. |
| `DIMMI_GATE__PASSWORD` | Empty | Password used when the gate is enabled. |

## Sign-up and sign-in

Prefix every variable below with `DIMMI_AUTH__`. For Google and GitHub login, see [Sign-in providers](/self-hosting/sign-in-providers/).

| Variable | Default | Description |
| --- | --- | --- |
| `SIGNUP__MODE` | `invite_only` | Set `open` to allow anyone to sign up. |
| `SIGNUP__MAX_PER_HOUR_PER_IP` | `20` | Max sign-ups per IP per hour. |
| `DISPOSABLE_EMAIL` | `off` | Handling for throwaway email domains: `off`, `flag`, or `block`. |
| `VERIFICATION__REQUIRED` | `false` | Require verified email before inviting teammates or creating API tokens. |
| `PASSWORDS__MIN_LENGTH` | `10` | Minimum password length (at least `8`). |
| `SESSIONS__IDLE_LIFETIME` | `336h` | Idle timeout before session expiry. |
| `SESSIONS__ABSOLUTE_LIFETIME` | `720h` | Maximum session lifetime from sign-in. |
| `MAGIC_LINK__ENABLED` | `true` | Allow passwordless email sign-in links. |
| `MAGIC_LINK__TTL` | `15m` | Lifetime of email sign-in links. |
| `FACTORS__ENABLED` | `totp,passkey,recovery_code` | Allowed second-factor methods. |
| `LOCKOUT__PER_IP_EMAIL` | `10` | Failed sign-in attempts per minute per IP + email. |
| `LOCKOUT__PER_EMAIL_SOFT_LOCK` | `30` | Failed attempts per hour on one email before locking unknown devices. |
| `LOCKOUT__PER_IP_SPRAY` | `100` | Failed attempts per hour per IP before blocking. |
| `CAPTCHA__DRIVER` | `none` | Set `turnstile` to enable Cloudflare Turnstile. |
| `CAPTCHA__SITE_KEY`, `CAPTCHA__SECRET_KEY` | Empty | Cloudflare Turnstile keys (required when `turnstile` is enabled). |
| `TERMS__SITE_URL` | Empty | Site that publishes your legal terms at `/terms` and `/privacy`. When set, people tick a box accepting them before creating an account, and an email sign-up without it is refused. |
| `TERMS__VERSION` | `1.0` | Version of the terms recorded on each account that accepts them. |

## Email

Prefix every variable below with `DIMMI_CHANNELS__EMAIL__`. For mail drivers and inbound routing, see [Send and receive email](/self-hosting/email/).

| Variable | Default | Description |
| --- | --- | --- |
| `DEFAULT_SENDER_DOMAIN` | Inbound domain | Sender domain used before a workspace verifies its own. |
| `INBOUND__MAX_MESSAGE_BYTES` | `31457280` | Max incoming email size in bytes. |
| `INBOUND__MAX_ATTACHMENTS` | `50` | Max attachments stored per incoming email. |
| `INBOUND__MAX_ATTACHMENT_BYTES` | `26214400` | Max size per incoming attachment in bytes. |
| `INBOUND__REOPEN_WINDOW` | `720h` | Window after close where an email reply reopens the same thread. |
| `SENDING__MAX_ATTACHMENT_BYTES` | `20971520` | Max total size attached to outbound email; larger files send as links. |
| `SENDING__ATTACHMENT_LINK_TTL` | `168h` | Lifetime of outbound attachment download links. |
| `SENDING__LIMITS__PROVIDER_PER_MINUTE` | `0` | Outbound mail provider quota per minute (`0` disables). |
| `SENDING__LIMITS__PROVIDER_PER_DAY` | `0` | Outbound mail provider quota per day (`0` disables). |
| `SENDING__LIMITS__BROADCAST_SHARE_PERCENT` | `80` | Max share of sending quota broadcasts may consume. |
| `SENDING__SES__CONFIGURATION_SET` | Mailer's own | SES configuration set customer email is sent with. It must publish bounce and complaint events to the events topic. |
| `SENDING__SES__EVENTS_TOPIC_ARN` | Empty | SNS topic whose SES [bounce and complaint events](/self-hosting/email/#bounces-and-spam-complaints) dimmi accepts at `/webhooks/ses/events`. Empty turns the webhook off. |
| `SENDING__SES__SYSTEM_EVENTS_TOPIC_ARN` | Empty | A second accepted topic, for the system mailer's configuration set. |
| `SENDING__REPUTATION__BOUNCE_PAUSE_RATE` | `0` | Share of a workspace's email (`0` to `1`) that may bounce for good before its [bulk email pauses](/channels/sending-domain/#when-bulk-email-pauses) (`0` disables). |
| `SENDING__REPUTATION__COMPLAINT_PAUSE_RATE` | `0` | Share reported as spam (`0` to `1`) before bulk email pauses (`0` disables). |

## AI

Prefix every variable below with `DIMMI_AI__`. See [Add AI provider keys](/self-hosting/ai-providers/) for provider keys, spending caps, and kill switches.

| Variable | Default | Description |
| --- | --- | --- |
| `ANSWER_EFFORT` | `low` | Reasoning effort for answers: `low`, `medium`, or `high`. |
| `TRACES_STORE_PAYLOADS` | `true` | Store prompts and responses for each agent run. |
| `TRACES_RETENTION_DAYS` | `30` | Days to retain stored trace payloads. |
| `RUNS_RETENTION_DAYS` | `400` | Days to retain agent run metadata (`0` keeps forever). |

## Limits

| Variable | Default | Description |
| --- | --- | --- |
| `DIMMI_INVITATIONS__MAX_PER_DAY` | `0` | Daily invite limit per workspace (`0` disables). |
| `DIMMI_INVITATIONS__TTL` | `168h` | Invitation link lifetime. |
| `DIMMI_TOKENS__MAX_PER_MEMBER` | `50` | Max active API tokens per teammate per workspace. |
| `DIMMI_API__LIMITS__TOKEN_PER_MINUTE` | `600` | API requests per minute per token. |
| `DIMMI_API__LIMITS__USER_PER_MINUTE` | `1200` | API requests per minute per signed-in user. |
| `DIMMI_API__LIMITS__WORKSPACE_PER_MINUTE` | `6000` | API requests per minute across all tokens in a workspace. |
| `DIMMI_WIDGET__MAX_WIDGETS_PER_WORKSPACE` | `10` | Max messengers per workspace (`0` disables). |
| `DIMMI_WEBHOOKS__MAX_ENDPOINTS` | `20` | Max webhook endpoints per workspace (`0` disables). |
| `DIMMI_WEBHOOKS__REQUIRE_HTTPS` | `false` | Require `https://` for webhook URLs. |

## Retention

| Variable | Default | Description |
| --- | --- | --- |
| `DIMMI_AUDIT__RETENTION_DAYS` | `0` | Audit log retention in days (`0` keeps forever). |
| `DIMMI_SECURITY_EVENTS__RETENTION_DAYS` | `365` | Security log retention in days (`0` keeps forever). |
| `DIMMI_INBOX__DRAFTS__RETENTION_DAYS` | `30` | Untouched draft retention in days (`0` keeps forever). |
| `DIMMI_WEBHOOKS__DELIVERY_RETENTION_DAYS` | `30` | Webhook delivery log retention in days. |
| `DIMMI_CHANNELS__INBOUND_EVENTS__PROCESSED_RETENTION_DAYS` | `7` | Retention in days for processed chat app webhook events (`0` keeps forever). |
| `DIMMI_CHANNELS__INBOUND_EVENTS__FAILED_RETENTION_DAYS` | `30` | Retention in days for failed/held chat app webhook events (`0` keeps forever). |
| `DIMMI_WORKSPACES__DELETION_GRACE_DAYS` | `30` | Grace window before deleted workspaces purge permanently. |
| `DIMMI_CONTACTS__ERASE_GRACE_DAYS` | `7` | Grace window before erased customer data wipes permanently. |

---

Index of all dimmi docs: https://trydimmi.com/llms.txt (full text: https://trydimmi.com/llms-full.txt)
