MinusXMinusXMinusX
Self-Hosting

Configuration Reference

Every environment variable a MinusX deployment reads — defaults, scope, and when you need it

All configuration is via environment variables, read from frontend/.env (which both docker compose and the installer pass through via env_file). Almost everything is runtime — set it, restart the container, done. The handful of build-time variables that require a rebuild are listed at the bottom.


Required

VariablePurpose
NEXTAUTH_SECRETSession/JWT signing secret. Generate with openssl rand -base64 32.

Document database

MinusX stores documents (questions, dashboards, users, …) in an embedded Postgres-compatible database by default; point it at external Postgres for hosted/multi-node setups.

VariableDefaultPurpose
DB_TYPEpglitepglite (embedded, zero-config) or postgres (external).
DATABASE_URLPostgres connection string; required when DB_TYPE=postgres.
PGLITE_DATA_DIRderivedOn-disk directory for PGLite data (the Docker image sets /app/data/pglite).
POSTGRES_SCHEMApublicSchema to use in external Postgres.

LLM & agent

Model providers, keys, and assignments are configured in the app (setup wizard / Settings → Models) — there are no LLM model env vars. See LLM Providers.

VariableDefaultPurpose
MINUSX_GATEWAY_URLhttps://llm.minusx.ai/v1Base URL of the managed MinusX gateway (the default provider); override for staging gateways.
MAX_LLM_CONCURRENCYunlimitedCap on concurrent in-flight LLM requests.
BOOT_WARM_CHATtrueWarm the chat runtime at boot so the first message isn't a cold start. false to disable.

Telemetry

VariableDefaultPurpose
MX_TELEMETRYerrorsTelemetry level: off (nothing), errors (crash reports only, no PII), full (traces + logs + PII). Accepts 0/1/2. Full details: Telemetry & Privacy.
ANALYTICS_CONFIGunsetJSON product-analytics config; overrides any default baked into the image. {"enabled":false} disables analytics only.
EVENTS_FORWARD_RULESunsetOpt-in JSON map {"<event regex>": "<webhook url>"} forwarding app events to your webhooks (e.g. errors → your Slack).

Paths & data

VariableDefaultPurpose
BASE_DUCKDB_DATA_PATH. (image: /app)Base directory for resolving relative DuckDB file paths.
ANALYTICS_DB_DIRderivedDirectory for the internal usage-analytics DuckDB store.
LOCAL_UPLOAD_PATH<base>/data/uploadsFilesystem directory for uploaded files.
MXFOOD_DUCKDB_URLGitHub release URLWhere the tutorial sample dataset is downloaded from (point at a mirror for airgapped installs).

Object storage (optional)

Used for uploads and query-result blobs when configured; without it, uploads use the local filesystem.

VariableDefaultPurpose
OBJECT_STORE_ENDPOINTS3-compatible endpoint URL.
OBJECT_STORE_BUCKETBucket name.
OBJECT_STORE_REGIONus-east-1Region.
OBJECT_STORE_ACCESS_KEY_ID / OBJECT_STORE_SECRET_ACCESS_KEYCredentials.
OBJECT_STORE_PUBLIC_URLPublic base URL for stored objects.
USE_BASE64_UPLOADSfalseStore uploads inline as base64 instead of the object store.

Query execution & caching

Defaults are sensible; tune only under real load.

VariableDefaultPurpose
MAX_CONCURRENT_QUERIES10Cap on concurrent client query executions.
QUERY_TIMEOUT_MS120000Client-side wall-clock cap per query (0 disables).
QUERY_SERVER_TIMEOUT_MS180000Server-side backstop per query execution (0 disables).
QUERY_CACHE_REVALIDATE_MS1200000 (20 min)Serve-stale-while-revalidating window for cached results.
QUERY_CACHE_EXPIRY_MS3600000 (60 min)Hard expiry for cached results.
QUERY_CACHE_LEASE_MS120000Execution lease TTL (dedupes concurrent identical queries).

Auth & access

VariableDefaultPurpose
AUTH_URLhttp://localhost:3000Canonical base URL for auth callbacks — set to your public URL behind a proxy.
ADMIN_PWDOptional admin password gate.
ENABLE_ORG_CREATIONtruefalse blocks creating new organizations (single-tenant lockdown).
EMBED_ALLOWED_ORIGINSOrigin allowlist for iframe embedding (* = any); enables the required cookie/CSP settings.
SHARE_GUEST_CHAT_ENABLEDfalseAllow anonymous guest chat on publicly shared stories.
CRON_SECRETBearer secret authorizing scheduled-job endpoints (reports/alerts triggered by an external cron).

Slack integration (optional)

VariablePurpose
SLACK_SIGNING_SECRETVerifies Slack request signatures.
SLACK_CLIENT_ID / SLACK_CLIENT_SECRETSlack OAuth app credentials.
DEFAULT_EMAIL_WEBHOOKFallback webhook for email-style notifications.

Credits & usage limits (optional)

Off by default; for deployments that meter LLM usage per role.

VariableDefaultPurpose
CREDITS_ENABLEDfalseShow credits usage UI.
ENFORCE_CREDIT_LIMITSfalseEnforce (block) rather than just track.
CREDIT_CONFIG / CREDIT_ALLOWANCES / CREDIT_RESET_ALLOWANCESdefaultsJSON budget/allowance overrides per role.
CREDIT_BILLING_CYCLE / CREDIT_RESET_CYCLEdefaultsCycle windows.

Advanced

VariableDefaultPurpose
CUSTOM_MODULELoad a custom instrumentation module at boot (deployment-specific extensions).
LANDING_HTMLReplace the landing page with custom HTML.
DEFAULT_DB_TYPEduckdbDefault dialect preselected for new data connections.
E2E_RUNTIME_SECRETTest-harness opt-in; leave unset in production.

Variables prefixed DAB_*, QA_*, and E2E_* belong to the benchmark and test harnesses — they have no effect on a normal deployment and are intentionally undocumented here.


Build-time variables

Everything above is read at container runtime. These are the exceptions — inlined into the JavaScript bundle at npm run build, so changing them on a prebuilt image has no effect; you'd need to build from source:

VariablePurpose
NEXT_PUBLIC_DEFAULT_ANALYTICS_CONFIGDefault analytics config baked into official images. Runtime ANALYTICS_CONFIG / MX_DISABLE_TELEMETRY always override it.
NEXT_PUBLIC_DISABLE_UPDATE_BANNERHide the update banner.
NEXT_PUBLIC_SEND_ERRORS_IN_DEVInitialize crash reporting even in dev builds.
GIT_COMMIT_SHACommit SHA shown in the UI (set by CI).

On this page

Book a Demo