Home·Terminal commands

systemctl

Processes and system

Usage

systemctl <verb> <unit>

Starts, stops and inspects systemd services; `enable` only sets boot behaviour, so use `enable --now` to also start it, and run `daemon-reload` after editing a unit file.

Common flags

FlagMeaning
status <unit>Whether it is running, its PID, and the last log lines.
start / stop / restartAct on the service now, without changing boot behaviour.
reloadRe-read the config without dropping connections, if the service supports it.
enable --now <unit>Start it now and also start it at every boot.
daemon-reloadRequired after you edit a .service file, before restarting it.
list-units --failedEverything that failed to start.
--userAct on your own user units instead of the system ones.

Examples

sudo systemctl restart nginx

Restart the web server.

systemctl status sshd --no-pager

Print the state and recent log lines without opening a pager.

sudo systemctl enable --now docker

Start Docker and make it come back after a reboot.

What is running and what is eating the machine. Identifying it comes before killing it.

How to read this

  • Square brackets [ ] mark a part you may leave out.
  • An ellipsis … means you can list more than one.
  • Flags are case-sensitive — in some commands -r and -R do different things.

Questions

Q. What does systemctl do?

Starts, stops and inspects systemd services; `enable` only sets boot behaviour, so use `enable --now` to also start it, and run `daemon-reload` after editing a unit file.

Q. How do I type it?

systemctl <verb> <unit> — square brackets mark the parts you can leave out.

Q. How many flags are worth knowing?

7 are listed here; the full set is in man systemctl. This command sits under Processes and system.

Related commands

man page: man systemctl