Systemd Service
Service File Location
Section titled “Service File Location”When you run vps-deployer config, a user-level systemd unit file is created at:
~/.config/systemd/user/vps-deployer.serviceGenerated Service File
Section titled “Generated Service File”Here’s an example of what gets generated:
[Unit]Description=VPS Deployer Service (vps-deployer)After=network.target
[Service]Type=simpleExecStart=/home/user/.nvm/versions/node/v24.14.0/bin/node /home/user/.nvm/versions/node/v24.14.0/bin/vps-deployer daemon -w "/opt/vps-deployer" -p "3000" -s "my-secret-key"WorkingDirectory=/opt/vps-deployerRestart=alwaysRestartSec=5
StandardOutput=journalStandardError=journal
[Install]WantedBy=default.targetKey details:
- Absolute paths — both the Node.js binary and vps-deployer binary use absolute paths detected at config time
daemonsubcommand — a hidden command that runs the Express server (not meant for direct CLI use)- Quoted arguments — all flags are quoted to handle special characters in session keys
- Auto-restart —
Restart=alwaysensures the service recovers from crashes - Journal logging — stdout/stderr go to
journalctl
Managing the Service
Section titled “Managing the Service”# Startvps-deployer start
# Check statussystemctl --user status vps-deployer
# View logsjournalctl --user -u vps-deployer -f
# Stopsystemctl --user stop vps-deployer
# Restartsystemctl --user restart vps-deployer
# Removevps-deployer uninstallPersisting Across Reboots
Section titled “Persisting Across Reboots”For the service to start automatically on boot, enable user lingering:
loginctl enable-linger $USERWithout this, the service stops when you log out of SSH.
Graceful Shutdown
Section titled “Graceful Shutdown”When the service receives SIGTERM (from systemctl stop), VPS Deployer:
- Stops accepting new HTTP connections
- Waits 5 seconds for existing connections to finish
- Closes the SQLite database
- Flushes pending log writes
- Exits with code 0
A 10-second fallback forcefully closes all connections if graceful shutdown stalls.