Restart Ubuntu server

There are many commands that can be used to restart Ubuntu Server. We are going to look at some of them that I remember. The first one is the reboot command. In Linux reboot means restart. To use the reboot command, invoke reboot at the command line terminal. You must have root privilege, so add sudo before reboot.

Restart Ubuntu server with reboot command example:

luzar@ubuntu:~$ sudo reboot 
[sudo] password for luzar:

The second command that can be used to restart Ubuntu server is the shutdown command. In Ubuntu, you can use shutdown command to bring down the system to restart or to power off the system. That depends on the option given with shutdown command. To restart Ubuntu system with shutdown command, use shutdown with -r option and provide time to shutdown the system. See the example below.

Restart Ubuntu server with shutdown command example:

luzar@ubuntu:~$ sudo shutdown -r 18:00
[sudo] password for luzar:

Broadcast message from luzar@ubuntu
        (/dev/pts/0) at 16:24 ...

The system is going down for reboot in 96 minutes!

Broadcast message from luzar@ubuntu
        (/dev/pts/0) at 16:30 ...

The system is going down for reboot in 90 minutes!

Press Ctrl+c to cancel restart.

The system is going down for reboot in 90 minutes!
shutdown: Shutdown cancelled
luzar@ubuntu:~$

You can use shutdown command to restart the system on the spot using now as the time argument. See an example below:

luzar@ubuntu:~$ sudo shutdown -r now
[sudo] password for luzar:

Broadcast message from luzar@ubuntu
        (/dev/pts/0) at 16:44 ...

The system is going down for reboot NOW!

That's the command that you can used to restart Ubuntu server system if you have to.