If you’ve ever installed software on Linux or followed a tutorial to set up a VPS, you’ve likely seen commands like sudo systemctl start nginx or sudo systemctl enable ollama.
But what exactly is happening when you run those commands? In 2026, systemd is the standard “Init System” for almost every major Linux distribution, including Ubuntu, Fedora, and Debian. Understanding how it works is the key to mastering your Linux machine.
In this guide, we’ll explain systemd in plain English and show you how to manage your system like a pro.
What Is systemd?
Think of systemd as the Manager-in-Chief of your Linux system.
As we discussed in our guide on the Linux Boot Process, systemd is the very first process that starts after the kernel. Its job is to start and manage all the other “background” processes (called services) that make your computer work—like your Wi-Fi, your Bluetooth, your web server, and your firewall.
Managing Services with systemctl
The primary tool for interacting with systemd is the systemctl command. Here are the five most important commands every beginner should know:
- Start a service:
sudo systemctl start [service_name](e.g., Turn on your web server right now.) - Stop a service:
sudo systemctl stop [service_name](e.g., Turn off your web server.) - Enable a service:
sudo systemctl enable [service_name](e.g., Make sure your web server starts automatically every time you boot your computer.) - Disable a service:
sudo systemctl disable [service_name](e.g., Stop the service from starting at boot.) - Check Status:
systemctl status [service_name](e.g., Is my service running? If it crashed, why?)
What Are “Units” and “Targets”?
Systemd doesn’t just manage services; it manages Units. A service is just one type of Unit.
- Services (
.service): These are the background apps (like Nginx or Ollama). - Timers (
.timer): These are like “scheduled tasks” or Cron jobs. They tell a service to run at a specific time. - Mounts (
.mount): These manage your hard drives and network shares.
Systemd also uses Targets (.target) to group units together. For example, graphical.target is the group of services needed to show your desktop, while multi-user.target is the group needed for a standard server command line.
Creating Your Own Service (The 2-Minute Guide)
One of the coolest things about systemd is how easy it is to make your own service. Imagine you have a script called my_script.sh that you want to run automatically in the background.
- Create a file at
/etc/systemd/system/myscript.service:[Unit] Description=My Custom Script [Service] ExecStart=/usr/local/bin/my_script.sh Restart=always [Install] WantedBy=multi-user.target - Tell systemd to find the new file:
sudo systemctl daemon-reload - Start it:
sudo systemctl start myscript - Enable it:
sudo systemctl enable myscript
Congratulations! You’ve just created a persistent background service.
Troubleshooting with journalctl
If a service fails to start, systemctl status will give you a summary, but journalctl gives you the full story. systemd records all service logs in a central “journal.”
- View logs for a specific service:
sudo journalctl -u [service_name] - View logs in real-time (as they happen):
sudo journalctl -f - See logs from today only:
sudo journalctl --since today
Summary Table
| Action | Command |
|---|---|
| Start immediately | systemctl start |
| Stop immediately | systemctl stop |
| Start on boot | systemctl enable |
| Stop starting on boot | systemctl disable |
| Check if it’s running | systemctl status |
| Reload configuration | systemctl daemon-reload |
Conclusion
Systemd might seem intimidating at first, but it provides a unified, powerful way to manage everything on your Linux system. Once you master systemctl and journalctl, you’ll have more control over your VPS or desktop than ever before.
Ready to put this into practice? Check out our Ollama installation guide to see how we use a systemd service to run a local AI assistant!
Discussion
Loading comments...