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

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

Stops the active unit.

Restart a service

Restart a running service.

bashANYsystemctlrestartservice
bash
sudo systemctl restart nginx

Useful after config or code changes.

Reload a service

Reload config without full restart if supported.

bashANYsystemctlreloadservice
bash
sudo systemctl reload nginx

Only works for services that implement reload.

Try reload or restart

Reload when possible, restart otherwise.

bashANYsystemctlreloadrestart
bash
sudo systemctl reload-or-restart nginx

Safe operational convenience command.

Show service status

Inspect loaded, active, and failed state.

bashANYsystemctlstatusservice
bash
systemctl status nginx

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

Useful in scripts and health checks.

Check if service is failed

Return failure state for a unit.

bashANYsystemctlfailedscript
bash
systemctl is-failed nginx

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

Creates the appropriate symlinks so the service starts at boot.

Disable on boot

Disable autostart for a service.

bashANYsystemctldisableboot
bash
sudo systemctl disable nginx

Prevents the service from starting automatically.

Enable and start

Enable service at boot and start it now.

bashANYsystemctlenablestart
bash
sudo systemctl enable --now nginx

Common operational shortcut.

Disable and stop

Disable service at boot and stop it now.

bashANYsystemctldisablestop
bash
sudo systemctl disable --now nginx

Useful during maintenance or decommissioning.

Mask a service

Prevent a unit from being started.

bashANYsystemctlmasksafety
bash
sudo systemctl mask nginx

Strongest disable. Even manual starts are blocked.

Unmask a service

Remove masking from a unit.

bashANYsystemctlunmaskservice
bash
sudo systemctl unmask nginx

Required before the service can start again.

Check if enabled

Show whether the service starts at boot.

bashANYsystemctlenabledboot
bash
systemctl is-enabled nginx

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

General entry point for discovering what's running.

List service units

Filter unit list to services.

bashANYsystemctlserviceslist
bash
systemctl list-units --type=service

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

Displays enablement states for installed service definitions.

List failed units

Show units in failed state.

bashANYsystemctlfailedtroubleshooting
bash
systemctl --failed

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

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

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

Shows vendor unit plus override snippets.

Show documentation paths

Print the unit's help and docs references.

bashANYsystemctlstatusdocs
bash
systemctl status sshd

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

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

Good for impact analysis.

Show default target

Display the default boot target.

bashANYsystemctltargetboot
bash
systemctl get-default

Often graphical.target or multi-user.target.

Set default target

Change the default boot target.

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

Persists the default startup target.

Switch to a target now

Immediately isolate a target.

bashANYsystemctlisolatetarget
bash
sudo systemctl isolate rescue.target

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

Run this after editing or creating unit files.

Reexecute systemd

Ask PID 1 to reexec itself.

bashANYsystemctldaemon-reexecadvanced
bash
sudo systemctl daemon-reexec

Advanced maintenance action; not needed for normal unit edits.

Reset failed state

Clear failed markers for units.

bashANYsystemctlreset-failedmaintenance
bash
sudo systemctl reset-failed

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

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

Preferred systemd-based reboot command.

Power off system

Shut down and power off.

bashANYsystemctlpoweroffsystem
bash
sudo systemctl poweroff

Stops services cleanly before poweroff.

Halt system

Stop the CPU without powering off on some platforms.

bashANYsystemctlhaltsystem
bash
sudo systemctl halt

Less common than poweroff or reboot.

Enter rescue mode

Switch to rescue target.

bashANYsystemctlrescuetarget
bash
sudo systemctl rescue

Useful for maintenance with minimal services.

Enter emergency mode

Switch to emergency shell target.

bashANYsystemctlemergencyrecovery
bash
sudo systemctl emergency

Most minimal recovery environment.

More in Linux systemd Services

No other published sheets yet.

Recommended next

No recommendations yet.