Configuration

Environment variables

The stack reads its settings from .env next to docker-compose.yml. A real install starts from .env.example; the quickstart needs none, its docker-compose.yml carries a value for every setting, and a .env next to it overrides them. Every variable reaches the drupal and cron containers, so a provider key needs no entry in the compose file. After a change, docker compose up -d re-creates the containers that read it.

Required. The stack does not start without the first five. Without the two OKB_COLLAB_* values it starts, but collaborative editing fails.

Variable What it does Default When to change it
DRUPAL_FRONTEND_BASE_URL The main URL of the knowledge base, e.g. https://kb.example.com. none Once, at install.
DRUPAL_BASE_URL The public URL of Drupal, e.g. https://admin.kb.example.com. Same parent domain as the main URL. none Once, at install.
DRUPAL_HASH_SALT Drupal's hash salt. none Once, at install: openssl rand -hex 32.
MARIADB_PASSWORD The database user's password. none Once, at install: openssl rand -hex 32.
MARIADB_ROOT_PASSWORD The database root password. none Once, at install: openssl rand -hex 32.
OKB_COLLAB_CLIENT_ID The collaboration server's OAuth client id. Any id. none Once, at install, e.g. openssl rand -hex 16.
OKB_COLLAB_CLIENT_SECRET The collaboration server's OAuth client secret. none Once, at install: openssl rand -hex 32.

Optional.

Variable What it does Default When to change it
SESSION_COOKIE_DOMAIN The common parent domain with a leading dot, e.g. .kb.example.com. Scopes the session cookie to both hostnames. unset Set it with the two URLs.
ADMIN_PASSWORD The password of the admin account at install. unset: the install generates one and prints it to the log To pick it yourself.
OPENAI_API_KEY Enables the AI chat and the semantic search index. unset To turn on AI with OpenAI.
ANTHROPIC_API_KEY Keys the Anthropic provider; the chat stays on OpenAI until you select it. unset To use Anthropic.
MISTRAL_API_KEY Keys the Mistral AI provider; the chat stays on OpenAI until you select it. unset To use Mistral AI.
MAILER_DSN Outgoing mail as a Symfony mailer DSN, e.g. smtp://user:pass@smtp.example.com:587. unset: no mail leaves the site For login links, account mails and password resets.
MAIL_FROM The sender address of those mails. admin@example.com, which relays reject With MAILER_DSN.
WEBSERVER_UPLOAD_MAX_SIZE The webserver's cap on page file uploads, in Caddy units. 100MB For larger files; keep it above Drupal's field limits.
DRUPAL_LISTEN_IP The host address Drupal's port is published on. 127.0.0.1 When the reverse proxy is not on the host; then narrow REVERSE_PROXY_ADDRESSES.
DRUPAL_HTTP_PORT The host port of Drupal. 8080 When the port is taken.
FRONTEND_LISTEN_IP The host address the frontend's port is published on. 127.0.0.1 As DRUPAL_LISTEN_IP.
FRONTEND_HTTP_PORT The host port of the frontend. 3000 When the port is taken.
REVERSE_PROXY_ADDRESSES The proxies whose X-Forwarded-* headers Drupal trusts. 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 When the ports listen beyond loopback: the proxy's address only.
MARIADB_DATABASE The database name. drupal Rarely.
MARIADB_USER The database user. drupal Rarely.
OPENSEARCH_URL Where Drupal reaches OpenSearch. http://opensearch:9200 For an OpenSearch outside the stack.
OPENSEARCH_JAVA_OPTS The OpenSearch heap. -Xms512m -Xmx512m; -Xms256m -Xmx256m in the quickstart Rarely: the default fits the 4 GB.
OPENSEARCH_ALLOW_MMAP Memory mapping in OpenSearch. false starts on a host without vm.max_map_count=262144, and reads slower. true; false in the quickstart Evaluation only.
OPENKB_RECIPES_DIR Where the install reads its recipes, inside the drupal container. /app/recipes To install another set from a mounted directory.
OPENKB_IMAGE_PREFIX Where the two OpenKB images are pulled from. ghcr.io/openkb-app/openkb For a mirror.
OPENKB_TAG Which OpenKB images run. latest, the newest release To pin a version, e.g. 1.2.3, see Updates.
OPENKB_MARIADB_IMAGE The MariaDB image. the version the release was tested with E.g. for a newer patch release.
OPENKB_OPENSEARCH_IMAGE The OpenSearch image. the version the release was tested with E.g. for a newer patch release.

docker-compose.tls.yml only, the Caddy proxy the repository ships for a host without one:

Variable What it does Default When to change it
FRONTEND_HOST The hostname of the frontend URL. none With the TLS file.
DRUPAL_HOST The hostname of the Drupal URL. none With the TLS file.
TLS_CADDY_GLOBAL_OPTIONS Caddy global options, e.g. acme_ca <url> for a staging CA. unset For a staging CA.
TLS_CADDY_IMAGE The Caddy image. the version the TLS file names E.g. for a newer patch release.

Evaluation stack only: LISTEN_IP, the loopback address both ports are published on (127.0.0.1). Its ports are 8642 and 8643.

OpenSearch heap

OPENSEARCH_JAVA_OPTS sets the OpenSearch heap. The default is 512 MB, 256 MB in the quickstart; both fit the 4 GB of RAM the stack runs on.

Settings in the app

What the environment does not set is set in the app's administration. "Admin backend" in the account menu opens it. A site is run as Site manager, the role OpenKB ships for it. A site manager:

  • creates, edits, blocks and deletes accounts that hold no role or only "Site manager", and gives or takes that role, under People;
  • manages the AI guardrails, at /admin/config/ai/guardrails;
  • reads the recent log messages under Reports.

(User guide: Users and roles)

The Administrator account is not meant for running a site. What only an administrator reaches is advanced use: today that is the setup of the AI providers and models, and page types and tags. (User guide: Turning on AI, Customizing page types)

Setting up the AI providers and models is planned to move to the Site manager before the stable release.

Changing other Drupal configuration

The backend is a Drupal site, and an administrator can change any of its configuration. That is an advanced use case and not part of the supported update path: a change OpenKB does not ship can conflict with future updates. Where you can, keep to the environment variables and to what the Site manager sets.