# 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 For a new Linux server, run the interactive installer directly from the source repository; cloning the repository is not required: ```bash SOURCE_BASE_URL="${HEIMDALL_SOURCE_BASE_URL:-https://sources.tordais.cc/arnaud.dartois/Heimdall/raw/branch/main}" curl -fsSL "$SOURCE_BASE_URL/install/install-server.sh" | HEIMDALL_SOURCE_BASE_URL="$SOURCE_BASE_URL" bash ``` The installer uses `eltruncho/heimdall:latest` from Docker Hub, creates a minimal Central + PostgreSQL Compose project, and configures the maintained `nickfedor/watchtower` fork to check the explicitly labelled Central container every 24 hours. Watchtower uses `--cleanup` to remove the previous Central image after updating; it does not remove PostgreSQL data or named volumes. `pull_policy: always` also makes each `docker compose up` pull the configured images, including optional service Compose files. It generates PostgreSQL and JWT secrets locally 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. Selected optional Compose files and backup scripts are fetched individually; no repository checkout is created. Integration URLs and credentials remain configured in Central's UI. The script requires an interactive terminal and reads prompts from it even when downloaded with a pipe. Running either installer again in the same directory offers to refresh the generated Compose. It first validates the new file, saves the previous one as `docker-compose.yml.bak.`, and replaces it. Existing `.env`, secret files, and Docker volumes are preserved. If the new Compose requires an env key that is missing, the installer adds a generated secret or a default value without changing existing entries. It does not rotate the PostgreSQL password; the existing secret file and `DATABASE_URL` must remain paired. Declining the update leaves the installation unchanged. Inspect custom Compose edits in the backup before deciding whether to carry them into future generated versions. If you choose an optional service again, its refreshed Compose or script asset also gets a timestamped backup before replacement. Watchtower needs access to `/var/run/docker.sock`, which grants broad control over the Docker host. The upstream project describes itself for homelabs and similar setups and does not recommend it for commercial/production workloads; automatic latest-tag updates also do not provide staged rollout or rollback. For stricter production change control, disable/remove the Watchtower service and deploy a reviewed image digest through an orchestrator or release process. On Windows 10/11 with Docker Desktop in Linux-container mode, use PowerShell to download and run the matching installer without cloning the repository: ```powershell $sourceBase = if ($env:HEIMDALL_SOURCE_BASE_URL) { $env:HEIMDALL_SOURCE_BASE_URL.TrimEnd('/') } else { 'https://sources.tordais.cc/arnaud.dartois/Heimdall/raw/branch/main' } $installer = Join-Path $env:TEMP 'heimdall-install-server.ps1' Invoke-WebRequest -UseBasicParsing -Uri "$sourceBase/install/install-server.ps1" -OutFile $installer Set-ExecutionPolicy -Scope Process Bypass -Force & $installer Remove-Item $installer ``` The execution-policy bypass applies only to the current PowerShell process; a Group Policy can still block script execution. Both installers generate secrets locally and keep them in the selected installation directory. The scripts use the source URL shown above by default. To pin a reviewed revision, set `HEIMDALL_SOURCE_BASE_URL` to its `raw/commit/` URL before downloading and running the installer; this also selects optional Compose and backup files. An offline installation must provide those selected assets. The repository's `docker/docker-compose.prod.yml` is a manual alternative for operators who need a custom layout. It includes the same scoped Watchtower service and pull policies. 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. ```sh umask 077 mkdir -p -m 700 docker/secrets db_password="$(openssl rand -hex 32)" printf '%s' "$db_password" > docker/secrets/db_password cat > docker/.env <