Find the service you want to manage
Ubuntu 24.04 LTS and AlmaLinux 9 use systemd to manage background services. A service is represented by a unit such as nginx.service. You need sudo access to change its state. Reading status is usually available without it.
Start by finding the exact unit name. A package must be installed before its service exists. Nginx is used below as an example; substitute your installed application's unit. OpenSSH is commonly ssh.service on Ubuntu and sshd.service on AlmaLinux.
systemctl list-unit-files --type=service
systemctl list-units --type=service --allRead status before making changes
The Loaded line reports whether systemd found the unit. Active describes its current state. Recent log lines can explain why a start failed. Use --no-pager for output that stays in the terminal, or press q to leave the default pager.
Active and enabled answer different questions. A service can be running now but disabled for the next boot. Conversely, a service can be enabled yet currently stopped or failed. Some short-lived units finish successfully and are then inactive.
systemctl status nginx.service --no-pager
systemctl is-active nginx.service
systemctl is-enabled nginx.serviceStart now and enable for boot
Start changes the current running state. Enable arranges normal startup at boot but does not by itself start the service immediately. The --now option performs both operations. Use it only when the service is configured and ready to run.
After enabling a network application, also check its listening address and firewall access. Systemd starting a process does not guarantee that the application responds correctly to clients.
sudo systemctl start nginx.servicesudo systemctl enable --now nginx.servicesystemctl is-active nginx.service
systemctl is-enabled nginx.serviceChoose reload or restart deliberately
Reload asks an application that supports it to reread configuration. Restart stops and starts the process and may interrupt requests. Validate the application's configuration first; Nginx provides nginx -t. A reload can fail if the unit or application does not support it.
Daemon-reload is different: it makes systemd reread unit definitions after a unit file change. It does not replace an application's configuration reload or restart. Avoid experimenting with your SSH service when it is your only way to reach the server.
sudo nginx -t
sudo systemctl reload nginx.servicesudo systemctl daemon-reloadactive
enabled
active
enabled
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
inactiveInvestigate failures and confirm recovery
Inspect the journal before repeatedly restarting a failed service. Look for the earliest relevant error, such as an invalid configuration or occupied port. Fix that cause, retry once, then check status and an actual application request.
To retire a service, disable --now removes normal boot enablement and stops it now. Other units or sockets can still activate it; check dependencies before assuming it is permanently unavailable.
sudo journalctl -u nginx.service -b -n 50 --no-pagersudo systemctl disable --now nginx.serviceOfficial documentation
These upstream references provide more detail on the commands and workflows in this guide.