Run as a systemd Service
Use a user-level systemd unit to run term-serve continuously.
1) Create an environment file
Section titled “1) Create an environment file”~/.config/term-serve/env:
PORT=31337AUTH_TOKEN=your-secure-auth-token-hereRestrict permissions:
chmod 600 ~/.config/term-serve/env2) Create user service unit
Section titled “2) Create user service unit”~/.config/systemd/user/term-serve.service:
[Unit]Description=term-serve (user)After=network-online.targetWants=network-online.target
[Service]Type=simpleExecStart=%h/.local/bin/term-serve --host=0.0.0.0 --auth-token=${AUTH_TOKEN} --cwd=%hRestart=on-failureRestartSec=1EnvironmentFile=%h/.config/term-serve/env
[Install]WantedBy=default.target3) Enable and start
Section titled “3) Enable and start”systemctl --user daemon-reloadsystemctl --user enable --now term-serve.service4) Tail logs
Section titled “4) Tail logs”journalctl --user -u term-serve.service -f- If you bind to non-local interfaces, always set an explicit token.
- Prefer TLS and a perimeter (VPN / tunnel / access-controlled proxy).