System and processes
The systemctl command
Controls systemd services: starting, stopping, restarting, enabling them at boot and checking their status. It is the central administration tool on almost every current Linux distribution.
Most useful options
status <servicio>Shows whether it is active, its PID, how long it has been running and the last lines of its log.restart <servicio>Stops the service and starts it again. Use it after changing its configuration.enable --now <servicio>Starts it at every boot and also right now.disable <servicio>Removes automatic start at boot. It does not stop the service if it is already running.daemon-reloadRereads the unit files after you edit them.--userManages the current user's services, without sudo.--failedLists the units that have failed.Copy-ready examples
$ systemctl status nginxDetailed service status, with its latest log lines.Example output
● nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; preset: enabled)
Active: active (running) since Mon 2026-11-02 08:14:03 CET; 1 day 2h ago
Main PID: 912 (nginx)$ sudo systemctl enable --now nginxStarts it now and keeps it active after every reboot.$ sudo systemctl restart nginxStops and starts the service again. It drops the active connections.$ systemctl --failedChecks whether anything failed at boot or later.Example output
0 loaded units listed.
You can try them in the browser terminal: it does not touch your computer.
Common errors
| Message | Cause | Fix |
|---|---|---|
| Failed to start nginx.service: Unit nginx.service not found. | The unit is not installed or the name is wrong; without the package there is no service file. | Search the name with systemctl list-unit-files and, after creating your own unit, run daemon-reload. |
| Failed to start nginx.service: Interactive authentication required. | sudo is missing: without administrator rights, polkit asks for authentication and there is no way to answer. | Run the command again with sudo in front. |
| System has not been booted with systemd as init system (PID 1). Can't operate. | PID 1 is not systemd: this happens in Docker containers and in WSL without systemd enabled. | Use service, or enable systemd in WSL (systemd=true in /etc/wsl.conf). |
Typical mistakes
- After editing a unit file, run daemon-reload or systemd keeps the old version.
Differences from similar commands
- service: Manages services in a generic way on systems with or without systemd. On systemd systems it is translated to systemctl.
- journalctl: Reads the service logs. systemctl starts and stops them; journalctl tells you what happened.
Security
Stopping sshd or the network from an SSH session can lock you out: confirm you have another way in first. A unit file runs as root, so do not leave it writable by other users.
Related commands
FAQ
Why does systemctl status say 'inactive (dead)'?
The service is not running. Check whether it starts alone with is-enabled and why it stopped with journalctl -u.
What is the difference between enable and start?
start runs it now; enable runs it at every boot. With enable --now you do both.
What if I never want a service to start?
Use systemctl mask: it links the unit to /dev/null, so neither start nor enable can run it. unmask reverts it.
Learn to actually use it
The basic Linux course takes you from zero to console fluency with 24 self-grading lessons.
Start the free course