Ubuntu / Debian: Restart Named Service Command

To restart a named service on Ubuntu or Debian, you can use the following command:

sudo systemctl restart service-name.service

Replace “service-name” with the actual name of the service you want to restart. For example, to restart the Apache web server, you would run:

sudo systemctl restart apache2.service

You need to have root privileges (using “sudo”) to run this command, since it affects system services. The “systemctl” command is the default service management tool on Ubuntu and Debian systems running the Systemd init system.

Leave a Comment