As with all other operating systems, Linux has services and other processes that run in the background to perform certain important functions while the system is running. When the system is booted, the services start automatically and continue to run in the background until the system is shut down. However, you can also start, stop and restart the services manually.

In this article, I’ll show you different methods for starting, stopping, and restarting services in Ubuntu. The article covers systemd, the service command, and init scripts. These commands work on all current versions of Ubuntu, including the new Ubuntu 22.04.

List all services in Ubuntu

Before we start, I will show you how to get a list of all the services on your computer as we need to know the service name to manage the service.

service --status-all

It will show a complete list of services on Ubuntu.

How to Start, Stop or Restart Services in Ubuntu linux shell ubuntu

Use Systemd to Start/Stop/Restart Services in Ubuntu

You can start, stop or restart services using Systemd systemctl utility. This is the preferred way on current Ubuntu versions like Ubuntu 18.04, Ubuntu 20.04, and Ubuntu 22.04.

Open up a terminal window, and enter the following commands. For instance, in this case, I want to start, stop or restart the UFW Firewall service in Ubuntu.

The Syntax is:

sudo systemctl [action] [service name]

To start a service:

sudo systemctl stop ufw

To stop a service:

sudo systemctl start ufw

To restart a service:

sudo systemctl restart ufw

To check the status of service:Advertisement

sudo systemctl status ufw

<img alt="Manage services with systemd" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/04/echo/word-image-126-1024×480.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="352" loading="lazy" src="data:image/svg xml,” width=”750″>

Start/Stop/Restart Services with service command on Ubuntu

You can start, stop, or restart services using the service command too. Open up a terminal window, and enter the following commands.

To start a service:

sudo service ufw stop

To stop a service:

sudo service ufw start

To stop a service:

sudo service ufw restart

To check the status of a service:

sudo service ufw status

<img alt="Manage services with the service command on Ubuntu" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/04/echo/word-image-127-1024×575.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="421" loading="lazy" src="data:image/svg xml,” width=”750″>

Using Init scripts to manage services on Ubuntu

You can start, stop or restart services using init scripts in the /etc/init.d directory. This directory actually consists of various scripts for different services. Init scripts are deprecated since Ubuntu switched to Systemd, so this method will be used only if you have to deal with an old Ubuntu version. Open up a terminal window, and enter the following commands.

To start a service:

/etc/init.d/ufw start

To stop a service:

/etc/init.d/ufw stop

To stop a service:

/etc/init.d/ufw restart

To check the status of service:

/etc/init.d/ufw status

<img alt="Manage services by using init scripts" data-ezsrc="https://kirelos.com/wp-content/uploads/2022/04/echo/word-image-128-1024×575.png" data-ez ezimgfmt="rs rscb10 src ng ngcb10 srcset" height="421" loading="lazy" src="data:image/svg xml,” width=”750″>

That is how you can start, stop, and restart services using different ways without restarting the whole operating system. You can also use these commands in other Linux distributions.