systemd
/etc/systemd/system/myapp.service
[Unit] Description=My App Server After=network.target postgresql.service [Service] User=appuser ExecStart=/opt/myapp/server --port 8080 Restart=on-failure RestartSec=5 LimitNOFILE=65535 [Install] WantedBy=multi-user.target
- systemctl start myapp (Start service now) - systemctl enable myapp (Set to start on boot) - systemctl daemon-reload (Mandatory after editing any .service file!) - systemctl list-units --failed (Check if anything is broken) - journalctl -u myapp -f (Tail the logs continuously) - journalctl -u myapp --since "1 hour ago" (Time-bounded log query)
systemctl start myapp
systemctl enable myapp
systemctl daemon-reload
systemctl list-units --failed
journalctl -u myapp -f
journalctl -u myapp --since "1 hour ago"
usermod -G docker dev1
sudo