Configuration reference
MakeIntelligent is configured with environment variables that start with MI_. In the plant stack you set them in the compose file or service unit; in mii Lite they come from mii.env; in a Site Runtime from runtime.env.
- Only
MI_*names are read. Old 1.x names fail fast at start withMI-1020and the error names the replacement. - Secrets have
_FILEvariants (for exampleMI_MASTER_KEY_FILE). The value in the environment wins over the file. Prefer files. - Some settings can also be saved in the Console and then override the environment (LDAP is the example). The Console page tells you the source.
CONFIG_FILEpoints to an optional JSON file. Precedence is flag, then environment, then file, then default.
How to read the tables
- Default is the value used when the variable is not set. "none" means unset and the feature is off or the value is required elsewhere.
- Durations use Go syntax such as
500ms,10s,4h. - Switches usually take
trueorfalse(some alsoon,off,1,0). A row says so where it matters.
Console (console-api)
| Variable | Default | Meaning |
|---|---|---|
MI_CONSOLE_LISTEN | :8080 | HTTP listen address. Flag --address. |
MI_DB_URL | postgres://localhost:5432/makeitintelligent?sslmode=disable | PostgreSQL URL (also used by migrate). |
MI_CONSOLE_UI_DIR | image: /opt/mii/ui | Web UI build folder. |
MI_AUTH_JWT_SECRET / _FILE | required (at least 16 characters) unless MI_AUTH_DISABLED | JWT signing secret; env wins over file. |
MI_AUTH_DISABLED | off | Disables auth. Lab only. Also disables licence mutation checks. |
MI_ADMIN_USERNAME, MI_ADMIN_PASSWORD | none | First-admin bootstrap, used only while no admin user exists. |
MI_MASTER_KEY / _FILE | none; at least 32 characters | Seals broker passwords, tokens and private keys at rest (AES-256-GCM). Required unless plaintext is allowed. |
MI_MASTER_KEY_PREVIOUS / _FILE | none | Key rotation. |
MI_ALLOW_PLAINTEXT_SECRETS | off | Lab only. |
MI_CONSOLE_TLS_CERT_FILE, MI_CONSOLE_TLS_KEY_FILE | none | Enables HTTPS. Must be set together. |
MI_CONSOLE_TLS_CLIENT_CA_FILE | none | Enables mTLS for the API. |
MI_CONSOLE_HTTP_REDIRECT_ADDRESS | auto | With TLS: :8080 redirector unless the main port is 8080. Values off, false, none, -, disabled turn it off. |
MI_CONSOLE_CLIENT_CERT_FILE, _KEY_FILE, _CA_FILE, _INSECURE_SKIP_VERIFY | none | Client-side TLS settings used by runtimes talking to a TLS Console. |
MI_CONSOLE_URL | collector: http://127.0.0.1:8080 | The Console URL the runtime or collector calls. |
MI_CONSOLE_PUBLIC_URL | derived from the request | Console URL handed to runtimes in the install info. |
MI_AUDIT_RETENTION_DAYS | 365 (7–3650) | Daily purge of audit_events. |
MI_MCP_AUDIT_RETENTION_DAYS | 365 (7–3650) | MCP and public API audit. |
MI_TRUST_PROXY | off | Honour X-Forwarded-For / X-Real-IP and X-Forwarded-Proto. |
MI_LDAP_ENABLED, _URL, _START_TLS, _INSECURE_SKIP_VERIFY, _BIND_DN, _BIND_PASSWORD, _BASE_DN, _USER_FILTER, _GROUP_ATTR, _GROUP_ROLE_MAP, _DEFAULT_ROLE | LDAP off; default role viewer | Directory login. Saved UI settings override env. Needs feature platform.sso. |
MI_EDITION | unset | lite turns on the single-runtime edition. |
MI_LITE_RUNTIME_TOKEN_FILE | required when MI_EDITION=lite | Token of the built-in lite runtime; Console creates or rotates the runtime to match it. |
MI_BACKUPS_DIR | Lite sets it | Read-only; backup age for ops answers. |
MI_RUNTIME_URL, MI_OBSERVING_URL, MI_OBSERVING_TOKEN_FILE | Lite sets them | Lite wiring to the collector and observing. |
MI_VISUAL_URL, MI_VISUAL_TOKEN_FILE | compose sets | Plant stack: Console proxies /history to mi-visual. |
MI_TSDB_URL, MI_TSDB_USER, MI_TSDB_PASSWORD(_FILE), MI_TSDB_DATABASE (default mi) | none | Historian connection. host:port selects ClickHouse; postgres:// selects the Lite backend. |
MI_INGEST_PUBLIC_URL | none | Address runtimes send data to. Required to issue enrollment tokens. |
MI_INGEST_SERVER_CA_FILE | none | Extra trust root returned to runtimes. |
MI_RUNTIME_DOWNLOAD_URL | none | Base URL of runtime packages for install snippets. |
MI_RUNTIME_PACKAGES_DIR | none | Console serves /downloads/runtime/* from here. |
MI_RUNTIME_CERT_DAYS | 90 | Runtime certificate life. |
MI_WINDOWS_RUNTIME_EXE | dist/windows/siterun-win.exe | Packed Windows runtime EXE; missing gives MI-1012. |
MI_METRICS_ADDRESS | unset | Separate metrics listener (/metrics, /ready, /health). |
MI_METRICS_PUBLIC | false | Also serve metrics on the UI port when the address is set. |
MI_METRICS_TOKEN / _FILE | none; at least 16 characters | Bearer token for /metrics. With no address and no token, /metrics is served without login on the UI port. |
MI_MCP_ALLOW_HITL_EXECUTE | false | MCP approvals may execute. |
MI_MCP_ALLOWED_ORIGINS | none | MCP allowed origins. |
MI_PLANT_ID | none | Plant id used by MCP. |
MI_SOR_ALLOW_HTTP, MI_SOR_ALLOW_NETWORKS, MI_SOR_DENY_NETWORKS, MI_SOR_CSV_DIRS | none | Business-system (SOR) connector restrictions. |
MI_ALERT_WEBHOOK_ALLOW_LOOPBACK | off | Allow loopback alert webhooks. |
MI_LOG_LEVEL | info | debug, info, warn or error. |
MI_LOG_FORMAT | text (containers and Lite set json) | text or json. |
CONFIG_FILE | none | Optional JSON config; precedence is flag, then env, then file, then default. |
Related pages: Security model, LDAP and SSO, Licensing, MCP server.
Site Runtime and collector
| Variable | Default | Meaning |
|---|---|---|
MI_RUNTIME_ID | required (or from the enrolled identity) | Runtime id. |
MI_RUNTIME_TOKEN | required (or from identity) | Console token. |
MI_RUNTIME_LISTEN | :8081 | Local API listen address. Serves /healthz, /metrics, /ingest/status. |
MI_RUNTIME_ADVERTISE_URL | derived | URL the Console uses to reach this runtime (direct transport). |
MI_CONSOLE_URL | identity, else http://127.0.0.1:8080 | Console. |
MI_DESIRED_STATE_TTL | built-in | Cache TTL of the desired state. |
MI_HISTORIAN_SINK | direct | ingest switches to mi-ingest. |
MI_INGEST_URL | from identity | Override of the identity ingest URL. |
MI_RUNTIME_CERT_DIR | none | Identity directory. |
MI_ENROLL_TOKEN | none | One-time token; the collector enrolls at start if no identity exists (Docker). |
MI_RUNTIME_KIND | docker (if /.dockerenv), else windows or linux | Reported kind. |
MI_INGEST_SERVER_CA | none | Extra gateway trust PEM. |
MI_INGEST_OUTBOX_*, MI_INGEST_INFLIGHT, _BATCH_ROWS, _LINGER, _LIVE_WINDOW, _BACKLOG_* | see Site Runtime install | Outbox tuning. MI_INGEST_OUTBOX_DIR defaults to <parent of MI_BUFFER_DIR>/ingest-outbox. |
MI_BUFFER_DIR | tmp/buffer (compose: /opt/mii/data/bus; Lite: <data>/data/buffer) | WAL/bus data dir. |
MI_BUFFER_RETENTION | 4h | Buffer retention. |
MI_BUFFER_MAX_BYTES | 40GiB | Disk cap. |
MI_BUFFER_DELIVERY_QUEUE | 16 | Batch slots. |
MI_BUFFER_MAX_QUEUED_SAMPLES | 50000 | Queue cap. |
MI_TSDB_URL, MI_TSDB_USER, MI_TSDB_PASSWORD(_FILE), MI_TSDB_DATABASE | none; Lite and compose set them | Direct historian writer. |
MI_TSDB_OPTIONAL | true unless false | Keep running while the historian binding is pending. |
MI_EMBEDDED_MQTT | on unless 0/false/off | Embedded MQTT broker. |
MI_EMBEDDED_MQTT_LISTEN | 127.0.0.1:1883 (Lite: 127.0.0.1:11884) | Internal listener. |
MI_EMBEDDED_MQTT_PUBLIC_LISTEN, _PUBLIC_PASSWORD_FILE | off | Public read-only listener (Lite sets them from MI_LITE_MQTT_PUBLIC_LISTEN). |
MI_EMBEDDED_MQTT_MAX_INFLIGHT, _MAX_WRITES_PENDING | 65535 each | Broker limits. |
MI_EMBEDDED_MQTT_SESSION_EXPIRY, _MESSAGE_EXPIRY | 1h each | Broker expiry. |
MI_EMBEDDED_MQTT_DIR | .../data/mqtt | Broker data dir. |
MI_SAFE_WRITE, MI_SAFE_WRITE_JOURNAL | off | Opt-in safe write-back. |
MI_OT_BINARY, MI_OT_PLUGIN_DIR, MI_OT_DATA_DIR | set by the image or Lite | OT host binary, plugin dir, data dir. |
MI_SITERUN_OT_HOST, _PORT, _URL | Lite: 127.0.0.1:8084 | OT host address. |
MI_STREAM_URL, MI_RULES_URL | Lite: http://127.0.0.1:9081 | Rules engine. |
MI_STREAM_HTTP_IP | Lite: 127.0.0.1 | |
MI_STORE_SOCK | unix socket or udp://127.0.0.1:<port> | OT store spine. |
MI_SPINE | store | store, mqtt or wal. |
MI_OT_SPINE | off | |
MI_BUS_MIRROR | off | |
MI_MQTT_HOT_WORKERS | ||
MI_WEBHOOK_QUEUE_BYTES | 256 MiB | Webhook uplink queue. |
MI_LAKE_* | none | Object-store lake (MI_LAKE_BACKEND, _ENDPOINT, _BUCKET, _PREFIX, _REGION, _ACCESS_KEY, _SECRET_KEY(_FILE)). MI_LAKE_OPTIONAL=1 in Lite. |
MI_DRIVER_DIR, MI_DRIVER_<PROTO>_BIN | none | Out-of-process driver binaries. |
MI_CHILD_STOP_GRACE, MI_CHILD_KILL_WAIT, MI_SHUTDOWN_BUDGET | Lite: 6s, 1s, 9s | Shutdown timings. |
MI_PPROF_ADDR | off | Loopback only. |
Related pages: Site Runtime install, Approvals and safe write for MI_SAFE_WRITE.
Historian and observing
| Variable | Default | Meaning |
|---|---|---|
MI_OBSERVING_ADDRESS (alias MI_VISUAL_ADDRESS) | image: :8090; Lite: 127.0.0.1:8083 | Observing listen. |
MI_OBSERVING_TOKEN_FILE (fallback MI_VISUAL_TOKEN_FILE) | none | Bearer token that the Console uses. |
MI_OBSERVING_WRITER_USER, MI_OBSERVING_WRITER_PASSWORD_FILE, MI_TSDB_WRITER_USER, MI_TSDB_WRITER_PASSWORD(_FILE) | none | Optional writer for POST /v1/alarms/events. |
MI_OBSERVING_ROLLUPS | none | Rollup switch. |
MI_TSDB_RETENTION_DAYS | 90 (1 to max 10,950, MaxRetentionDays) | Built-in baseline for the Postgres backend. A saved retention policy in the UI overrides it. |
MI_TSDB_DISK_GUARD | on | Disk guard. |
MI_TSDB_DISK_PATH | Lite: the PGDATA dir | Directory checked. |
MI_TSDB_DISK_MIN_FREE_PERCENT | 10 | |
MI_TSDB_DISK_MIN_FREE_GB | 5 | |
MI_TSDB_DISK_FLOOR_PERCENT | 3 | |
MI_TSDB_DISK_FLOOR_GB | 2 | |
MI_TSDB_MAX_GB | 0 (off) | Cap on the database size. |
MI_TSDB_DISK_CHECK_INTERVAL | 1m |
MI_TSDB_DISK_GUARD accepts on, 1, true, yes (guard on, also the default for an empty value) and off, 0, false, no (guard off). Any other value is ignored with a warning and the guard stays on.
mi-ingest gateway
| Variable | Default |
|---|---|
MI_INGEST_LISTEN | :8443 |
MI_INGEST_ADMIN_LISTEN | :9464 |
MI_INGEST_TLS_CERT_FILE, MI_INGEST_TLS_KEY_FILE | none |
MI_INGEST_FLUSH_MAX_WAIT | 25ms |
MI_INGEST_FLUSH_ROWS | 100000 |
MI_INGEST_WRITERS | 8 |
MI_INGEST_MAX_QUEUED_ROWS | 1000000 (429 above this; backlog shed above half) |
MI_INGEST_RUNTIME_MAX_ROWS_PER_SEC | 200000 per runtime |
MI_INGEST_OWNER_REFRESH | 30s |
MI_INGEST_REVOCATION_POLL | 5s |
MI_INGEST_PENDING_LEASE | 60s |
MI_INGEST_MAX_DECODES | 4 |
MI_INGEST_MAX_STREAMS | 16 |
MI_DB_URL, MI_TSDB_* | reused as above |
MI_DB_URL and the MI_TSDB_* variables from the tables above are reused by the gateway.
Agent
Set on the mi-agent service. See The Agent and LLM connections.
| Variable | Default | Meaning |
|---|---|---|
MI_AGENT_LLM_BASE_URL | http://127.0.0.1:11434/v1 | OpenAI-compatible base URL. Fallback OPENAI_BASE_URL. |
MI_AGENT_LLM_API_KEY | ollama | API key. Fallbacks OPENAI_API_KEY and MI_AGENT_LLM_API_KEY_FILE. |
MI_AGENT_LLM_MODEL | qwen2.5:3b | Model name. |
MI_AGENT_LISTEN | :8095 | Listen address. |
MI_AGENT_DATA_DIR | /var/lib/mi-agent | Graph links, proposals and audit. |
MI_AGENT_PLANT_ID, MI_PLANT_ID | none | Plant id. |
MI_CONSOLE_URL | http://127.0.0.1:8080 | Console the Agent calls. |
MI_MCP_ALLOW_HITL_EXECUTE | false | Allow people to approve and execute over MCP. |
MCP stdio bridge (mi-mcp)
| Variable | Default | Meaning |
|---|---|---|
MI_MCP_URL | https://app.makeitintelligent.com/agent/v1/mcp | The MCP endpoint to forward to. For your plant set it to https://<console>/api/v2/mcp. |
MI_MCP_TOKEN, MI_MCP_TOKEN_FILE | none (required) | A Console token or a mii_ac_ secret. |
MI_MCP_INSECURE | off | Skip TLS verification. Lab only. |
mii Lite launcher (mii.env or process environment)
These keys are read by the Lite launcher. A port outside 1 to 65535, or two settings on the same port, stops the start with an error.
| Variable | Default | Meaning |
|---|---|---|
MI_LITE_INSTALL_DIR, MI_LITE_APP_DIR, MI_LITE_DATA_DIR | set by the installer | Install, application and data folders. |
MI_LITE_PG_PORT | 5433 | Embedded PostgreSQL. |
MI_LITE_COLLECTOR_PORT | 8081 | Collector local API. |
MI_LITE_OBSERVING_PORT | 8083 | Observing. |
MI_LITE_OT_PORT | 8084 | OT runtime. |
MI_LITE_STREAM_PORT | 9081 | Rules engine. |
MI_LITE_MQTT_PORT | 11884 | Internal MQTT broker (loopback). |
MI_LITE_STORE_PORT | 17001 | OT store spine (UDP on Windows). |
MI_LITE_MQTT_PUBLIC_LISTEN | unset (Docker image: 0.0.0.0:1883) | Read-only public MQTT listener. |
MI_LITE_PG_PUBLIC | unset (Docker image: on) | Lets the read-only role reach PostgreSQL from the network. |
MI_LITE_PG_URL | none | Use an external PostgreSQL. |
MI_LITE_ALLOW_ROOT | off | Allow mii run as root. |
MI_ADMIN_USERNAME, MI_LOG_LEVEL, MI_CONSOLE_LISTEN | see Console | Also read by the launcher. |
Plus the MI_TSDB_* keys above.
Examples
A production Console behind your own certificate:
MI_DB_URL=postgres://mii@mi-db:5432/makeitintelligent?sslmode=require
MI_AUTH_JWT_SECRET_FILE=/run/mii/secrets/jwt
MI_MASTER_KEY_FILE=/run/mii/secrets/master
MI_CONSOLE_TLS_CERT_FILE=/etc/mii/tls/console.crt
MI_CONSOLE_TLS_KEY_FILE=/etc/mii/tls/console.key
MI_AUDIT_RETENTION_DAYS=730
MI_METRICS_ADDRESS=127.0.0.1:9100
MI_METRICS_TOKEN_FILE=/run/mii/secrets/metrics
MI_LOG_FORMAT=json
A Site Runtime line1-rt with safe write on:
MI_RUNTIME_ID=line1-rt
MI_CONSOLE_URL=https://console.demo-foods.example
MI_SAFE_WRITE=tag
MI_BUFFER_RETENTION=4h
Limits and good practice
- Keep secrets in files and out of compose files and shell history.
- Do not set
MI_AUTH_DISABLEDorMI_ALLOW_PLAINTEXT_SECRETSoutside a lab. - Restart the service after you change an environment variable.
- Change one setting at a time and check the Console health afterwards.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
Start fails with MI-1020 | An old variable name is still set | Use the MI_ name from the error details. |
Start fails with MI-1011 | Master key missing or short | Set MI_MASTER_KEY (32 or more characters). |
Start fails with MI-1010 | TLS files missing or mismatched | Check both paths. |
| No admin can sign in on first start | MI_ADMIN_USERNAME and MI_ADMIN_PASSWORD unset | Set them for the first start. |
/metrics is open to everyone | No address and no token set | Set MI_METRICS_ADDRESS or MI_METRICS_TOKEN. |