$linuxjunkies
>

systemctl(1)

Control the systemd system and service manager.

UbuntuDebianFedoraArch

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

FlagWhat it does
startStart one or more units
stopStop one or more units
restartStop and then start one or more units
reloadAsk units to reload their configuration without full restart
statusShow runtime status and recent log entries for a unit
enableEnable unit(s) to start automatically at boot
disableDisable unit(s) from starting automatically at boot
is-activeCheck if a unit is currently active (running)
is-enabledCheck if a unit is enabled for auto-start at boot
-u, --userManage user services instead of system services
--no-pagerDo not pipe output to a pager
--nowStart/stop the unit in addition to enabling/disabling

Examples

Start the nginx service immediately

systemctl start nginx

Stop the nginx service

systemctl stop nginx

Stop and then start nginx, loading any configuration changes

systemctl restart nginx

Enable nginx to auto-start when the system boots

systemctl enable nginx

Enable nginx for auto-start AND start it immediately

systemctl enable --now nginx

Show current status, recent logs, and enabled/disabled state of nginx

systemctl status nginx

List all loaded service units on the system

systemctl list-units --type=service

Check if nginx is running (exits with status code 0 if active)

systemctl is-active nginx

Related commands