2026-10-26 05:59:55 +01:00
|
|
|
# Docker Compose deployment
|
|
|
|
|
|
|
|
|
|
The required stack is PostgreSQL and Heimdall Central. The Agent is deployed
|
|
|
|
|
separately on each camera-network host; the Central UI supplies a
|
|
|
|
|
digest-pinned Agent Compose file for each site. RustFS, ntfy, Ollama, TURN,
|
|
|
|
|
Redis and scheduled backups have separate Compose files and can be left out.
|
|
|
|
|
|
|
|
|
|
## Central and database
|
|
|
|
|
|
2026-10-26 08:31:21 +01:00
|
|
|
For a new Linux server, clone this repository and launch the interactive
|
|
|
|
|
installer from its root:
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
git clone https://sources.tordais.cc/arnaud.dartois/Heimdall.git
|
|
|
|
|
cd Heimdall
|
|
|
|
|
./install/install-server.sh
|
|
|
|
|
```
|
|
|
|
|
|
2026-10-26 08:34:15 +01:00
|
|
|
The installer uses the server image `eltruncho/heimdall:latest` from Docker Hub,
|
2026-10-26 08:31:21 +01:00
|
|
|
creates a minimal Central + PostgreSQL Compose project, generates PostgreSQL
|
|
|
|
|
and JWT secrets, and writes them to a mode-600 `.env` and secret file in the
|
|
|
|
|
chosen installation directory. It asks which optional services to prepare and
|
|
|
|
|
whether to start each one. Integration URLs and credentials remain configured
|
|
|
|
|
in Central's UI. Review the generated files before starting the stack.
|
|
|
|
|
|
2026-10-26 18:46:46 +01:00
|
|
|
The repository's `docker/docker-compose.prod.yml` is a manual alternative for
|
|
|
|
|
operators who need a custom layout. It does not use files generated by the
|
|
|
|
|
interactive installer. Keep `docker/.env` private (mode 600) and create a
|
|
|
|
|
PostgreSQL password file; its value must match the password in `DATABASE_URL`.
|
|
|
|
|
The `.env.example` file contains development credentials and must not be used
|
|
|
|
|
unchanged for a production deployment.
|
2026-10-26 05:59:55 +01:00
|
|
|
|
|
|
|
|
```sh
|
2026-10-26 18:46:46 +01:00
|
|
|
umask 077
|
2026-10-26 05:59:55 +01:00
|
|
|
mkdir -p -m 700 docker/secrets
|
2026-10-26 18:46:46 +01:00
|
|
|
db_password="$(openssl rand -hex 32)"
|
|
|
|
|
printf '%s' "$db_password" > docker/secrets/db_password
|
|
|
|
|
cat > docker/.env <<EOF
|
|
|
|
|
POSTGRES_DB=heimdall
|
|
|
|
|
POSTGRES_USER=heimdall
|
|
|
|
|
DATABASE_URL=Host=postgresql;Port=5432;Database=heimdall;Username=heimdall;Password=${db_password}
|
|
|
|
|
JWT__KEY=$(openssl rand -hex 32)
|
|
|
|
|
JWT__REFRESHKEY=$(openssl rand -hex 32)
|
|
|
|
|
JWT__ISSUER=heimdall
|
|
|
|
|
JWT__AUDIENCE=heimdall-api
|
|
|
|
|
ASPNETCORE_ENVIRONMENT=Production
|
|
|
|
|
WEB_PORT=5000
|
|
|
|
|
Cors__AllowedOrigins=https://heimdall.example.org
|
|
|
|
|
EOF
|
|
|
|
|
unset db_password
|
|
|
|
|
# Replace the example origin above with the public origin of your Central.
|
2026-10-26 05:59:55 +01:00
|
|
|
docker compose --env-file docker/.env -f docker/docker-compose.prod.yml up -d
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
The development Compose builds Central from the local source and starts only
|
|
|
|
|
Central plus PostgreSQL:
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
docker compose --env-file docker/.env -f docker/docker-compose.yml up -d
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
## Agent
|
|
|
|
|
|
|
|
|
|
Prefer the Compose shown in the Central UI's site installation panel. It uses
|
|
|
|
|
the image reference and digest from Central's verified release manifest and
|
2026-10-26 18:46:46 +01:00
|
|
|
includes the site token, public Central URL, Agent name and release public key.
|
|
|
|
|
Save it as `docker-compose.yml`, then run `docker compose up -d`. The generated
|
|
|
|
|
Compose contains the pinned trust key; no separate PEM file is required. Do
|
|
|
|
|
not substitute a mutable image tag for the digest.
|
2026-10-26 05:59:55 +01:00
|
|
|
|
2026-10-26 06:42:47 +01:00
|
|
|
The Agent Compose is generated by Central's UI for the selected site; there is
|
|
|
|
|
no production Agent Compose in this repository. For local development only,
|
|
|
|
|
use `docker/docker-compose.agent.dev.yml` with a development site token and the
|
|
|
|
|
local Central URL. The published Agent image uses CPU inference. The optional
|
|
|
|
|
NVIDIA, AMD and Intel overlays expose hardware for inventory; they do not
|
|
|
|
|
enable GPU inference.
|
2026-10-26 05:59:55 +01:00
|
|
|
|
|
|
|
|
## Optional software
|
|
|
|
|
|
|
|
|
|
Start Central first to create the shared `heimdall-net` network. Optional
|
|
|
|
|
services then join that network where applicable, so their Compose projects
|
|
|
|
|
remain separate while Central can resolve their service names.
|
|
|
|
|
|
|
|
|
|
```sh
|
|
|
|
|
docker compose --env-file docker/.env -f docker/docker-compose.ollama.yml up -d
|
|
|
|
|
docker compose --env-file docker/.env -f docker/docker-compose.ntfy.yml up -d
|
|
|
|
|
docker compose --env-file docker/.env -f docker/docker-compose.rustfs.yml up -d
|
|
|
|
|
docker compose --env-file docker/.env -f docker/docker-compose.coturn.yml up -d
|
|
|
|
|
docker compose --env-file docker/.env -f docker/docker-compose.redis.yml up -d
|
|
|
|
|
docker compose --env-file docker/.env -f docker/docker-compose.backup.yml up -d
|
|
|
|
|
```
|
|
|
|
|
|
2026-10-26 06:26:00 +01:00
|
|
|
Configure Ollama at `http://ollama:11434` in Central's AI settings when enabled.
|
|
|
|
|
Choose RustFS as the storage provider in Central and use `http://rustfs:9000` as
|
|
|
|
|
its endpoint. Configure the ntfy server URL in Central's notification settings.
|
|
|
|
|
TURN is not required until WebRTC is enabled.
|
2026-10-26 05:59:55 +01:00
|
|
|
Redis is provided as a standalone service but is not currently required by
|
|
|
|
|
Central. Backups are independent of the core startup and require the core
|
|
|
|
|
network and PostgreSQL service to be running.
|
|
|
|
|
|
|
|
|
|
See [GPU Agent notes](gpu-runtime.md) and
|
|
|
|
|
[Agent update signing](agent-release-signing.md) for device access and
|
|
|
|
|
trusted-key setup.
|