Thuta Learning
AdvancedDevOps & Toolsbeginner

systemd & Services (systemctl)

Relax. We'll talk through this in plain words — no textbook voice.

What you'll walk away with

  • Understand systemd & Services (systemctl) without any of the intimidation
  • Get hands-on practice trying out the commands yourself in the terminal
  • See how these commands actually come in handy on a real server or project

Let's think about it this way for a second

systemd is the 'init system' running by default on most modern Linux distros (Ubuntu, Debian, Fedora) — it's the first thing to run when the computer boots up, and it acts like an orchestra conductor, booting, monitoring, and restarting every service (background program). You control a service with the systemctl command — systemctl start <service> (start), systemctl stop <service> (stop), systemctl restart <service> (restart), systemctl status <service> (check status). systemctl enable <service> means 'auto-start on every boot' — enabling it doesn't start it immediately, you still need to run start separately.

Let's connect this to a real-world scenario

After installing the Nginx web server, you'd start it with sudo systemctl start nginx and set it to auto-start on every server restart with sudo systemctl enable nginx — keeping these two separate helps you avoid the common beginner mistake of 'the website disappeared after the server restarted.' sudo systemctl status nginx immediately shows whether the service is running and what error logs, if any, exist — it's the first command you should run when troubleshooting.

Let's try it together in the terminal

bash
sudo systemctl start nginx
sudo systemctl enable nginx
sudo systemctl status nginx
sudo systemctl restart nginx
sudo systemctl stop nginx
You should see
Running systemctl status nginx shows the words 'active (running)' highlighted in green.

5-minute try-it

Run systemctl status ssh (or systemctl status cron) if it's installed on your system. Note whether it shows active or inactive.

A quick word of caution

Running systemctl stop on a critical production service (database, web server) can instantly cut off user access to your website — double-check exactly which service you're targeting before you run it.

Easy traps

  • Thinking that running enable starts the service immediately — enable only sets up auto-start; you still need to run start separately
  • Not actually reading the output of systemctl status, just scanning for the word 'active' and ignoring the error logs

Now try it yourself

Run systemctl status ssh (or systemctl status cron) if it's installed on your system. Note whether it shows active or inactive.

You'll know it worked when: Running systemctl status nginx shows the words 'active (running)' highlighted in green.

systemd & Services (systemctl) | Thuta Learning