systemctl – control the systemd system and service manager

systemctl controls systemd services. Use it to start, stop, enable, and check the status of services on modern Linux systems.
Synopsis
systemctl [OPTIONS] COMMAND [UNIT...]
Common Commands
| Command | Description |
|---|---|
start | Start a service |
stop | Stop a service |
restart | Restart a service |
reload | Reload config without restart |
status | Show service status |
enable | Start at boot |
disable | Don’t start at boot |
is-active | Check if running |
is-enabled | Check if enabled at boot |
Examples
Service management
$ sudo systemctl start nginx
$ sudo systemctl stop nginx
$ sudo systemctl restart nginx
$ sudo systemctl reload nginx # Reload config
Check status
$ systemctl status nginx
● nginx.service - A high performance web server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled)
Active: active (running) since Mon 2025-01-15 10:00:00 UTC
Docs: man:nginx(8)
Main PID: 1234 (nginx)
Enable/disable at boot
$ sudo systemctl enable nginx
$ sudo systemctl disable nginx
$ systemctl is-enabled nginx
enabled
Quick checks
$ systemctl is-active nginx
active
$ systemctl is-failed nginx
active
List services
# All loaded units
$ systemctl list-units
# Only services
$ systemctl list-units --type=service
# All installed services
$ systemctl list-unit-files --type=service
# Failed services
$ systemctl --failed
View service file
$ systemctl cat nginx
$ systemctl show nginx # All properties
Edit service
$ sudo systemctl edit nginx # Create override
$ sudo systemctl edit --full nginx # Edit entire file
System Commands
# Reboot
$ sudo systemctl reboot
# Shutdown
$ sudo systemctl poweroff
# Suspend
$ sudo systemctl suspend
# View boot targets
$ systemctl get-default
graphical.target
# Change to multi-user (no GUI)
$ sudo systemctl isolate multi-user.target
Common Patterns
Restart if running
$ sudo systemctl try-restart nginx
Reload or restart
$ sudo systemctl reload-or-restart nginx
Mask service (prevent starting)
$ sudo systemctl mask nginx
$ sudo systemctl unmask nginx
Reset failed status
$ sudo systemctl reset-failed
Tips
- Check logs: Use
journalctl -u servicefor service logs - Tab completion: Type
systemctl sta<TAB>for commands - No sudo for status:
systemctl statusworks as regular user - User services:
systemctl --userfor user-level services
See Also
Related Commands
- journalctl — View systemd logs
- systemd-analyze — Analyze boot time
- service — Legacy service command






