Skip to content
Follow
Ubuntu Linux

Manage Nginx Services on Ubuntu: Start, Stop, Restart, Reload

Richard
Written by
Richard
Jun 27, 2023 Updated Oct 7, 2026 5 min read
How to Display Seconds on Ubuntu Top Menu Clock
How to Display Seconds on Ubuntu Top Menu Clock

Nginx is a popular web server and reverse proxy. It answers requests from visitors and passes them to your sites or applications. On Ubuntu, Nginx runs as a background service. You control it with a few short terminal commands. This guide shows how to start, stop, restart, and reload Nginx. You will need these commands whenever you change site settings, apply an update, or track down a connection error.

Advertisement

Knowing which command to use matters. A wrong choice can take a live site offline for no reason. This guide explains what each command does to your running site, so you can pick the right one. You need an Ubuntu server with Nginx already installed, a terminal (local or over SSH), and a user account that can run commands with sudo.

⚡ Quick Answer

You manage Nginx services on Ubuntu using systemctl commands. Start Nginx with `sudo systemctl start nginx`, stop it with `sudo systemctl stop nginx`, restart with `sudo systemctl restart nginx`, and reload configurations with `sudo systemctl reload nginx`.

Advertisement

Stop, Start, Restart, and Reload Nginx services

Before you change anything on a live server, it helps to know how Nginx behaves as a service. The related posts and the steps below cover the basics. Modern Ubuntu releases manage Nginx through systemd, so most of the commands here go through systemctl and need sudo. If a command asks for your password, type it and press Enter. Nothing shows on screen while you type, and that is normal.

Start Nginx services on Ubuntu Linux

Start Nginx when it is not running, for example after you stop it for maintenance or after a reboot on a server where it does not start by itself. Follow these steps:

  1. Open your terminal, or connect to the server over SSH.
  2. Run the command below with administrator privileges. It starts Nginx and returns you to the prompt without printing anything if it works.

If the command fails, another program is often using the same port. Apache, which listens on port 80 by default, is a common cause. Stop or reconfigure that program, then try again.

🐧Bash / Shell
sudo systemctl start nginx

Another command does the same job. You may see it in older guides or on servers set up in a different way. The result is the same: Nginx starts and begins answering requests.

Advertisement
🐧Bash / Shell
sudo /etc/init.d/nginx start

Stop Nginx services on Ubuntu Linux

Stop Nginx when you need to take the web server offline completely, for example for maintenance or to free up a port. Once it is stopped, visitors cannot reach any site it serves until you start it again. To stop Nginx on Ubuntu, run the command below.

The command prints nothing when it succeeds. Check the service status afterward if you want to confirm it has stopped.

🐧Bash / Shell
sudo systemctl stop nginx

This second command also stops the Nginx service. Use whichever one fits your setup. Both leave the site unreachable until you start Nginx again.

🐧Bash / Shell
sudo /etc/init.d/nginx stop

Restart Nginx services on Ubuntu Linux

Restart Nginx when you need to apply major configuration changes or clear stuck processes. A restart stops the service and starts it again. Active connections drop for a moment, so visitors who are loading a page at that instant may see an error. Follow these steps:

Advertisement
  1. Open your terminal.
  2. Run the sudo systemctl restart nginx command. It stops the web server and starts it again right away.
  3. Wait for the prompt to return. If there is no error message, Nginx is back up.

If Nginx does not come back, the most likely cause is a mistake in a configuration file. Fix the error, then start Nginx again.

The example below shows the restart command in use.

Reload Nginx to apply new settings without stopping the web server, so your website stays online. This is the better choice after you edit Nginx configuration files, because visitors do not notice anything. The master process reads the new configuration and starts new worker processes. The old workers finish the requests they are handling and then exit. If the new configuration contains an error, Nginx keeps running with the old settings. To reload Nginx, run this command:

Make sure Nginx is actually running before you reload it. A reload only works on a running service. Use the command below to check. If Nginx is running, the output shows active (running).

Advertisement

Here is a summary of the core operations and when to use each one:

Starting, stopping, restarting, and reloading are the four ways to control the active state of the Nginx web server.

  • start: Starts the process. Use it when Nginx is stopped.
  • stop: Stops the process. The site goes offline until you start it again.
  • restart: It will stop the process and start it again. Active connections drop briefly.
  • reload: This performs a graceful restart. This stops the child processes only, loads the new config, and starts the child processes. Use it after editing configuration files, because the site stays online.

That covers the four basic ways to control Nginx on Ubuntu. For everyday configuration changes, prefer a reload. Keep a full restart for cases where a reload is not enough.

Related Nginx posts:

Conclusion:

  • This article covered how to start, stop, restart, and reload Nginx processes on Ubuntu Linux, and when each one is the right choice.
  • The instructions for managing Nginx services and the recommended resources help beginners and experienced users alike.
  • Follow the steps above and you can manage Nginx web servers on Ubuntu Linux with confidence. Reload for configuration changes, and restart only when you need to.
  • The related Nginx posts above go further into Nginx server administration on Ubuntu Linux.

Was this guide helpful?

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.

Advertisement

📚 Related Tutorials

How to Install GNOME Desktop on Ubuntu 24.04
Ubuntu Linux How to Install GNOME Desktop on Ubuntu 24.04
How to Install KDE Desktop on Ubuntu 24.04
Ubuntu Linux How to Install KDE Desktop on Ubuntu 24.04
How to Install Nginx on Ubuntu Linux
Ubuntu Linux How to Install Nginx on Ubuntu Linux
How to Install FossBilling with Nginx on Ubuntu Linux
CMS How to Install FossBilling with Nginx on Ubuntu Linux

No comments yet — be the first to share your thoughts!

Leave a Comment

Your email address will not be published. Required fields are marked *