Skip to content

Run in production

Deploy the container image securely, own the data directory, and size the host.

Updated

Run the published image with the hardening the Compose file uses, give it a data directory that it alone owns, and work through the checklist before you point real producers at it.

What is in the image

The image holds the logbrook executable and its runtime libraries, with no build tools or source files.

  • The runtime stage is a digest-pinned, multi-architecture gcr.io/distroless/cc-debian13:nonroot image. It supplies glibc, the C++ runtime that bundled DuckDB needs, and CA roots.
  • There is no shell and no package manager. Run client commands with docker exec <container> logbrook ....
  • The process runs directly as UID and GID 10001:10001. Docker sends SIGTERM to it (STOPSIGNAL SIGTERM).
  • The image sets LOGBROOK_BIND=0.0.0.0:3100 and LOGBROOK_DATA_DIR=/data, declares /data as a volume, and exposes 3100, plus 24224 (TCP and UDP) for the optional Forward listener.
  • The default command is serve.
  • The license is at /usr/share/licenses/logbrook/LICENSE. Dependency licenses and notices are at /usr/share/licenses/logbrook/THIRD_PARTY_NOTICES.txt.
  • The built-in healthcheck runs logbrook healthcheck every 30 seconds with a 5 second timeout, a 15 second start period and 3 retries. It calls /ready without credentials and needs no shell.

Run with hardening

The Compose file sets these options. Use the equivalents wherever you run the container.

docker run -d --name logbrook \
  --read-only \
  --tmpfs /tmp:rw,noexec,nosuid,size=256m,mode=1777 \
  --cap-drop ALL \
  --security-opt no-new-privileges:true \
  --stop-timeout 35 \
  --restart unless-stopped \
  -p 127.0.0.1:3100:3100 \
  -v logbrook-data:/data \
  -e LOGBROOK_INGEST_TOKEN \
  -e LOGBROOK_READ_TOKEN \
  ghcr.io/sandrinodm/logbrook:0.5.0
Setting Why
Read-only root file system Only /data and /tmp need to be writable.
256 MiB /tmp tmpfs Scratch space without a writable root.
--cap-drop ALL, no-new-privileges The process needs no capabilities.
35 second stop timeout Graceful shutdown takes up to 30 seconds (shutdown_timeout_secs), and Docker must wait longer than that before it sends SIGKILL.
Publish on 127.0.0.1 Logbrook serves plain HTTP. See listen address and ports.

Own the data directory

  • One process per data directory. Never run two Logbrook processes on the same data root or mount one volume into two containers.
  • Ownership. /data in the image is writable and owned by UID 10001, including on a fresh named volume. A bind mount must have the same ownership: chown -R 10001:10001 /srv/logbrook.
  • Keep other files out. At startup Logbrook removes .tmp and unreferenced .parquet files from each archive directory, and it cleans .index-trash/. Do not store anything else there.
  • No symlinks. Index directories and files cannot be symlinks.
  • Path rules. The data directory path must be UTF-8 and cannot contain *, ?, [ or ].
  • Take backups offline. See backup, restore and upgrade.

Listen address and ports

Setting Value
Native default bind 127.0.0.1:3100
Container bind 0.0.0.0:3100 (set by LOGBROOK_BIND in the image)
Forward listener Off until a configuration file enables it; the image exposes 24224

If you change the port inside the container, set LOGBROOK_BIND to match, because the healthcheck reads the address from --config or LOGBROOK_BIND.

Logbrook does not terminate TLS for the HTTP API, and tokens travel in the Authorization header. For remote access, put a TLS-terminating reverse proxy in front and keep the container port on loopback or a private network.

If you also run the web UI, it needs its own authenticating proxy: the UI has no login of its own. See Run the UI.

Sizing

There are no published sizing figures, so measure with your own workload. Account for the following.

  • DuckDB memory is not the process memory. storage.memory_limit (default 512MB) is divided across max_indexes slots, counting unused ones, and it does not cap the process RSS, so leave headroom. Compose sets no CPU or memory limit.
  • Request budgets. Raw body admission (16 MiB) and decoded admission (64 MiB) limit memory held by HTTP request bodies, not total memory. See limits and errors.
  • Each index adds threads. Reader workers and DuckDB threads apply per index. Set max_indexes = 1 for a single-index deployment, or raise the total budgets when you add slots.
  • Disk. The disk target (max_size_gb) is a retention target, not a hard limit. Transactions, exports, compaction and query spills can briefly exceed it. Watch free disk separately, and use a filesystem quota if you need a hard ceiling. /ready does not warn about low disk space.
  • Load tests. The repository has load generators under cargo xtask; see Contributing.

Production checklist

  • Image pinned to a version tag or digest.
  • Ingest, read and admin tokens are random, 16 to 512 characters and distinct from each other. See credentials.
  • Producer and reader tokens are scoped to the sources and indexes they need.
  • Container runs read-only, with dropped capabilities and a 35 second stop timeout.
  • /data is on a persistent volume with a single owner process, owned by UID 10001.
  • Port 3100 is not exposed directly; a TLS-terminating proxy handles remote access.
  • If you run the web UI, it is behind an authenticating reverse proxy, or bound to loopback.
  • Retention, archive age and disk target are set for each index. See indexes and retention.
  • Prometheus scrapes /metrics and you alert on free disk. See monitoring.
  • You have taken and restored a backup at least once. See backup and upgrade.
  • Producers retry 429 with backoff, and you accept that a retried ingestion can store duplicates.

Next steps

Type to search…

↑↓ navigate↵ selectEsc close