How to Reboot Ubuntu Linux from the Terminal

While Ubuntu Linux is known for its incredible stability—often running for months or even years without a restart—there are times when a reboot is absolutely necessary. You might need to load a newly installed kernel, apply a critical system-level security patch, or recover from a severe software hang. If you are managing a remote server via SSH, or if your graphical desktop environment has frozen, the terminal is the only way to restart the machine safely.

The Standard Reboot Command

The most straightforward way to restart a Linux machine is to use the dedicated reboot command. Because rebooting affects the entire system and drops all active user sessions, it requires superuser (root) privileges.

Open your terminal and type:

sudo reboot

After entering this command, the system will prompt you for your user password. Once authenticated, Ubuntu will immediately begin a graceful shutdown sequence. It will send termination signals to all running processes, unmount file systems safely to prevent data corruption, and finally trigger the hardware restart.

Using the Shutdown Command to Reboot

The shutdown command is incredibly versatile. While its primary purpose is to turn the machine off, you can pass it a specific flag to tell it to turn the machine off and then back on again.

sudo shutdown -r now

  • -r: This flag stands for “reboot.”
  • now: This tells the system to execute the command immediately, without waiting.

For immediate restarts, sudo reboot and sudo shutdown -r now are functionally identical. Most administrators use whichever one they are most accustomed to typing.

Scheduling a Reboot for Later

The true power of the shutdown -r command is its ability to schedule the restart for the future. This is essential for system administrators who want to apply updates during the day but wait until the middle of the night (when web traffic is lowest) to actually restart the server.

To reboot the system in exactly 15 minutes, type:

sudo shutdown -r +15

To reboot the system at a specific time, such as 2:00 AM (using a 24-hour clock format), type:

sudo shutdown -r 02:00

When you schedule a reboot, the terminal will broadcast a warning message to all currently logged-in users, giving them time to save their work. If you realize you made a mistake and need to cancel the pending reboot, you can easily abort it by running:

sudo shutdown -c

Get the best tech tips delivered straight to your inbox.

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