Install

Workshop-shaped mod on the dedicated server, plus a host-side collector that POSTs snapshots to the KnoxStats API. Full detail: knoxstats/docs/install.md in the repo.

1. Enable the mod

  1. Publish (or distribute) the KnoxStats B42 mod so every joiner has it.
  2. On the dedicated server, enable Mods=KnoxStats and the Workshop item when published. On VaultPanel hosts use vp.py enable-local KnoxStats — do not hand-edit mod lists.
  3. Until Workshop publish, every client needs local mod files or joiners get mod-mismatch kicks.

2. What the mod writes

Wall-clock interval (default 5s; sandbox CaptureIntervalSeconds) to the Zomboid Lua folder:

~/Zomboid/Lua/knoxstats.json
# Windows: %USERPROFILE%\Zomboid\Lua\knoxstats.json

Schema v2 includes players with steam_id (owner-only detail) and loaded zombie cells.

3. Run the API and create a token

cd knoxstats/api
python -m venv .venv
# Windows: .venv\Scripts\activate
pip install -r requirements.txt
python admin.py create-token --server-name "My PZ Server"
# Windows: .\run_api.ps1   or   .\run_api.ps1 -Port 8743

Save the printed token once. Default listing is public (public=true). Hide later: python admin.py set-public --server-id <id> --private.

4. Install the collector

Polls knoxstats.json and POSTs to /v1/ingest. Does not run inside PZ.

Windows

cd knoxstats\collector
.\install_collector.ps1
# Edit config.toml — api_url + token
.\run_collector.ps1

Linux (systemd)

cd knoxstats/collector
python3.11 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
sudo cp config.example.toml /etc/knoxstats/config.toml  # edit token + api_url
sudo cp systemd/knoxstats-collector.service /etc/systemd/system/
sudo systemctl enable --now knoxstats-collector

5. Verify

  1. Public list: /servers — aggregates only.
  2. Owner detail: /owner — paste the same bearer token.
  3. Health: /health

Production DNS/HTTPS and Workshop publish are operator steps — see knoxstats/docs/workshop-publish-checklist.md and privacy docs. Do not enable on a live public PZ server until joiners have the mod.