systemctl system

start it. stop it. restart it. stop clicking control panels.

The systemctl man page is 1,500 lines long. You need about eight commands and you can manage every service on a modern Linux system.

Your web server went down. Or your database stopped. Or a background service crashed at 3 AM. So you SSHd into the server and asked yourself the same question everyone asks: “How do I restart this thing?”

If you came from Windows, you opened Services (services.msc), scrolled through 200 services with names like “Connected Devices Platform User Service_5e3a2” until you found the one you wanted, right-clicked it, and clicked “Restart.” Or you used a hosting control panel — cPanel, Plesk, Webmin — clicked through three menus to find the “Restart Apache” button, then waited for the page to reload to confirm it worked.

systemctl does all of that in one command. Start, stop, restart, check status, enable at boot, view logs. No scrolling. No control panels. No page reloads.

Unless you’re running Windows then wtf none of this applies to you. But hey, come to the dark side, go install WSL2 and you can follow along. We’ll wait. Impatiently.

If you’re lazy like me (all sysadmins are!) then click here for the systemctl cheat sheet.


Check if a service is running

systemctl status nginx
● nginx.service - A high performance web server
     Loaded: loaded (/lib/systemd/system/nginx.service; enabled)
     Active: active (running) since Sat 2026-03-15 10:22:33 UTC; 5h ago
   Main PID: 1842 (nginx)
      Tasks: 5 (limit: 4915)
     Memory: 12.4M
        CPU: 1.432s

One command. Is it running? When did it start? How much memory is it using? What’s the PID? Is it enabled at boot? Everything you need, right there.

If the service has crashed, status shows the last few log lines so you can see why it failed — without opening a separate log file.


Start, stop, restart

Start a service

sudo systemctl start nginx

It starts. No output means success. No “Starting… please wait… OK” animation. Just done.

Stop a service

sudo systemctl stop nginx

Stopped. Immediately.

Restart a service

sudo systemctl restart nginx

Stop and start. For when you’ve changed a config file and need the service to pick up the changes. Brief downtime while it restarts.

Reload (no downtime)

sudo systemctl reload nginx

Tells the service to re-read its config without stopping. Not all services support this — nginx does, Apache does, many others don’t. If reload fails, fall back to restart.


Enable / disable at boot

Enable (start automatically on boot)

sudo systemctl enable nginx

Now nginx starts every time the system boots. You don’t have to remember to start it manually after a reboot.

Enable AND start right now

sudo systemctl enable --now nginx

Enables at boot and starts immediately. One command instead of two.

Disable (don’t start at boot)

sudo systemctl disable nginx

Removes the auto-start. The service still runs if it’s currently running — this only affects future boots.

Check if enabled

systemctl is-enabled nginx

Returns enabled or disabled. For scripting and quick checks.


List services

All running services

systemctl list-units --type=service --state=running

Every service that’s currently active. Cleaner than ps aux for service-oriented debugging.

All services (including stopped)

systemctl list-units --type=service --all

Everything systemd knows about — running, stopped, failed. The “failed” ones are usually what you’re looking for.

Failed services

systemctl --failed

Just the broken ones. If something isn’t working, start here.


View logs (journalctl)

systemd captures all service output in the journal. No more hunting through random log files.

Logs for a specific service

journalctl -u nginx

Every log line nginx has ever produced (that the journal hasn’t rotated out).

Recent logs

journalctl -u nginx --since "1 hour ago"

Last hour of nginx logs. Also accepts "today", "yesterday", and specific timestamps like "2026-03-15 10:00:00".

Follow logs in real-time

journalctl -u nginx -f

Like tail -f but for systemd journal entries. Logs stream as they happen. Ctrl+c to stop.

Last 50 lines

journalctl -u nginx -n 50

The most recent 50 log entries. Quick check without scrolling through history.


Debug a failed service

systemctl status myapp

If it shows Active: failed, look at the log lines below the status. Need more detail:

journalctl -u myapp -n 100 --no-pager

Last 100 log lines, no paging (prints straight to terminal). The error is usually near the end.

Common failure reasons

  • Exit code 1 — the application crashed. Check app logs.
  • Exit code 203 — the ExecStart binary wasn’t found. Check the path in the service file.
  • Exit code 217 — user doesn’t exist. The User= in the service file references a non-existent account.
  • Permission denied — the service user can’t access a file or port. Check chmod and ownership.

Create a simple service

Create /etc/systemd/system/myapp.service:

[Unit]
Description=My Application
After=network.target

[Service]
Type=simple
User=owner
WorkingDirectory=/home/owner/myapp
ExecStart=/home/owner/myapp/run.sh
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target

Then:

sudo systemctl daemon-reload
sudo systemctl enable --now myapp

daemon-reload tells systemd to re-read service files. Your app now starts at boot, restarts on failure (after 5 seconds), and is manageable with systemctl like any other service.


The flags that actually matter

Command What it does
systemctl status SERVICE Status, PID, memory, recent logs.
systemctl start SERVICE Start a service.
systemctl stop SERVICE Stop a service.
systemctl restart SERVICE Restart (stop + start).
systemctl reload SERVICE Reload config without restart.
systemctl enable SERVICE Start at boot.
systemctl enable --now SERVICE Start at boot and start now.
systemctl disable SERVICE Don’t start at boot.
systemctl is-enabled SERVICE Check if enabled at boot.
systemctl --failed List failed services.
systemctl daemon-reload Re-read service files after changes.
journalctl -u SERVICE -f Follow service logs in real-time.

“But my control panel—”

Close the browser.

“cPanel has a ‘Restart Apache’ button.” cPanel runs systemctl restart apache2 when you click that button. You just added a web interface, a login page, a PHP session, and 200MB of overhead to run a single command. The button is the command with extra steps.

“Webmin shows me all services in a dashboard.” Webmin is a web-based administration tool that shows you a list of services with start/stop buttons. It’s systemctl list-units --type=service rendered in HTML with a 150MB footprint. On a server. Where you don’t need a web interface.

“Windows Services has a GUI.” Windows Services (services.msc) shows you a list with display names like “Background Intelligent Transfer Service” and startup types that you change in a dropdown menu. It’s the same information as systemctl status but requires a desktop session, a GUI, and multiple clicks per service.

“I just reboot when something stops working.” Rebooting restarts everything — including the things that were working fine. It also causes downtime for all services, not just the broken one. systemctl restart broken-service fixes the one thing that’s broken and leaves everything else alone.


systemctl cheat sheet

You made it. Or you skipped straight here. Either way, no judgment. Copy and paste these. Pin them. Tattoo them on your forearm. Whatever works.

What you’re doing Command
Check status systemctl status nginx
Start sudo systemctl start nginx
Stop sudo systemctl stop nginx
Restart sudo systemctl restart nginx
Reload config (no downtime) sudo systemctl reload nginx
Enable at boot sudo systemctl enable nginx
Enable + start now sudo systemctl enable --now nginx
List failed services systemctl --failed
View logs journalctl -u nginx -n 50
Follow logs live journalctl -u nginx -f
Logs since time journalctl -u nginx --since "1 hour ago"
Re-read service files sudo systemctl daemon-reload

The workflow: systemctl status to see what’s wrong → journalctl -u service -n 50 to see why → systemctl restart to fix it → systemctl enable so it survives reboot. That’s it.

Back to the top, you overachiever.