Linux systemd Services Cheat Sheet

Core systemctl commands, unit inspection, service lifecycle management, dependencies, and operational workflows.

View
StandardDetailedCompact
Export
Copy the compact sheet, download it, or print it.
Download
`D` dense toggle · `C` copy all

Service Lifecycle

Start, stop, restart, reload, and inspect services.

Start a service

Start a unit immediately.

bashANYsystemctlstartservice
bash
sudo systemctl start nginx
Notes

Starts the service right away but does not enable it on boot.

Stop a service

Stop a running service.

bashANYsystemctlstopservice
bash
sudo systemctl stop nginx
Notes

Stops the active unit.

Restart a service

Restart a running service.

bashANYsystemctlrestartservice
bash
sudo systemctl restart nginx
Notes

Useful after config or code changes.

Reload a service

Reload config without full restart if supported.

bashANYsystemctlreloadservice
bash
sudo systemctl reload nginx
Notes

Only works for services that implement reload.

Try reload or restart

Reload when possible, restart otherwise.

bashANYsystemctlreloadrestart
bash
sudo systemctl reload-or-restart nginx
Notes

Safe operational convenience command.

Show service status

Inspect loaded, active, and failed state.

bashANYsystemctlstatusservice
bash
systemctl status nginx
Notes

Displays high-level service health and recent logs.

Check if service is active

Return a simple active state.

bashANYsystemctlis-activescript
bash
systemctl is-active nginx
Notes

Useful in scripts and health checks.

Check if service is failed

Return failure state for a unit.

bashANYsystemctlfailedscript
bash
systemctl is-failed nginx
Notes

Good for automation and troubleshooting.

Enable, Disable, Mask

Control startup behavior and boot-time activation.

Enable on boot

Enable a unit to start automatically.

bashANYsystemctlenableboot
bash
sudo systemctl enable nginx
Notes

Creates the appropriate symlinks so the service starts at boot.

Disable on boot

Disable autostart for a service.

bashANYsystemctldisableboot
bash
sudo systemctl disable nginx
Notes

Prevents the service from starting automatically.

Enable and start

Enable service at boot and start it now.

bashANYsystemctlenablestart
bash
sudo systemctl enable --now nginx
Notes

Common operational shortcut.

Disable and stop

Disable service at boot and stop it now.

bashANYsystemctldisablestop
bash
sudo systemctl disable --now nginx
Notes

Useful during maintenance or decommissioning.

Mask a service

Prevent a unit from being started.

bashANYsystemctlmasksafety
bash
sudo systemctl mask nginx
Notes

Strongest disable. Even manual starts are blocked.

Unmask a service

Remove masking from a unit.

bashANYsystemctlunmaskservice
bash
sudo systemctl unmask nginx
Notes

Required before the service can start again.

Check if enabled

Show whether the service starts at boot.

bashANYsystemctlenabledboot
bash
systemctl is-enabled nginx
Notes

Returns enabled, disabled, masked, or other states.

List and Inspect Units

Discover loaded units, failed units, and service metadata.

List loaded units

Show active loaded units.

bashANYsystemctllist-unitsdiscover
bash
systemctl list-units
Notes

General entry point for discovering what's running.

List service units

Filter unit list to services.

bashANYsystemctlserviceslist
bash
systemctl list-units --type=service
Notes

Useful for service inventory and troubleshooting.

List all service unit files

Show loaded and unloaded service files.

bashANYsystemctlunit-filesservice
bash
systemctl list-unit-files --type=service
Notes

Displays enablement states for installed service definitions.

List failed units

Show units in failed state.

bashANYsystemctlfailedtroubleshooting
bash
systemctl --failed
Notes

One of the fastest ways to spot broken units.

Show low-level unit properties

Dump detailed properties for a unit.

bashANYsystemctlshowproperties
bash
systemctl show nginx
Notes

Machine-friendly property view for scripts or deep inspection.

Show one property

Read a specific unit property.

bashANYsystemctlshowActiveState
bash
systemctl show nginx -p ActiveState -p SubState
Notes

Helpful in shell scripts and monitoring checks.

Print unit file and drop-ins

Show the unit definition actually used by systemd.

bashANYsystemctlcatdrop-ins
bash
systemctl cat nginx
Notes

Shows vendor unit plus override snippets.

Show documentation paths

Print the unit's help and docs references.

bashANYsystemctlstatusdocs
bash
systemctl status sshd
Notes

The status output often includes docs references and last log messages.

Dependencies and Targets

Understand ordering, wants, requires, and targets.

List dependencies

Show dependency tree for a unit.

bashANYsystemctldependenciesgraph
bash
systemctl list-dependencies nginx
Notes

Useful to understand related services and startup order.

List reverse dependencies

Show units depending on a unit.

bashANYsystemctlreversedependencies
bash
systemctl list-dependencies --reverse network-online.target
Notes

Good for impact analysis.

Show default target

Display the default boot target.

bashANYsystemctltargetboot
bash
systemctl get-default
Notes

Often graphical.target or multi-user.target.

Set default target

Change the default boot target.

bashANYsystemctltargetboot
bash
sudo systemctl set-default multi-user.target
Notes

Persists the default startup target.

Switch to a target now

Immediately isolate a target.

bashANYsystemctlisolatetarget
bash
sudo systemctl isolate rescue.target
Notes

Can stop unrelated units to reach the target state.

Daemon Operations

Reload manager state and reset failures.

Reload systemd manager config

Reload unit files after changes.

bashANYsystemctldaemon-reloadunit-files
bash
sudo systemctl daemon-reload
Notes

Run this after editing or creating unit files.

Reexecute systemd

Ask PID 1 to reexec itself.

bashANYsystemctldaemon-reexecadvanced
bash
sudo systemctl daemon-reexec
Notes

Advanced maintenance action; not needed for normal unit edits.

Reset failed state

Clear failed markers for units.

bashANYsystemctlreset-failedmaintenance
bash
sudo systemctl reset-failed
Notes

Useful after fixing a broken service.

Reload systemd and a service

Common flow after unit edits.

bashANYsystemctldaemon-reloadrestart
bash
sudo systemctl daemon-reload && sudo systemctl restart myapp
Notes

Typical operator sequence after editing a custom unit.

Shutdown and Reboot

Reboot, halt, poweroff, rescue, and emergency mode.

Reboot system

Reboot through systemd.

bashANYsystemctlrebootsystem
bash
sudo systemctl reboot
Notes

Preferred systemd-based reboot command.

Power off system

Shut down and power off.

bashANYsystemctlpoweroffsystem
bash
sudo systemctl poweroff
Notes

Stops services cleanly before poweroff.

Halt system

Stop the CPU without powering off on some platforms.

bashANYsystemctlhaltsystem
bash
sudo systemctl halt
Notes

Less common than poweroff or reboot.

Enter rescue mode

Switch to rescue target.

bashANYsystemctlrescuetarget
bash
sudo systemctl rescue
Notes

Useful for maintenance with minimal services.

Enter emergency mode

Switch to emergency shell target.

bashANYsystemctlemergencyrecovery
bash
sudo systemctl emergency
Notes

Most minimal recovery environment.

More in Linux systemd Services

No other published sheets yet.

Recommended next

No recommendations yet.