Deploy with systemd
Unit file
Section titled “Unit file”/etc/systemd/system/kanna.service:
[Unit]Description=KannaAfter=network.target
[Service]Type=simpleUser=kanna
# The data directory is always $HOME/.kanna and is not configurable directly,# so point HOME at where you want state to live. systemd does not set HOME# from User= on its own.Environment=HOME=/var/lib/kanna
# Port and password are CLI flags — there is no KANNA_PORT / KANNA_PASSWORD.ExecStart=/usr/local/bin/kanna --port 3210 --password changeme --no-openRestart=on-failureRestartSec=3
[Install]WantedBy=multi-user.targetEnable + start
Section titled “Enable + start”sudo systemctl daemon-reloadsudo systemctl enable --now kannasudo systemctl status kannajournalctl -u kanna -fSelf-update under systemd
Section titled “Self-update under systemd”Nothing to configure. The kanna command is a small supervisor that runs
the server as a child process: on a self-update the child installs the new
version and exits with a restart code, and the supervisor re-spawns it in
place. The process systemd is watching never exits, so systemctl is never
involved and no Restart= tuning is needed for updates.
Restart=on-failure above is there for genuine crashes.