Run your server

Configuration

Every setting imbox reads, which ones you must set, and where to change each.

imbox docs

imbox has two kinds of settings. Environment settings belong to the server and are set once, in a file. App settings belong to you and are changed in the browser under Settings.

Environment settings

Where they live

InstallFileApply a change
Server script/etc/imbox/imbox.envsudo systemctl restart imbox
Docker Compose.env next to docker-compose.ymldocker compose up -d
RailwayThe service's Variables tabRailway redeploys

Docker passes on a short list

docker-compose.yml hands only these to the app: APP_URL, SESSION_SECRET, APP_NAME, GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET, MS_CLIENT_ID, MS_CLIENT_SECRET and RESEND_API_KEY, plus the database address it builds from POSTGRES_PASSWORD. For any other setting below, add a line for it under environment: in docker-compose.yml, for example WEB_CONCURRENCY: 2.

You must set

The install sets these for you. They are here so you know what they do.

SettingWhat it is
APP_URLThe public address, with https://, for example https://imbox.example.com. It must match the address in your browser. imbox checks it on every change request, and uses it for sign-in redirects and links.
SESSION_SECRETA random value from openssl rand -hex 32. It signs the session cookie and encrypts mailbox passwords, AI keys, app secrets and two-factor secrets. See Security. Never change it once mail is connected. Keep a copy off the server.
DATABASE_URLThe PostgreSQL address, for example postgres://imbox:[email protected]:5432/inbox.

Sign-in with Google and Microsoft, and sending from domains

All optional. They can also be set and changed without a restart under Settings → Accounts → Provider credentials. If the same value is set in the environment, the environment wins.

SettingWhat it is
GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRETYour Google OAuth client, for Connect Gmail and Google Calendar. See Mailboxes.
MS_CLIENT_ID, MS_CLIENT_SECRETYour Microsoft Entra app, for Outlook and Microsoft 365. See Mailboxes.
RESEND_API_KEYA Resend key, for sending from domain mailboxes.
INBOUND_SECRETA secret that switches on the inbound mail webhook, POST /inbound/mail, used by domain mailboxes.

Server and tuning

SettingDefaultWhat it does
HOST127.0.0.1The address the app listens on. Keep it local and put the proxy in front. The Docker image listens on all addresses inside its container.
PORT8787The port it listens on.
APP_NAMEimboxThe name shown on the sign-in page and in the browser tab.
WEB_CONCURRENCY1How many web processes to run. See a busier server.
PG_POOL_MAX10Database connections per process.
PG_STATEMENT_TIMEOUT_MS20000Stops a database query after this many milliseconds. 0 turns it off.
PG_CONNECT_WAIT_MS10000How long a request waits for a free database connection.
LISTEN_DATABASE_URLnoneA direct database address for live events, when DATABASE_URL goes through a pooler.
CRON_SECONDS60How often mail is checked and scheduled sends go out. 0 turns the timer off.
EGRESS_ALLOW_HOSTSnoneComma-separated host names the app may reach even if they resolve to a private address, for example ollama for a local model.
ALLOW_PRIVATE_EGRESS01 lets the app reach private addresses everywhere. Leave it off unless you know why you need it.

App settings

These are changed in the browser and stored in the database, so they are part of your backup.

Settings SectionConfigurable Options
PreferencesDark/light theme, keyboard navigation, desktop notifications, remote image loading policies, version check switch, and away mode settings.
AccountsConnect/disconnect IMAP, Gmail, and Outlook accounts; re-sync mail history; signatures; OAuth provider keys.
DomainsCustom domain configuration, Stalwart server connection, domain mailbox routing.
IntegrationsBrowser extension token management (imx_...), revocation, and access logs.
CalendarGoogle Calendar sync toggles, subscribed .ics webcal feeds, mailbox calendar colors.
AIModel provider (Anthropic, OpenAI, xAI, Gemini, Ollama, custom), model name, API key, memory inspection, and automated feature switches.
SecurityPassword change, Two-Factor Authentication (TOTP), passkeys (WebAuthn), and active session termination.

Next