Skip to main content

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.

Rules that apply to all components
  • Only MI_* names are read. Old 1.x names fail fast at start with MI-1020 and the error names the replacement.
  • Secrets have _FILE variants (for example MI_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_FILE points 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 true or false (some also on, off, 1, 0). A row says so where it matters.

Console (console-api)​

VariableDefaultMeaning
MI_CONSOLE_LISTEN:8080HTTP listen address. Flag --address.
MI_DB_URLpostgres://localhost:5432/makeitintelligent?sslmode=disablePostgreSQL URL (also used by migrate).
MI_CONSOLE_UI_DIRimage: /opt/mii/uiWeb UI build folder.
MI_AUTH_JWT_SECRET / _FILErequired (at least 16 characters) unless MI_AUTH_DISABLEDJWT signing secret; env wins over file.
MI_AUTH_DISABLEDoffDisables auth. Lab only. Also disables licence mutation checks.
MI_ADMIN_USERNAME, MI_ADMIN_PASSWORDnoneFirst-admin bootstrap, used only while no admin user exists.
MI_MASTER_KEY / _FILEnone; at least 32 charactersSeals broker passwords, tokens and private keys at rest (AES-256-GCM). Required unless plaintext is allowed.
MI_MASTER_KEY_PREVIOUS / _FILEnoneKey rotation.
MI_ALLOW_PLAINTEXT_SECRETSoffLab only.
MI_CONSOLE_TLS_CERT_FILE, MI_CONSOLE_TLS_KEY_FILEnoneEnables HTTPS. Must be set together.
MI_CONSOLE_TLS_CLIENT_CA_FILEnoneEnables mTLS for the API.
MI_CONSOLE_HTTP_REDIRECT_ADDRESSautoWith 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_VERIFYnoneClient-side TLS settings used by runtimes talking to a TLS Console.
MI_CONSOLE_URLcollector: http://127.0.0.1:8080The Console URL the runtime or collector calls.
MI_CONSOLE_PUBLIC_URLderived from the requestConsole URL handed to runtimes in the install info.
MI_AUDIT_RETENTION_DAYS365 (7–3650)Daily purge of audit_events.
MI_MCP_AUDIT_RETENTION_DAYS365 (7–3650)MCP and public API audit.
MI_TRUST_PROXYoffHonour 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_ROLELDAP off; default role viewerDirectory login. Saved UI settings override env. Needs feature platform.sso.
MI_EDITIONunsetlite turns on the single-runtime edition.
MI_LITE_RUNTIME_TOKEN_FILErequired when MI_EDITION=liteToken of the built-in lite runtime; Console creates or rotates the runtime to match it.
MI_BACKUPS_DIRLite sets itRead-only; backup age for ops answers.
MI_RUNTIME_URL, MI_OBSERVING_URL, MI_OBSERVING_TOKEN_FILELite sets themLite wiring to the collector and observing.
MI_VISUAL_URL, MI_VISUAL_TOKEN_FILEcompose setsPlant stack: Console proxies /history to mi-visual.
MI_TSDB_URL, MI_TSDB_USER, MI_TSDB_PASSWORD(_FILE), MI_TSDB_DATABASE (default mi)noneHistorian connection. host:port selects ClickHouse; postgres:// selects the Lite backend.
MI_INGEST_PUBLIC_URLnoneAddress runtimes send data to. Required to issue enrollment tokens.
MI_INGEST_SERVER_CA_FILEnoneExtra trust root returned to runtimes.
MI_RUNTIME_DOWNLOAD_URLnoneBase URL of runtime packages for install snippets.
MI_RUNTIME_PACKAGES_DIRnoneConsole serves /downloads/runtime/* from here.
MI_RUNTIME_CERT_DAYS90Runtime certificate life.
MI_WINDOWS_RUNTIME_EXEdist/windows/siterun-win.exePacked Windows runtime EXE; missing gives MI-1012.
MI_METRICS_ADDRESSunsetSeparate metrics listener (/metrics, /ready, /health).
MI_METRICS_PUBLICfalseAlso serve metrics on the UI port when the address is set.
MI_METRICS_TOKEN / _FILEnone; at least 16 charactersBearer token for /metrics. With no address and no token, /metrics is served without login on the UI port.
MI_MCP_ALLOW_HITL_EXECUTEfalseMCP approvals may execute.
MI_MCP_ALLOWED_ORIGINSnoneMCP allowed origins.
MI_PLANT_IDnonePlant id used by MCP.
MI_SOR_ALLOW_HTTP, MI_SOR_ALLOW_NETWORKS, MI_SOR_DENY_NETWORKS, MI_SOR_CSV_DIRSnoneBusiness-system (SOR) connector restrictions.
MI_ALERT_WEBHOOK_ALLOW_LOOPBACKoffAllow loopback alert webhooks.
MI_LOG_LEVELinfodebug, info, warn or error.
MI_LOG_FORMATtext (containers and Lite set json)text or json.
CONFIG_FILEnoneOptional 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​

VariableDefaultMeaning
MI_RUNTIME_IDrequired (or from the enrolled identity)Runtime id.
MI_RUNTIME_TOKENrequired (or from identity)Console token.
MI_RUNTIME_LISTEN:8081Local API listen address. Serves /healthz, /metrics, /ingest/status.
MI_RUNTIME_ADVERTISE_URLderivedURL the Console uses to reach this runtime (direct transport).
MI_CONSOLE_URLidentity, else http://127.0.0.1:8080Console.
MI_DESIRED_STATE_TTLbuilt-inCache TTL of the desired state.
MI_HISTORIAN_SINKdirectingest switches to mi-ingest.
MI_INGEST_URLfrom identityOverride of the identity ingest URL.
MI_RUNTIME_CERT_DIRnoneIdentity directory.
MI_ENROLL_TOKENnoneOne-time token; the collector enrolls at start if no identity exists (Docker).
MI_RUNTIME_KINDdocker (if /.dockerenv), else windows or linuxReported kind.
MI_INGEST_SERVER_CAnoneExtra gateway trust PEM.
MI_INGEST_OUTBOX_*, MI_INGEST_INFLIGHT, _BATCH_ROWS, _LINGER, _LIVE_WINDOW, _BACKLOG_*see Site Runtime installOutbox tuning. MI_INGEST_OUTBOX_DIR defaults to <parent of MI_BUFFER_DIR>/ingest-outbox.
MI_BUFFER_DIRtmp/buffer (compose: /opt/mii/data/bus; Lite: <data>/data/buffer)WAL/bus data dir.
MI_BUFFER_RETENTION4hBuffer retention.
MI_BUFFER_MAX_BYTES40GiBDisk cap.
MI_BUFFER_DELIVERY_QUEUE16Batch slots.
MI_BUFFER_MAX_QUEUED_SAMPLES50000Queue cap.
MI_TSDB_URL, MI_TSDB_USER, MI_TSDB_PASSWORD(_FILE), MI_TSDB_DATABASEnone; Lite and compose set themDirect historian writer.
MI_TSDB_OPTIONALtrue unless falseKeep running while the historian binding is pending.
MI_EMBEDDED_MQTTon unless 0/false/offEmbedded MQTT broker.
MI_EMBEDDED_MQTT_LISTEN127.0.0.1:1883 (Lite: 127.0.0.1:11884)Internal listener.
MI_EMBEDDED_MQTT_PUBLIC_LISTEN, _PUBLIC_PASSWORD_FILEoffPublic read-only listener (Lite sets them from MI_LITE_MQTT_PUBLIC_LISTEN).
MI_EMBEDDED_MQTT_MAX_INFLIGHT, _MAX_WRITES_PENDING65535 eachBroker limits.
MI_EMBEDDED_MQTT_SESSION_EXPIRY, _MESSAGE_EXPIRY1h eachBroker expiry.
MI_EMBEDDED_MQTT_DIR.../data/mqttBroker data dir.
MI_SAFE_WRITE, MI_SAFE_WRITE_JOURNALoffOpt-in safe write-back.
MI_OT_BINARY, MI_OT_PLUGIN_DIR, MI_OT_DATA_DIRset by the image or LiteOT host binary, plugin dir, data dir.
MI_SITERUN_OT_HOST, _PORT, _URLLite: 127.0.0.1:8084OT host address.
MI_STREAM_URL, MI_RULES_URLLite: http://127.0.0.1:9081Rules engine.
MI_STREAM_HTTP_IPLite: 127.0.0.1
MI_STORE_SOCKunix socket or udp://127.0.0.1:<port>OT store spine.
MI_SPINEstorestore, mqtt or wal.
MI_OT_SPINEoff
MI_BUS_MIRRORoff
MI_MQTT_HOT_WORKERS
MI_WEBHOOK_QUEUE_BYTES256 MiBWebhook uplink queue.
MI_LAKE_*noneObject-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>_BINnoneOut-of-process driver binaries.
MI_CHILD_STOP_GRACE, MI_CHILD_KILL_WAIT, MI_SHUTDOWN_BUDGETLite: 6s, 1s, 9sShutdown timings.
MI_PPROF_ADDRoffLoopback only.

Related pages: Site Runtime install, Approvals and safe write for MI_SAFE_WRITE.

Historian and observing​

VariableDefaultMeaning
MI_OBSERVING_ADDRESS (alias MI_VISUAL_ADDRESS)image: :8090; Lite: 127.0.0.1:8083Observing listen.
MI_OBSERVING_TOKEN_FILE (fallback MI_VISUAL_TOKEN_FILE)noneBearer token that the Console uses.
MI_OBSERVING_WRITER_USER, MI_OBSERVING_WRITER_PASSWORD_FILE, MI_TSDB_WRITER_USER, MI_TSDB_WRITER_PASSWORD(_FILE)noneOptional writer for POST /v1/alarms/events.
MI_OBSERVING_ROLLUPSnoneRollup switch.
MI_TSDB_RETENTION_DAYS90 (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_GUARDonDisk guard.
MI_TSDB_DISK_PATHLite: the PGDATA dirDirectory checked.
MI_TSDB_DISK_MIN_FREE_PERCENT10
MI_TSDB_DISK_MIN_FREE_GB5
MI_TSDB_DISK_FLOOR_PERCENT3
MI_TSDB_DISK_FLOOR_GB2
MI_TSDB_MAX_GB0 (off)Cap on the database size.
MI_TSDB_DISK_CHECK_INTERVAL1m

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​

VariableDefault
MI_INGEST_LISTEN:8443
MI_INGEST_ADMIN_LISTEN:9464
MI_INGEST_TLS_CERT_FILE, MI_INGEST_TLS_KEY_FILEnone
MI_INGEST_FLUSH_MAX_WAIT25ms
MI_INGEST_FLUSH_ROWS100000
MI_INGEST_WRITERS8
MI_INGEST_MAX_QUEUED_ROWS1000000 (429 above this; backlog shed above half)
MI_INGEST_RUNTIME_MAX_ROWS_PER_SEC200000 per runtime
MI_INGEST_OWNER_REFRESH30s
MI_INGEST_REVOCATION_POLL5s
MI_INGEST_PENDING_LEASE60s
MI_INGEST_MAX_DECODES4
MI_INGEST_MAX_STREAMS16
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.

VariableDefaultMeaning
MI_AGENT_LLM_BASE_URLhttp://127.0.0.1:11434/v1OpenAI-compatible base URL. Fallback OPENAI_BASE_URL.
MI_AGENT_LLM_API_KEYollamaAPI key. Fallbacks OPENAI_API_KEY and MI_AGENT_LLM_API_KEY_FILE.
MI_AGENT_LLM_MODELqwen2.5:3bModel name.
MI_AGENT_LISTEN:8095Listen address.
MI_AGENT_DATA_DIR/var/lib/mi-agentGraph links, proposals and audit.
MI_AGENT_PLANT_ID, MI_PLANT_IDnonePlant id.
MI_CONSOLE_URLhttp://127.0.0.1:8080Console the Agent calls.
MI_MCP_ALLOW_HITL_EXECUTEfalseAllow people to approve and execute over MCP.

MCP stdio bridge (mi-mcp)​

VariableDefaultMeaning
MI_MCP_URLhttps://app.makeitintelligent.com/agent/v1/mcpThe MCP endpoint to forward to. For your plant set it to https://<console>/api/v2/mcp.
MI_MCP_TOKEN, MI_MCP_TOKEN_FILEnone (required)A Console token or a mii_ac_ secret.
MI_MCP_INSECUREoffSkip 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.

VariableDefaultMeaning
MI_LITE_INSTALL_DIR, MI_LITE_APP_DIR, MI_LITE_DATA_DIRset by the installerInstall, application and data folders.
MI_LITE_PG_PORT5433Embedded PostgreSQL.
MI_LITE_COLLECTOR_PORT8081Collector local API.
MI_LITE_OBSERVING_PORT8083Observing.
MI_LITE_OT_PORT8084OT runtime.
MI_LITE_STREAM_PORT9081Rules engine.
MI_LITE_MQTT_PORT11884Internal MQTT broker (loopback).
MI_LITE_STORE_PORT17001OT store spine (UDP on Windows).
MI_LITE_MQTT_PUBLIC_LISTENunset (Docker image: 0.0.0.0:1883)Read-only public MQTT listener.
MI_LITE_PG_PUBLICunset (Docker image: on)Lets the read-only role reach PostgreSQL from the network.
MI_LITE_PG_URLnoneUse an external PostgreSQL.
MI_LITE_ALLOW_ROOToffAllow mii run as root.
MI_ADMIN_USERNAME, MI_LOG_LEVEL, MI_CONSOLE_LISTENsee ConsoleAlso 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_DISABLED or MI_ALLOW_PLAINTEXT_SECRETS outside a lab.
  • Restart the service after you change an environment variable.
  • Change one setting at a time and check the Console health afterwards.

Troubleshooting​

SymptomCauseFix
Start fails with MI-1020An old variable name is still setUse the MI_ name from the error details.
Start fails with MI-1011Master key missing or shortSet MI_MASTER_KEY (32 or more characters).
Start fails with MI-1010TLS files missing or mismatchedCheck both paths.
No admin can sign in on first startMI_ADMIN_USERNAME and MI_ADMIN_PASSWORD unsetSet them for the first start.
/metrics is open to everyoneNo address and no token setSet MI_METRICS_ADDRESS or MI_METRICS_TOKEN.