How to Reboot Ubuntu? (Methods to Restart Ubuntu Command Line)
As a Linux administrator, situations like hardware problems or software installations may require you to halt, power off or restart Ubuntu system. Rebooting is a common and effective solution to resolve various issues and ensure smooth system performance. While only users with root access or proper permissions can execute reboot commands, this process is a fundamental practice in system management.
In this guide, you'll learn how to reboot Ubuntu using essential commands or restart Ubuntu from terminal, keeping it fresh and stable.
Prerequisites
Before you can restart Ubuntu system using the command line, make sure the following conditions are met:
- You have a machine running a Linux-based operating system.
- The user account you're using has sudo privileges (administrator rights).
- You have access to the terminal or command-line interface.
How to Reboot Ubuntu? (Ubuntu Reboot Command Line)
How to Reboot Ubuntu Using the Reboot Command?
One of the easiest ways to restart Ubuntu system from the terminal is by using the reboot command. It's straightforward, requires no additional parameters, and is widely supported across most Linux distributions.
To use it, simply type:
$ reboot
However, since restarting the system requires administrative privileges, you’ll typically need to add sudo before the command:
$ sudo reboot
In some cases, your system may not respond to the standard reboot command. When that happens, you can force a restart. Be aware that this method stops all running processes immediately, which might lead to unsaved data being lost.
To force a reboot, use:
$ sudo reboot --force
This command should only be used when absolutely necessary, such as when the system is completely unresponsive.
How to Restart Ubuntu with the systemctl Command?
Another way to restart Ubuntu system is by using the systemctl command. Most modern Linux distributions, including Debian, Ubuntu, CentOS, RHEL, Fedora, and Arch, use systemd to manage system services. Here's how you can use systemd commands to reboot your Linux system.
To restart the system immediately, use:
$ sudo systemctl reboot
This command will inform all logged-in users and processes that the system is about to reboot. It will close all open files and terminate any running processes. If you prefer not to display this message, you can use the --no-wall option:
$ sudo systemctl --no-wall reboot
If you'd like to provide a custom message explaining the reason for the reboot, you can do so with the --message option:
$ sudo systemctl --message="Hardware upgrade" reboot
This will add a message to the system logs, indicating the reason for the restart (e.g., "System is rebooting (Hardware upgrade)").
Additionally, some modern hardware allows you to restart Ubuntu directly into the firmware (BIOS) setup. To do this with systemd, use the following command, but note that this functionality may not be available on all platforms:
$ sudo systemctl reboot --firmware-setup
This command will initiate a reboot into the firmware setup interface (BIOS).
How to Reboot Ubuntu with the shutdown Command?
Although the name suggests it’s only for turning off the system, the shutdown command can also be used to restart Ubuntu. While it may not seem as direct as using reboot, it offers more flexibility, especially when it comes to scheduling a restart.
To perform a basic restart, use the -r or --reboot option with the command. By default, this will schedule a reboot one minute after the command is run:
sudo shutdown -r
If you’d like to delay the restart by a specific number of minutes, you can include a time parameter. Just replace MINUTES with the desired delay:
$ sudo shutdown -r +MINUTES
For example, to schedule a reboot in 30 minutes, you would run:
$ sudo shutdown -r +30
To reboot the system immediately, you can use the now argument:
$ sudo shutdown -r now
A key advantage of this command is its ability to schedule delayed restarts. And if you change your mind or need to cancel a pending shutdown or reboot, you can do so with:
$ sudo shutdown -c
This gives you more control over when and how your system restarts.
How to Reboot Ubuntu on a Remote Linux Server?
Now that you're familiar with the essential reboot commands, let's go over how to restart a remote Linux system through the terminal.
If you're working on a system with a graphical interface, you can open the terminal by right-clicking on the desktop and selecting "Open in Terminal". Alternatively, navigate through Menu > Applications > System Tools > Terminal, or simply press Ctrl + Alt + T as a shortcut.
To reboot a remote server using SSH, you can run the following command from your terminal:
$ ssh -t username@remote-server 'sudo reboot'
Or, as another option:
$ ssh root@remote-server 'shutdown -r now'
After running either command, you'll be prompted to enter the password for the specified user.
To check when the remote server is back online, you can use the ping command like this:
$ ping -a remote-server
If you're connecting as a regular user and need to run the reboot command with elevated privileges, use:
$ ssh -t your-username@remote-server '/sbin/reboot'
These methods help you securely restart a remote Linux machine using SSH access.
Why do you need to reboot Ubuntu?
Like many Linux-based systems, Ubuntu is built for long-term stability and often doesn’t require regular restarts. However, there are specific situations where rebooting becomes essential for system health, performance, and functionality.
System Crashes and Kernel Panics
A kernel panic is a critical system error that occurs when the operating system encounters a problem it can’t recover from. This usually stems from low-level faults in hardware or software.
When this happens, Ubuntu stops all CPU activities to avoid further issues and may generate a memory dump for debugging purposes. At this point, the system must be rebooted to resume normal operations.
Modifying the Root Partition
If you decide to adjust the size of your root partition—whether to increase storage or reorganize your drive—Ubuntu must be restarted. These changes directly affect the system’s core file structure, and a reboot ensures that all modifications are properly applied and recognized.
Applying Kernel or Security Updates
Ubuntu regularly receives kernel updates and security fixes. Since the kernel is the system's core component, any updates to it won’t take effect until the machine is restarted.
Even though Linux allows hot-swapping components in many cases, kernel changes are an exception that require a full reboot for the system to load the new version.
Handling Freezes and Slowdowns
Over time, your system might become unresponsive or laggy due to software conflicts, memory leaks, or overloaded resources. When this happens, rebooting is often the quickest and most effective way to refresh the system, clear temporary files, and restart stalled processes.
Dealing with Overheating Issues
CPU overheating is another issue that can affect performance and system stability. While it’s common to let the system cool down naturally, restarting the device is a smarter move. It shuts down unnecessary applications and processes that may be stressing the processor, giving the hardware a chance to cool down more efficiently.
Conclusion
In this article, we've covered several methods about how to reboot Ubuntu system, all of which can also be applied to other Linux distributions. Now, we'd love to hear from you! Share any additional reboot methods you may know in the comments below. And be sure to explore more helpful articles on our website.
Unlock the full potential of your website with 10GBVPS hosting! Experience blazing-fast speeds that enhance performance and eliminate concerns about bandwidth limits or unexpected overage fees. With multiple global server locations to choose from, you can ensure your website operates with optimal speed and reliability, wherever your audience is located. Don't settle for less—upgrade to 10GBVPS and take your hosting experience to the next level!
Blog