Manage services with systemctl
Updated 27 Nov 2026 systemd services
Start, stop, enable and inspect the services running on your server.
Everyday commands
sudo systemctl status nginx
sudo systemctl start nginx
sudo systemctl stop nginx
sudo systemctl restart nginx
sudo systemctl reload nginx # re-read configuration without stopping
sudo systemctl enable --now nginx # start now and at every boot
sudo systemctl disable --now nginx
Find problems
systemctl --failed
systemctl list-units --type=service --state=running
journalctl -u nginx -n 50 --no-pager
Change a unit without editing the packaged file
sudo systemctl edit nginx
Add only the settings you want to override, for example:
[Service]
Restart=on-failure
RestartSec=5
Then:
sudo systemctl daemon-reload
sudo systemctl restart nginx
Limit resources
[Service]
MemoryMax=400M
CPUQuota=50%
This stops one service from taking all the memory of a small server.
To run your own program as a service, see Run an application as a systemd service.