Configuration

Configuration Reference

Delivr is configured entirely through environment variables — there are no config files to edit. This page lists every option for both services.

After changing a variable, restart the affected service: docker compose up -d (recreates changed containers) or systemctl restart delivr-api.

Delivr API

Required

DLA_APP_URL
string required
Public URL of the web client, e.g. https://mail.example.com — without a trailing slash. The API only accepts browser requests from this origin (CORS), and uses it to build links such as password-reset URLs.
DLA_ENCRYPTION_KEY
string required
Secret used to encrypt stored IMAP/SMTP credentials with AES-256-GCM. At least 32 characters. Generate one with openssl rand -hex 32, keep it secret, and back it up separately from the database.
DLA_DB_MIGRATION_DIR
path required
Directory containing the database migrations. Preset in the container image. For manual installs, use ./drizzle/migrations/sqlite.

Server

VariableDefaultDescription
DLA_API_HOST::Address to bind to. Use 127.0.0.1 for a manual install behind a local reverse proxy.
DLA_API_PORT14123Port to listen on.
DLA_TRUST_PROXYfalseSet to true when the API is only reachable through your reverse proxy. Login rate limiting then tells clients apart by the address in X-Forwarded-For instead of treating every request as coming from the proxy. Don't enable it while the API port is publicly reachable — clients could forge the header.
DLA_LOG_LEVELinfoOne of debug, info, warn, error, critical.
DLA_LOG_DIR./data/logsDirectory for log files.
DLA_CONFIG_BASE_DIR./configDirectory for generated setup files, such as the initial admin link.
DLA_DISABLE_DOCSfalseSet to true to turn off the interactive API reference at /docs/v1 and the OpenAPI spec.

Database

VariableDefaultDescription
DLA_DB_CONNECTION_URL./data/db.sqlitePath of the SQLite database file. The directory is created if it doesn't exist.
DLA_DB_AUTO_MIGRATEtrueApply pending migrations on start. bun run start and the container image always apply them, whatever this is set to.

Attachments

VariableDefaultDescription
DLA_MAX_ATTACHMENT_SIZE_MB25Maximum combined size of the attachments of one mail, in MB, measured before encoding.

A request that creates or updates a mail may be at most DLA_MAX_ATTACHMENT_SIZE_MB + 16 MB in total (41 MB by default), covering the message body, attachments, and multipart framing.

Encoding makes attachments about 37% larger when they're sent. Keep this value below your mail provider's message size limit divided by 1.37. Bun's request limit caps it at 112 MB. Remember to raise your reverse proxy's body limit to match.

System email (SMTP)

Delivr can send its own emails — currently password-reset links. These settings are for Delivr's sender address, not for your users' mailboxes, which each have their own credentials. All are optional; leave them unset to disable system email.

VariableDefaultDescription
DLA_SMTP_HOST—SMTP server, e.g. smtp.example.com.
DLA_SMTP_PORT—SMTP port, usually 465 (TLS) or 587 (STARTTLS).
DLA_SMTP_SECUREfalsetrue for implicit TLS (port 465). Use false for 587, which upgrades with STARTTLS.
DLA_SMTP_USERNAME—SMTP username.
DLA_SMTP_PASSWORD—SMTP password.
DLA_SMTP_FROM"Delivr" <noreply@delivr.email>Sender of system emails, e.g. Delivr <noreply@example.com>. Use an address your SMTP server may send as.
Example
DLA_SMTP_HOST=smtp.example.com
DLA_SMTP_PORT=465
DLA_SMTP_SECURE=true
DLA_SMTP_USERNAME=noreply@example.com
DLA_SMTP_PASSWORD=app-password-here
DLA_SMTP_FROM="Delivr <noreply@example.com>"

Delivr Web

The web client reads its settings at runtime, so the same build or container image works for any domain.

VariableDefaultDescription
DELIVR_API_URLhttp://localhost:14123/v1Public URL of the API, including /v1. Your users' browsers call this URL directly, so it must be reachable from the internet.
DELIVR_APP_URLhttp://localhost:14128Public URL of the web client itself.
DELIVR_ENABLE_SIGNUPfalseShow a sign-up link on the login page. Keep it false and create users as an admin.
NITRO_PORT / PORT14128Port the web server listens on.
NITRO_HOST / HOST:: in the containerAddress the web server binds to.

Build-time variables

When you build the web client from source, you can bake in defaults through a .env file (see example.env). The DELIVR_* variables above always take precedence at runtime.

VariableDefaultDescription
DELIVR_API_URLhttp://localhost:14123/v1Build-time default for DELIVR_API_URL.
DELIVR_APP_URLhttp://localhost:14128Build-time default for DELIVR_APP_URL.
DELIVR_ENABLE_SIGNUPfalseBuild-time default for DELIVR_ENABLE_SIGNUP.
USE_DEV_PROXYfalseDevelopment only: route API calls through Nuxt's dev proxy.

Ports at a glance

PortServiceExpose publicly?
14123Delivr APINo — only via the reverse proxy
14128Delivr WebNo — only via the reverse proxy
443 / 80Your reverse proxyYes

Command reference

Delivr API

CommandDescription
bun run startProduction entry point. Applies migrations, then starts the server.
bun run devDevelopment server with watch mode.
bun testRun the test suite.
bun run typecheckType-check the project.
bun run db:sqlite:migrateApply SQLite migrations manually.
bun run db:sqlite:generateGenerate a new SQLite migration from schema changes.
bun run compileCompile a standalone binary.

Delivr Web

CommandDescription
bun run buildProduction build into .output/.
bun run startServe the production build on port 14128.
bun run devDevelopment server on port 14128.
bun testRun the test suite.
bun run typecheckRun nuxt typecheck and tsc.
bun run api-client:generateRegenerate the API client from a running API's OpenAPI spec.