Flash Sale:75% Off Hosting + Free DomainEnds in13h47m14sView Plans
Hostvento logoHostvento

How to Restart Ubuntu from the Terminal

Reboot Ubuntu with reboot, shutdown, systemctl, init or the REISUB keys.

How-To Guides2 min read3 screenshots

reboot

Restart now:

sudo reboot now
Restarting Ubuntu immediately

Or simply:

sudo reboot

Force an immediate restart without stopping services cleanly (a last resort):

sudo reboot -f

shutdown

Restart in one minute:

sudo shutdown -r

Restart after a number of minutes:

sudo shutdown -r +min

Example, in 4 minutes:

sudo shutdown -r +4
Scheduling a reboot

Cancel it:

sudo shutdown -c
Cancelling a scheduled reboot

systemctl

sudo systemctl reboot

init

sudo init 6

telinit

sudo telinit 6

REISUB

When the system is frozen and does not react to the mouse or the keyboard, hold Alt and SysRq (Print Screen) and type these keys slowly, one by one:

  • R switches the keyboard to raw mode.
  • E sends the terminate signal to all processes except init.
  • I sends the kill signal to all processes except init.
  • S syncs all file systems to the disk.
  • U remounts file systems as read-only.
  • B reboots the system.

Remember it as "Reboot Even If System Utterly Broken". The magic SysRq keys must be enabled on the system.

Before you reboot a server

  • Save your work and tell other users, for example with sudo shutdown -r +10 "Rebooting for updates".
  • Check that services start at boot with systemctl is-enabled service.
  • Keep console or panel access in case the server does not come back.

Quick recap

  • sudo reboot is the quickest way.
  • Use shutdown -r +N to schedule it and shutdown -c to cancel.