Installation

This page is the install for production: your own server, your own hostnames and secrets. To look at OpenKnowledgebase first, use the Quickstart.

Prerequisites

A production install needs a host with:

  • Docker with the compose plugin, 2.24 or newer. Check it with docker compose version.
  • Two hostnames under one parent domain, both pointing at the host: one for the knowledge base (kb.example.com), one for Drupal (admin.kb.example.com).
  • 4 GB of RAM free for the stack.
  • vm.max_map_count=262144 on the host, for OpenSearch:

    sysctl -w vm.max_map_count=262144

    Add the same line to /etc/sysctl.conf to keep it across reboots.

  • A reverse proxy that terminates TLS and forwards each hostname to its service. The requirements and examples for Caddy, Traefik, nginx and Cloudflare Tunnel are in the reverse proxy section of docs/self-hosting.md. A host without one can use the one the repository provides, see Optional: set up a reverse proxy.

The README lists CPU, disk and browser requirements.

Install

A production install is the project's own docker-compose.yml with a .env of your own:

git clone https://github.com/openkb-app/openkb.git && cd openkb
cp .env.example .env   # fill in the two URLs, the cookie domain and the secrets
docker compose pull && docker compose up -d

.env holds the two URLs, the cookie domain and the secrets; Configuration lists every setting. The drupal container installs the site on its first boot. That takes a few minutes, with a "setting up" page until it is through; docker compose logs -f drupal shows the install and prints the admin password, unless .env sets one. docs/self-hosting.md covers what a production host needs: the two hostnames, the reverse proxy, the secrets, outgoing mail and the backup set.

Optional: set up a reverse proxy

If the host has no reverse proxy yet, the repository provides one: docker-compose.tls.yml puts Caddy in front of the stack. It terminates TLS for both hostnames and gets their certificates by itself. Both hostnames have to resolve to the host, and ports 80 and 443 have to be reachable. Name the two hostnames in .env:

FRONTEND_HOST=kb.example.com
DRUPAL_HOST=admin.kb.example.com

Then start the stack with both compose files:

docker compose -f docker-compose.yml -f docker-compose.tls.yml up -d

Every later docker compose command takes the same two -f options, an update included. To save typing them, set COMPOSE_FILE=docker-compose.yml:docker-compose.tls.yml in .env once.

After the first boot

The user guide ships with the app and is ready after the first boot; its "Initial setup" page takes it from there. See User guide.