systemctl(1)
Control the systemd system and service manager.
Synopsis
systemctl [OPTIONS...] COMMAND [UNIT]...Description
systemctl is the main command for interacting with systemd, the system and service manager on modern Linux systems. It allows you to start, stop, restart, enable, disable, and check the status of services and other systemd units.
Units can be services (.service), sockets (.socket), devices (.device), mounts (.mount), automounts (.automount), swap files (.swap), targets (.target), paths (.path), timers (.timer), and slices (.slice). When no unit name is specified, systemctl operates on services by default.
Common options
| Flag | What it does |
|---|---|
start | Start one or more units |
stop | Stop one or more units |
restart | Stop and then start one or more units |
reload | Ask units to reload their configuration without full restart |
status | Show runtime status and recent log entries for a unit |
enable | Enable unit(s) to start automatically at boot |
disable | Disable unit(s) from starting automatically at boot |
is-active | Check if a unit is currently active (running) |
is-enabled | Check if a unit is enabled for auto-start at boot |
-u, --user | Manage user services instead of system services |
--no-pager | Do not pipe output to a pager |
--now | Start/stop the unit in addition to enabling/disabling |
Examples
Start the nginx service immediately
systemctl start nginxStop the nginx service
systemctl stop nginxStop and then start nginx, loading any configuration changes
systemctl restart nginxEnable nginx to auto-start when the system boots
systemctl enable nginxEnable nginx for auto-start AND start it immediately
systemctl enable --now nginxShow current status, recent logs, and enabled/disabled state of nginx
systemctl status nginxList all loaded service units on the system
systemctl list-units --type=serviceCheck if nginx is running (exits with status code 0 if active)
systemctl is-active nginx