Ubuntu Reboot Command: How to Restart Ubuntu From the Terminal

Restarting Ubuntu from the terminal is a routine administrative task, but it should still be handled with care. Whether you are maintaining a desktop system, managing a remote server over SSH, applying kernel updates, or troubleshooting services, the correct reboot command helps ensure that processes stop cleanly and file systems remain consistent.

TLDR: The standard way to restart Ubuntu from the terminal is sudo reboot. You can also use sudo shutdown -r now or sudo systemctl reboot, both of which perform a controlled restart. If you are connected remotely, confirm that the system will come back online before rebooting. Avoid forced reboot options unless the machine is unresponsive and you understand the risk of data loss.

Understanding the Ubuntu Reboot Command

Ubuntu, like most Linux distributions, provides several commands that can restart the operating system. These commands may look different, but on modern Ubuntu systems they usually communicate with systemd, the service and init manager responsible for controlling system startup, shutdown, and service supervision.

The most common command is:

sudo reboot

This tells Ubuntu to restart the system in an orderly way. The sudo part runs the command with administrative privileges, which are required because rebooting affects every user, service, and process on the machine.

When the command runs, Ubuntu notifies system services, stops running processes, unmounts file systems when possible, and then restarts the machine. This is different from cutting power or pressing a physical reset button, which can interrupt writes to disk and cause data corruption.

The Basic Command: sudo reboot

For most users, sudo reboot is the command to remember. It is short, clear, and appropriate for both Ubuntu Desktop and Ubuntu Server.

sudo reboot

After entering the command, Ubuntu may ask for your user password. The password prompt is normal; it confirms that you are authorized to perform administrative actions. When you type your password, the terminal usually shows no characters, not even asterisks. This is expected behavior.

Use sudo reboot when:

  • You installed updates that require a restart.
  • You changed kernel, driver, or system configuration files.
  • You need to clear a temporary system problem.
  • You are restarting a test machine or development server.

Before running it, save open work, close important applications, and make sure other users are not actively using the system. On a server, check whether critical services, active sessions, or scheduled tasks are running.

Alternative Command: sudo shutdown -r now

Another reliable method is the shutdown command with the restart option:

sudo shutdown -r now

In this command, -r means reboot after shutdown, and now means the action should happen immediately. This command is especially useful because it also supports scheduling.

For example, to restart Ubuntu in 10 minutes, use:

sudo shutdown -r +10

To schedule a reboot at a specific time, such as 23:30, use:

sudo shutdown -r 23:30

You can also include a message that will be shown to logged-in users:

sudo shutdown -r +15 "System reboot in 15 minutes for maintenance."

This is a professional approach on shared systems because it gives users time to save work and disconnect safely.

If you need to cancel a scheduled reboot, run:

sudo shutdown -c

The shutdown command is therefore a strong choice for administrators who want more control over timing and user notification.

Using systemctl reboot

Because modern Ubuntu uses systemd, you can restart the system directly through systemctl:

sudo systemctl reboot

This command is clear and technically direct. It asks systemd to start the reboot process. In practical terms, it is similar to sudo reboot on current Ubuntu releases.

You may prefer systemctl reboot when writing documentation, automation scripts, or procedures for systems where systemd behavior should be explicit. It is also useful for administrators who already use systemctl to manage services, such as:

sudo systemctl restart nginx
sudo systemctl status ssh
sudo systemctl reboot

The command is serious and predictable, but it should still be treated as a full system restart. It is not the same as restarting a single service.

Rebooting Ubuntu Over SSH

Rebooting a remote Ubuntu server through SSH requires extra caution. Once the reboot begins, your SSH session will disconnect. That is normal, but you must be confident that the server will boot correctly and that networking and SSH will start again.

A typical remote reboot command is:

sudo reboot

Before running it on a remote machine, consider the following checklist:

  • Confirm the hostname: Run hostname or hostnamectl so you do not reboot the wrong server.
  • Check active users: Run who or w to see who is logged in.
  • Verify uptime and load: Use uptime to get a quick system overview.
  • Check pending updates: Understand why the reboot is needed.
  • Ensure remote access will return: Verify SSH is enabled and firewall rules are correct.

For production environments, it is wise to confirm that you have console access through your hosting provider, hypervisor, or out-of-band management system. If the server fails to restart cleanly, console access may be the only way to recover it.

Checking Whether Ubuntu Needs a Reboot

Ubuntu often creates a file when a reboot is required after updates. You can check for it with:

ls /var/run/reboot-required

If the file exists, a reboot is recommended. To see which packages requested the restart, run:

cat /var/run/reboot-required.pkgs

This is common after kernel updates, system library updates, or critical security patches. On servers, this information helps you decide whether to reboot immediately or schedule maintenance.

You can also use:

needrestart

if the needrestart package is installed. It can identify services that need to be restarted and may indicate whether a full system reboot is advisable.

Graceful Reboot Versus Forced Reboot

A normal reboot gives Ubuntu time to stop services and write pending data to disk. This is the correct method in nearly all situations. However, Linux also provides forced reboot options, such as:

sudo reboot -f

The -f option forces the reboot and may bypass some normal shutdown steps. This can be dangerous. It should be considered only when the system is severely stuck and a graceful reboot does not work.

In extreme cases, administrators sometimes use the kernel SysRq interface to safely sync disks before rebooting. For example:

echo b | sudo tee /proc/sysrq-trigger

This immediately reboots the system and should not be used casually. A safer SysRq sequence involves syncing and remounting file systems read-only before rebooting, but such procedures are normally reserved for experienced administrators handling a hung system.

Important: Forced reboot methods may cause data loss, interrupted transactions, damaged databases, or file system issues. If the machine is still responding to normal commands, use sudo reboot, sudo shutdown -r now, or sudo systemctl reboot instead.

Rebooting After Updates

One of the most common reasons to restart Ubuntu is after installing updates. You may update packages with:

sudo apt update
sudo apt upgrade

After a kernel update, the new kernel will not be used until the system restarts. A reboot may also be required when core system libraries are upgraded. If Ubuntu displays a message such as System restart required, plan a restart as soon as practical.

On a desktop, this may simply mean saving your files and running:

sudo reboot

On a server, a more careful maintenance window may be appropriate:

sudo shutdown -r +30 "Rebooting for security updates in 30 minutes."

This gives connected users time to prepare and provides a clear reason for the restart.

Verifying the System After Reboot

After Ubuntu restarts, confirm that the system is healthy. On a local machine, you can open a terminal and check uptime:

uptime

On a server, reconnect through SSH and verify essential services:

systemctl status ssh
systemctl status nginx
systemctl status mysql

Replace service names with the services relevant to your system. You can also review boot logs with:

journalctl -b

To see errors from the current boot, use:

journalctl -b -p err

These checks are especially important after kernel upgrades, driver changes, storage configuration changes, or network configuration updates.

Common Problems and Practical Fixes

If sudo reboot says you are not allowed to run the command, your user may not have sudo privileges. Check whether your account belongs to the sudo group:

groups

If needed, an administrator can add a user to the sudo group with:

sudo usermod -aG sudo username

If the reboot command appears to hang, wait a reasonable amount of time. Some services, especially databases or network file systems, may need time to stop cleanly. If the system is remote, avoid repeatedly issuing commands unless you know its state.

If Ubuntu does not come back online after a remote reboot, use your provider’s console, recovery mode, or virtual machine management interface. Check boot messages, disk space, file system status, and network configuration.

Best Practices for Restarting Ubuntu

Follow these best practices to reduce risk:

  • Use graceful commands first: Prefer sudo reboot, sudo shutdown -r now, or sudo systemctl reboot.
  • Warn users: On shared systems, schedule the reboot and include a message.
  • Check the server identity: Confirm the hostname before rebooting remote machines.
  • Save work and stop critical jobs: Avoid interrupting backups, migrations, or deployments.
  • Verify services afterward: Confirm that important applications started correctly.
  • Avoid forced reboots: Use them only when normal methods fail.

Conclusion

The simplest Ubuntu reboot command is sudo reboot, and it is suitable for most situations. For scheduled restarts or user notifications, sudo shutdown -r provides more control. For administrators working directly with systemd, sudo systemctl reboot is equally appropriate and explicit.

A reboot may be simple, but it affects the entire operating system. Treat it as an administrative action: confirm the target machine, communicate with users, allow services to stop cleanly, and verify the system afterward. Used correctly, the Ubuntu terminal gives you a safe, reliable, and professional way to restart both desktops and servers.