---
title: "Environment Variables"
description: "The AiHummer configuration model: bootstrap variables in gateway.env and Settings-catalog keys in the database, set via the web admin UI or aihummer settings."
updated: "2026-11-15"
---

`AIHUMMER_PUBLIC_TLS_CERT_FILE` + `AIHUMMER_PUBLIC_TLS_KEY_FILE`: HTTPS can be served by the gateway with a certificate/private-key pair or by your reverse proxy. An invalid configured pair never falls back to plain HTTP. Before approving a private certificate in the app, compare its SHA-256 fingerprint with the trusted installation terminal.

AiHummer configuration splits into **two strictly different groups**:

1. **Bootstrap (`gateway.env`)** — what the gateway must know **before** it can
   read the database: the database DSN, listen addresses, static directories,
   the master key. Only these keys are read from the environment.
2. **Settings catalog (database)** — every other knob. These are stored in the
   database and set in the web admin UI (**Management → Settings**) or with
   [`aihummer settings set <KEY> <VALUE>`](/en/v1.7/reference/cli/). For these
   keys a `gateway.env` value is **deliberately ignored** — even if set, it has
   no effect.

## Configuration model

`gateway.env` is **bootstrap-only**. Resolution order:

- **Settings-catalog key**: `database value → built-in default`
  (the environment is ignored);
- **bootstrap key**: `environment variable only`.

So the single source of truth for tunable knobs is the database (web admin UI /
`aihummer settings`); the environment carries only what the process needs to
start.

The config file for a host-native install lives at:

```ini
# /home/.aihummer/etc/gateway.env
AIHUMMER_DATABASE_URL=postgres://...
AIHUMMER_MASTER_KEY=base64-32-bytes
```

> [!TIP]
> Do not put Settings-catalog knobs in `gateway.env` — it has no effect. Change
> them in the web admin UI (Management → Settings, it has search) or via
> `aihummer settings set`. Some changes (such as tool toggles and sub-agent
> depth) apply hot; others require a service restart.

## Bootstrap (gateway.env)

The only keys the gateway actually reads from the environment.

### Core & database

| Variable | Purpose |
|---|---|
| `AIHUMMER_DATABASE_URL` | **Required.** Postgres DSN. Without it the gateway runs in health-only mode. |
| `AIHUMMER_DB_APP_URL` | Restricted-role DSN that activates Row-Level Security (set automatically for local installs). |
| `AIHUMMER_GATEWAY_ADDR` | Web UI, apps and channels share one public server address. Open the public address printed by the installer; the local default is `http://localhost:8780/`. The port selected during installation may differ. |
| `AIHUMMER_WEBUI_ADDR` | `AIHUMMER_WEBUI_ADDR` is an auxiliary operator listener on loopback only, default `127.0.0.1:8781`, for bootstrap compatibility. It is not a separate external panel address; `0` is invalid. `AIHUMMER_WEBUI_ENABLED=false` disables the panel on both listeners. |
| `AIHUMMER_DEFAULT_WORKSPACE_ID` | Selects the default workspace for configured inbound integrations. |
| `AIHUMMER_HOME_ROOT` | Install root (normally derived from the binary path); anchors the admin-ui/blob/installer directories and the key files. |
| `AIHUMMER_BLOB_DIR` | Enables the media/file service (blob storage directory). It also stores **private (side-loaded) plugin artifacts** under `blob:` refs that the deployer resolves. |
| `AIHUMMER_ADMIN_UI_DIR` | Web UI, apps and channels share one public server address. `/` |

### Secrets & infrastructure

| Variable | Purpose |
|---|---|
| `AIHUMMER_MASTER_KEY` | base64-encoded 32 bytes; enables secrets-at-rest, the vault and BYOK. |
| `AIHUMMER_MEDIA_TOKEN_SECRET` | Keeps signed download URLs valid across restarts. |
| `AIHUMMER_OTEL_ENDPOINT` | OTLP endpoint for traces/metrics push. |
| `AIHUMMER_DOWNLOAD_BASE_URL` | Base URL for release artifacts (self-update source). |

> [!WARNING]
> Observability is **OTLP push only**. AiHummer does **not** expose a Prometheus
> `/metrics` endpoint or `/debug/pprof`. Point `AIHUMMER_OTEL_ENDPOINT` at your
> collector instead.


## Settings catalog (database — web admin UI or `aihummer settings`)

Every key below lives in the database. Set it in the web admin UI
(**Management → Settings**) or like this:

```bash
aihummer settings set AIHUMMER_LLM_PROVIDER openai
```

A `gateway.env` value for such a key is **ignored**.

### Security

| Key | Purpose |
|---|---|
| `AIHUMMER_APPROVAL_TOOLS` | Tools that require human-in-the-loop approval before they run. |
| `AIHUMMER_AIRGAPPED` | `1` blocks model-controlled public egress (air-gapped mode). |
| `AIHUMMER_AUDIT_RETENTION_DAYS` | Retention window for the admin audit log. |
| `AIHUMMER_INBOUND_SECRET` | HMAC shared secret for connector → gateway `/v1/inbound/*` calls. |

### Authentication & SSO

| Key | Purpose |
|---|---|
| `AIHUMMER_OIDC_ISSUER` | Protects `/v1/admin/*`. Without it (and without LDAP/SAML) admin trusts dev headers — never expose such an instance. |

LDAP/AD and SAML are configured alongside OIDC for enterprise sign-in; SCIM
provides automatic user provisioning. See
[Webhooks, SCIM & pairing](/en/v1.7/api/webhooks-scim-pairing/).

### LLM & models

| Key | Purpose |
|---|---|
| `AIHUMMER_LLM_PROVIDER` | Model provider to use. |
| `AIHUMMER_LLM_MODEL` | Model name. |
| `AIHUMMER_LLM_GATEWAY_URL` | Base URL of an OpenAI-compatible LLM gateway/endpoint (the `AIHUMMER_LLM_*` path; distinct from the native `AIHUMMER_OPENAI_BASE_URL`). See [BYOK & providers](/en/v1.7/access/byok-providers/). |
| `AIHUMMER_OPENAI_API_KEY` | API key for an OpenAI-compatible provider. |
| `AIHUMMER_SUBAGENT_MAX_DEPTH` | Maximum depth of spawned sub-agents. |

> [!NOTE]
> Connect a real model provider to receive working answers. A paid API key is not required: use a local OpenAI-compatible model, a supported subscription, or your own API key.
> If no provider is configured, the error is: `No AI model provider is configured yet — add one in the Models section`

### Tools

| Key | Purpose |
|---|---|
| `AIHUMMER_FS_ROOT` | Further narrows the permitted filesystem root; an empty value does not grant host access. |
| `AIHUMMER_DB_QUERY_DSN` | Enables `db_query` (read-only) against this DSN. |
| `AIHUMMER_CODE_EXEC` | `code_exec` is off by default |
| `AIHUMMER_BROWSER_PROFILE_SOCKET` | Path to the private `managed-profiles.sock` socket of the browser service; empty — persistent `computer` profiles are off. |
| `AIHUMMER_BROWSER_PROFILE_BINDINGS` | JSON array of explicit persistent browser profile bindings (`profile_id`, `tenant_id`, `user_id`, `agent_ids`, `conversation_ids`). |

Web search and the browser are managed by the installer: they are installed out
of the box, turned off with `--no-search` / `--no-browser`, and pointed at an
existing instance with `--external-search=URL` / `--external-browser=URL` —
there are no operator settings for them.

See the full [Tools catalog](/en/v1.7/reference/tools-catalog/) for what each tool
does.

### Voice & sidecars

| Key | Purpose |
|---|---|
| `AIHUMMER_STT_URL` | Speech-to-text sidecar URL (seeded by the installer). |
| `AIHUMMER_TTS_URL` | Text-to-speech sidecar URL (seeded by the installer). |
| `AIHUMMER_VIDEO_URL` | Video-understanding sidecar URL. |
| `AIHUMMER_TTS_AUTO_REPLY` | When a finished reply is spoken: `off`, `always`, `inbound` (default), `tagged`. |
| `AIHUMMER_TTS_MAX_CHARS` | Limit of the spoken text: `0` — the full reply, otherwise `100`–`10000` characters. |
| `AIHUMMER_TTS_SUMMARIZE` | Shorten a long reply for speech (on by default). |

Sidecars are separate HTTP services; the gateway reaches them by URL.

### Vectors & embeddings

| Key | Purpose |
|---|---|
| `AIHUMMER_QDRANT_URL` | Real vector store (Qdrant). Absent → in-memory store. |
| `AIHUMMER_EMBEDDER_URL` | Real embedder service. Absent → hash embedder. |

### Protocol surfaces (opt-in)

| Key | Purpose |
|---|---|
| `AIHUMMER_MCP_PUBLISH` | Exactly `1` opens the external MCP server at `POST /v1/mcp`. On its own it exports no tools at all. |
| `AIHUMMER_MCP_EXPORT_TOOLS` | Comma-separated exact tool names the MCP client will see. Empty (the default) means ZERO tools are exported. |
| `AIHUMMER_A2A_PUBLISH` | `1` enables the A2A surface (`/.well-known/agent.json`, `/a2a/message`). |

## Dev builds only

| Variable | Purpose |
|---|---|
| `AIHUMMER_PLUGIN_PUBKEY` | An extra trusted public key (base64 ed25519) for verifying plugin signatures. **Dev builds only — ignored in release builds** (the registry key is pinned into the binary). |
| `AIHUMMER_PLUGIN_DEV_UNSIGNED` | `1` allows installing **unsigned** plugins. **Dev builds only — ignored in release builds.** Never on an externally reachable instance. |

> [!WARNING]
> In release builds the plugin trust root is **baked into the binary** and
> cannot be overridden by the environment or settings — this is an anti-tamper
> guarantee.

The trust model (official → pinned key, private → trust store, unsigned →
blocked) is described in
[Install & updates](/en/v1.7/marketplace/install-updates/#trust-model-and-the-pinned-key).

## Where to next

- See which tools each key unlocks: [Tools catalog](/en/v1.7/reference/tools-catalog/).
- Operate the instance day to day: [CLI reference](/en/v1.7/reference/cli/).
