If youβre managing Linux servers, systemd is at the core of everything β services, boot, logs, scheduling.
Most people only know:
systemctl start nginx
systemctl start nginx
π Check Service Status
systemctl status nginx
Shows:
- Logs
- PID
- Memory usage
- Errors
βΆοΈ Start / Stop / Restart
systemctl start nginx
systemctl stop nginx
systemctl restart nginx
systemctl reload nginx
π Enable Service at Boot
systemctl enable nginx
Disable:
systemctl disable nginx
π§© Create Your Own Service
sudo nano /etc/systemd/system/myapp.service
[Unit]
Description=My App
After=network.target
[Service]
ExecStart=/usr/bin/node /root/app.js
Restart=always
User=root
[Install]
WantedBy=multi-user.target
Reload:
systemctl daemon-reexec
systemctl daemon-reload
systemctl enable myapp
systemctl start myapp
π Logs with journalctl
journalctl -u nginx
journalctl -f
journalctl --since "1 hour ago"
π₯ Pro Tips
- Use
Restart=alwaysfor critical apps - Combine with Docker or Node apps
- Debug boot issues with:
systemd-analyze blame
π§ Summary
Systemd is not just a service manager β itβs the backbone of Linux systems.