systemd Services
5 min read
Manage services with systemctl start, stop, restart, enable, and status. enable makes a service start automatically at boot. journalctl -u nginx -f follows a service's logs in real time to diagnose issues.
Managing Services with systemd
sudo systemctl start nginx # start
sudo systemctl stop nginx # stop
sudo systemctl restart nginx # restart
sudo systemctl reload nginx # reload config
sudo systemctl status nginx # check status
sudo systemctl enable nginx # start on boot
sudo systemctl disable nginx # remove from boot
# View logs
journalctl -u nginx
journalctl -u nginx -f # follow
journalctl -u nginx --since "1 hour ago"