systemd service management systemctl Cheat Sheet banner

systemctl Cheat Sheet

Use systemctl to manage Linux services, inspect failures, enable startup services and troubleshoot systemd units.

Start here

Check service status

Status

systemctl status nginx

Is active?

systemctl is-active nginx

Is enabled?

systemctl is-enabled nginx

Failed services

systemctl --failed

Start, stop and restart

TaskCommand
Startsystemctl start nginx
Stopsystemctl stop nginx
Restartsystemctl restart nginx
Reload configsystemctl reload nginx
Restart only if runningsystemctl try-restart nginx

Enable and disable startup services

Enable at boot

systemctl enable nginx

Disable at boot

systemctl disable nginx

Enable and start now

systemctl enable --now nginx

Disable and stop now

systemctl disable --now nginx

List services and units

Running services

systemctl list-units --type=service

All service files

systemctl list-unit-files --type=service

Loaded units

systemctl list-units

Dependencies

systemctl list-dependencies nginx

View service logs

Recent logs

journalctl -u nginx -n 100

Follow logs

journalctl -u nginx -f

Since one hour ago

journalctl -u nginx --since "1 hour ago"

Boot logs

journalctl -b -u nginx

Reload units and configs

Reload systemd manager config

systemctl daemon-reload

Show unit file

systemctl cat nginx

Edit override

systemctl edit nginx

Troubleshooting services

ProblemCommands
Service will not startsystemctl status service
journalctl -u service -n 100
Unit changed but not appliedsystemctl daemon-reload
Service failed at bootsystemctl --failed
journalctl -b -p err
Service workflows

systemctl troubleshooting flow

# Check service state
systemctl status nginx

# Read recent logs
journalctl -u nginx -n 80 --no-pager

# Restart safely
systemctl restart nginx

# Enable at boot
systemctl enable nginx

# Reload unit files after editing
systemctl daemon-reload
FAQ

Frequently Asked Questions

What is systemctl used for?

systemctl controls and inspects systemd services, timers and units.

What is the difference between start and enable?

start runs a service now, while enable starts it automatically at boot.

How do I read service logs?

Use journalctl -u service-name.

When should I run daemon-reload?

Run it after editing or creating systemd unit files.