Where knowledge empowers you to understand your world

How To Restart Nginx Or Stop It From Running

You can restart an Nginx server, start up an Nginx server, or stop it from running using simple commands.

How To Restart Nginx On Ubuntu, Debian and Similar Linux Distributions

To restart Nginx on Ubuntu, use the following command, which reloads configuration files:

sudo systemctl reload nginx

To force restart Nginx so that it doesn’t only reload configuration files, but stops and starts everything, use the following ‘restart’ command instead:

sudo systemctl restart nginx

To stop Nginx on Ubuntu, use the following command:

sudo systemctl stop nginx

How To Start An Nginx Server On Ubuntu

sudo systemctl start nginx

To check if Nginx is running, use the following ‘status’ command:

sudo systemctl status nginx