Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

How to View and Manage systemd Services in Linux

List, start, stop, enable and troubleshoot services with systemctl and journalctl.

How-To Guides2 min read13 screenshots

What is systemd

systemd is the system and service manager of most Linux distributions (Ubuntu, Debian, CentOS, AlmaLinux and more). It starts the services at boot and keeps them running. You control it with systemctl, and you read its logs with journalctl.

View the services

All active services

systemctl list-units --type=service
Listing the active services

All services, including inactive ones

systemctl list-unit-files --type=service
Listing all the service files

Check the status of a service

systemctl status service-name

Example:

systemctl status apache2.service
The status of the Apache service

The output shows if it is active (running), since when, the main process and the last log lines.

Start and stop a service

Start:

sudo systemctl start service-name

Example:

sudo systemctl start apache2
Starting a service

Stop:

sudo systemctl stop apache2
Stopping a service

Restart and reload

Restart stops and starts the service:

sudo systemctl restart apache2
Restarting a service

Reload applies the new configuration without stopping the service (if the service supports it):

sudo systemctl reload apache2
Reloading a service

Start a service at boot

Enable:

sudo systemctl enable nginx
Enabling a service at boot

Disable:

sudo systemctl disable nginx
Disabling a service at boot

Enable and start in one command:

sudo systemctl enable --now nginx

Check it:

systemctl is-enabled nginx
systemctl is-active nginx

Find failed services

systemctl --failed
Checking the failed services

Read the logs

Logs of one service:

journalctl -u service-name

Example:

journalctl -u apache2
The logs of a service

The last 20 lines:

journalctl -u service-name -n 20
The most recent log lines

Follow the log live:

journalctl -u service-name -f

Reload the systemd configuration

After you create or change a unit file in /etc/systemd/system/, run:

sudo systemctl daemon-reload
Reloading the systemd configuration

FAQ

What is systemctl? The command to control systemd.

How do I see running services? systemctl list-units --type=service --state=running.

How do I start a service at boot? sudo systemctl enable service-name.

How do I troubleshoot a failed service? Check systemctl status service-name and journalctl -u service-name -xe.

Quick recap

  • systemctl start|stop|restart|enable|status and journalctl -u.