Ubuntu

How to Restart Ubuntu Server

The command prompt is used by the majority of Linux users, particularly administrators, to execute common activities on Ubuntu. One of which is a reboot or reloading your machine. For a myriad of purposes, we reboot our computers. One of these factors is that certain software requires a restart to become fully up and running after deployment. Certain Ubuntu software updates need a system reboot to refresh the programs. Another compelling reason to restart your computer is to resolve a software issue. Whenever we reboot our computer, a new copy of the program is placed into primary storage, replacing the one that is broken. You now understand why technical support questions, “Did you try restarting your device?” Let’s see the different methods to reboot our Ubuntu 20.04 system device in this guide.

We will be working on the Ubuntu 20.04 shell application to execute some commands for a reboot. Although, there is already a GUI method to reboot the system. We will avoid that in this article. So, we need to open the shell application by “Ctrl+Alt+T” shortcut on the desktop of the system while working or using another way. The second way to launch the shell is to “right-click” on the desktop of Ubuntu 20.04, and a dialogue task menu will be opened on the screen. Go to the option of “Open in Terminal” and tap on it. We recommend using the shortcut key.

Method 01: Using Reboot Instruction

The very first method to restart or reboot your Ubuntu Server is via the reboot instruction. The reboot statement is the easiest way to revive your machine in such a manner that it should not turn off or on while doing so. The statement is normally used without any additional flags or parameters. But, we can also consider using some flags in our examples. So, within our first illustration, we have used the simple “reboot” keyword and pressed Enter to execute it.

Sometimes, the user may encounter some errors while rebooting a system. To avoid any inconvenience, we will be using the “reboot” instruction with “sudo” rights as shown below.

You can also utilize the reboot command with the “system” command of Ubuntu 20.04. This is because we need to activate the reboot system of Ubunutu 20.04 by systemctl instruction with the sudo privileges. The command has been shown below and you can try it on your end.

The other very useful command to reboot to load the system and apply the updates is using the “sbin” reboot command in the shell with the sudo rights. The command is displayed below.

If you want your system to immediately restart or reboot upon any error, then you have to use the word “now” within the reboot instruction and execute it. The instruction is shown below.

If you want to forcefully reboot your system ignoring all the processes currently running on your machine, you have to use the “-f” flag within the reboot command shown below.

Method 02: Using Shutdown Instruction

The shutdown statement is being used to close down your device, but it may also be utilized to reload it when you provide the -r parameter. So, we will use it in the shell terminal to reboot the system or close it. Here’s how you’d be using the statement in this situation:

You can also utilize the same command in the shell with the keyword “now” to immediately reboot or shut down your Ubuntu 20.04 system. This is quicker than the upper command.

Additionally, you may use the shutdown command to plan a system restart at a specific time. We can use a timeframe instead of the “now” keyword. 0 indicates an instant shutdown or restart. The -H flag, which refers to stop, can also be used. This parameter causes the system to first kill all activities before shutting down the Processor. The command is shown below.

If you want to reboot after some minutes i.e., 10, you can do so using the below image.

Let’s suppose you want to restart/reboot or shutdown your Ubuntu 20.04 system at a specific time i.e., at 5’0 clock and 25 minutes, then you can also do that. You have to simply mention the exact time in “hour:minute:second” format. This command format is displayed below. This way your system may restart or shut down at this specific mentioned time.

If any user wants to just cancel all the previous scheduled reboots or shutdowns, they have to utilize the “-c” flag in their shutdown command as per the photo displayed below.

Method 03: Using Init Instruction

Here comes the “init” command method to reboot your system. Your system’s behavior is controlled by the value you enter with the init instruction, which ranges from 0 to 6. Run levels refer to this behavior and the activities that go along with it. This figure 0 in init command stands for shutdown or power off the machine immediately as shown below.

Figure 1 will be used to get to the rescue mode of your system. It will secure your system applications and data while rebooting or shut down and let you do security updates. The command is shown in the screenshot image below. Other figures from 2 to 6 can let you reboot or shut down your system by starting the “runlevelXtarget” unit.

If any of you has been working on any remote Ubuntu server, he/she can also reboot it from the shell terminal. The command for remote server reboot can be used with two different keywords i.e., “reboot” and “shutdown” as displayed below.


Conclusion

This article contains the brief and easiest demonstration of different methods to reboot or shut down your Ubuntu 20.04 Linux operating system. We have illustrated the examples to reboot the Ubuntu system by reboot command, shutdown command, and the init command of Linux. Different flag values have been utilized for a different purposes. As well, the “now” and “sudo” keywords have taken an important part in this. We hope this article will be very helpful to you.

About the author

Omar Farooq

Hello Readers, I am Omar and I have been writing technical articles from last decade. You can check out my writing pieces.