LLevelUp
0
← Back to topic

Systemd Processes

systemd keeps long-running processes alive. Instead of starting an app manually in a terminal, define a service.

[Unit]
Description=LevelUp app
After=network.target

[Service]
WorkingDirectory=/var/www/app
ExecStart=/usr/bin/node server.js
Restart=always
User=deploy

[Install]
WantedBy=multi-user.target
sudo systemctl daemon-reload
sudo systemctl enable --now levelup
sudo systemctl status levelup
journalctl -u levelup -f

Further Learning

  • “systemd service file ExecStart” — service units
  • “journalctl service logs” — log inspection
  • “systemctl enable restart” — lifecycle commands