Production Deployment
Ketos Agent ships as a single static binary with zero runtime dependencies, ready for bare-metal hosts, VMs, edge nodes, and Docker / Kubernetes clusters.
Linux systemd Service
Section titled “Linux systemd Service”Place the binary at /usr/local/bin/ketos-agent and your config at /etc/ketos-agent/config.yml, then create /etc/systemd/system/ketos-agent.service:
[Unit]Description=Ketos Agent - Full-Context Incident CollectorAfter=network-online.target
[Service]Type=simpleExecStart=/usr/local/bin/ketos-agent --config /etc/ketos-agent/config.ymlExecReload=/bin/kill -HUP $MAINPIDRestart=on-failureRestartSec=5sLimitNOFILE=65536
[Install]WantedBy=multi-user.targetEnable and manage the service:
sudo systemctl daemon-reloadsudo systemctl enable --now ketos-agent
# Config changes hot-reload automatically; you can also trigger reload via SIGHUPsudo systemctl reload ketos-agent
# Tail service logsjournalctl -u ketos-agent -fMonitoring the Host from a Container (Docker / Kubernetes)
Section titled “Monitoring the Host from a Container (Docker / Kubernetes)”Mount the host root filesystem read-only at /hostfs and set root_path: /hostfs to safely collect host metrics and Top processes:
inputs: host: - id: default root_path: /hostfs
storage: dir: /var/lib/ketos-agent max_disk_mb: 50 max_snapshots: 500docker run -d --name ketos-agent \ --restart unless-stopped \ --pid=host --net=host \ -v /:/hostfs:ro \ -v $(pwd)/config.yml:/etc/ketos-agent/config.yml:ro \ -v $(pwd)/data:/var/lib/ketos-agent \ your-image --config /etc/ketos-agent/config.yml[!TIP] Mounting
--pid=hostletstop_processesaccurately report host process names and PIDs. Always mount the host root filesystem read-only (:ro).
Cross-Platform Static Builds (From Source)
Section titled “Cross-Platform Static Builds (From Source)”If you need to compile static binaries for target platforms yourself:
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o bin/ketos-agent-linux-amd64 ./cmd/ketos-agentCGO_ENABLED=0 GOOS=linux GOARCH=arm64 go build -trimpath -ldflags="-s -w" -o bin/ketos-agent-linux-arm64 ./cmd/ketos-agentCGO_ENABLED=0 GOOS=windows GOARCH=amd64 go build -trimpath -ldflags="-s -w" -o bin/ketos-agent-windows-amd64.exe ./cmd/ketos-agentGraceful Shutdown & Power-Loss Safety
Section titled “Graceful Shutdown & Power-Loss Safety”- Ordered drain: On
SIGINT/SIGTERM, the collector shuts down cleanly in order:collectors → rule engine → snapshot writer → plugins, saving any in-flight evidence safely (status: partialif the post-window has not yet elapsed). - Power-loss safe: All
.mdcontext files are written via atomic temp-file replacement; stale temporary files are cleaned up and quotas recalibrated automatically on startup. See Security & Resource Limits.