KUI is deployed via systemd as the primary mechanism. For TLS and reverse-proxy setup (nginx/Caddy), see docs/deployment.md. For first-run setup and config, see docs/admin-guide.md.
/var/lib/kuimust exist and be writable by the service user (DB, git templates, audit chain)- Config at
/etc/kui/config.yaml(or setKUI_CONFIGto override) - KUI binary at
/usr/local/bin/kui(or adjustExecStartin the unit)
-
Copy the unit file:
sudo cp deploy/systemd/kui.service /etc/systemd/system/
-
If the binary is elsewhere (e.g.
/opt/kui/bin/kui), edit the unit:sudo systemctl edit kui # Add: # [Service] # ExecStart=/opt/kui/bin/kui --config /etc/kui/config.yaml
-
Create runtime directory and config:
sudo mkdir -p /var/lib/kui sudo chown kui:kui /var/lib/kui # or your service user sudo mkdir -p /etc/kui # Create /etc/kui/config.yaml with hosts, jwt_secret, etc. sudo $EDITOR /etc/kui/config.yaml
-
Enable and start:
sudo systemctl daemon-reload sudo systemctl enable kui sudo systemctl start kui sudo systemctl status kui
- Type:
simple(will switch tonotifywhen readiness signaling is implemented) - Restart:
on-failure - Config:
--config /etc/kui/config.yamlorKUI_CONFIGenv var - Runtime data:
/var/lib/kui/for SQLite DB, git-backed templates, and audit chain
The default unit assumes real FHS paths on the host (/etc/kui, /var/lib/kui). For a relocatable tree under a single directory, run KUI with --prefix (or set KUI_PREFIX in the unit). Logical paths stay the same in ExecStart; they are opened under the prefix on disk.
Example: If all state lives under /opt/kui-run, create /opt/kui-run/etc/kui/config.yaml, /opt/kui-run/var/lib/kui, and matching permissions for the service user. Then use a command equivalent to:
# Alternate (commented in kui.service): relocatable root
# ExecStart=/usr/local/bin/kui --prefix /opt/kui-run --config /etc/kui/config.yamlThat reads config from /opt/kui-run/etc/kui/config.yaml and places DB/git defaults under /opt/kui-run/var/lib/kui/... when config uses the usual absolute-style paths.
WorkingDirectory vs --prefix: WorkingDirectory= only sets the process cwd for relative paths in other tools and subprocess behavior; KUI’s prefix resolution does not use WorkingDirectory as the runtime root. Set --prefix when you want FHS-like paths to map under a relocatable directory. Full semantics and precedence (--prefix, KUI_PREFIX) are in docs/admin-guide.md.