How to Restart the Network Manager Service in Ubuntu Terminal

If your Ubuntu machine suddenly drops its Wi-Fi connection, refuses to connect to a new VPN, or stalls while trying to assign an IP address via DHCP, your first instinct might be to reboot the entire computer. While a full system restart usually fixes temporary networking glitches, it is highly disruptive, especially if you are working on a server or have multiple applications running.

Instead of rebooting the entire operating system, you can simply restart the specific background service responsible for handling all network connections. In modern versions of Ubuntu, this service is called NetworkManager, and it can be instantly rebooted directly from the terminal.

Using Systemctl to Restart NetworkManager

Ubuntu uses the systemd init system to manage all its background services. The command-line tool used to interact with these services is systemctl. Because restarting the network affects the entire system, you must run this command with root (administrator) privileges.

  1. Open your terminal window (you can press Ctrl + Alt + T).
  2. Type the following command exactly as written:
    sudo systemctl restart NetworkManager
  3. Press Enter.
  4. The terminal will prompt you to enter your user password. As you type, no characters or asterisks will appear on the screen; this is a normal Linux security feature. Type your password and press Enter again.

The command executes silently. Your internet connection will drop for approximately two to three seconds as the service shuts down and immediately boots back up. Once it restarts, it will automatically attempt to reconnect to your known Wi-Fi networks or re-establish your ethernet connection, often resolving any stalled processes in the background.

Verifying the Service Status

If restarting the service did not immediately fix your internet connection, you should check the status of NetworkManager to see if it crashed or encountered a specific error during startup.

  1. In the terminal, type the following command:
    systemctl status NetworkManager
  2. Press Enter. (You do not need sudo just to check the status).
  3. The terminal will output a block of text. Look for the line that says Active:. If the service is running correctly, it should read active (running) in green text.
  4. Below that, you will see the most recent log entries for the service. Scanning these logs can help you identify if a specific Wi-Fi adapter is failing to initialise or if a DHCP lease is being repeatedly denied by your router.
  5. Press the Q key on your keyboard to exit the status screen and return to the normal terminal prompt.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.