systemctl — Service Management Cheatsheet
Control systemd services on Ubuntu / Debian Linux.
Start / Stop / Restart
sudo systemctl start <service> # start now
sudo systemctl stop <service> # stop now
sudo systemctl restart <service> # stop + start
sudo systemctl reload <service> # reload config without full restart (if supported)Enable / Disable (boot behaviour)
sudo systemctl enable <service> # auto-start on boot
sudo systemctl disable <service> # don't auto-start on boot (keeps running now)
sudo systemctl enable --now <service> # enable + start immediately
sudo systemctl disable --now <service> # disable + stop immediatelyMask / Unmask (hard block)
sudo systemctl mask <service> # completely prevent starting (even manually or as dependency)
sudo systemctl unmask <service> # reverse the maskStatus & Inspection
sudo systemctl status <service> # show status, recent logs
sudo systemctl is-enabled <service> # enabled / disabled / masked
sudo systemctl is-active <service> # active / inactive
systemctl list-units --type=service # all running services
systemctl list-unit-files --type=service # all installed services with enable stateLogs
journalctl -u <service> # all logs for service
journalctl -u <service> -f # follow live logs
journalctl -u <service> --since "1 hour ago"
journalctl -u <service> -n 50 # last 50 linesCommon service names
| Service | Name |
|---|---|
| Nginx | nginx |
| PostgreSQL | postgresql |
| MySQL / MariaDB | mysql / mariadb |
| Docker | docker |
| Redis | redis-server |
| SSH | ssh |
Service files live in /etc/systemd/system/ (custom) and /lib/systemd/system/ (system).
Quick reference table
| Command | Boot | Currently running |
|---|---|---|
enable | ✅ starts on boot | unchanged |
disable | ❌ won’t start on boot | unchanged |
enable --now | ✅ starts on boot | starts now |
disable --now | ❌ won’t start on boot | stops now |
mask | ❌ blocked entirely | stops now |
start | unchanged | starts now |
stop | unchanged | stops now |
See also
update-rc.d— older SysV init alternative (rarely needed on modern Ubuntu)