how to restart nginx in ubuntu 18.04 code example Example 1: ubuntn nginx restart sudo service nginx restart Example 2: stop nginx server sudo systemctl stop nginx