Linux Reboot (Restart) Command
Maybe your like
When the kernel is updated, or when troubleshooting hardware issues or finishing application installations, a system reboot is sometimes required. If you are running a headless Linux server, you need to know how to restart the system from the command line.
On modern Linux distributions, the systemctl utility manages system power state. The standalone reboot and shutdown commands are aliases to systemctl and remain available for compatibility. On most servers, these commands require root access or a user with sudo privileges.
Reboot Using systemctl #
Use systemctl reboot for the direct systemd command:
Terminalsudo systemctl rebootFor a shorter equivalent command, use reboot:
Terminalsudo rebootBoth commands behave identically. The system notifies all logged-in users and processes that it is going down, prevents new logins, closes open files, stops running processes, and restarts.
To suppress the broadcast wall message sent to logged-in users, use --no-wall:
Terminalsudo systemctl --no-wall rebootTo include a custom reason in the system logs, use --message=:
Terminalsudo systemctl --message="Kernel update applied" rebootThe message appears in the system journal:
outputSystem is rebooting (Kernel update applied)To view it after the system comes back up, use journalctl :
Terminaljournalctl -b -1 | grep -i rebootIf a graceful reboot is unresponsive — for example because a process is stuck — add --force to skip the clean shutdown sequence:
Terminalsudo systemctl reboot --forceUse this only when a normal reboot does not complete, as it does not give running processes time to shut down cleanly.
Schedule a Reboot with shutdown #
The shutdown command with the -r option performs a reboot. Without a time argument, the system reboots after one minute:
Terminalsudo shutdown -rThe time argument accepts two formats:
- Absolute time: hh:mm — reboot at a specific clock time
- Relative time: +m — reboot after m minutes from now
To reboot at 10:00:
Terminalsudo shutdown -r 10:00To reboot in 5 minutes:
Terminalsudo shutdown -r +5To reboot immediately:
Terminalsudo shutdown -r nowTo broadcast a custom message to all logged-in users alongside the standard notification, add it after the time argument. The wall command is used internally for this:
Terminalsudo shutdown -r +10 "Rebooting for hardware upgrade"Note that a time argument is required when adding a custom message.
Cancel a Scheduled Reboot #
To cancel a pending reboot, run shutdown with the -c option:
Terminalsudo shutdown -cTo include a reason in the cancellation message:
Terminalsudo shutdown -c "Reboot canceled — issue resolved"Quick Reference #
| Command | Description |
|---|---|
| sudo reboot | Reboot immediately |
| sudo systemctl reboot | Reboot using systemd |
| sudo systemctl reboot --force | Force reboot if graceful shutdown hangs |
| sudo shutdown -r now | Reboot immediately via shutdown |
| sudo shutdown -r +5 | Reboot in 5 minutes |
| sudo shutdown -r 10:00 | Reboot at 10:00 |
| sudo shutdown -r +10 "message" | Reboot in 10 minutes with a custom message |
| sudo shutdown -c | Cancel a scheduled reboot |
Troubleshooting #
System does not reboot after running systemctl reboot A process may be refusing to terminate cleanly. Wait up to 90 seconds for systemd to force-kill stubborn services. If the system remains unresponsive, run sudo systemctl reboot --force to bypass the graceful shutdown sequence.
SSH session drops immediately on reboot This is expected behavior. The server terminates all active connections as part of the shutdown sequence. Reconnect via SSH once the system has come back online.
shutdown -r +5 "message" returns a syntax error When adding a custom wall message to shutdown, a time argument is required. You cannot use a message without specifying a time. Use shutdown -r +0 "message" to reboot immediately with a message.
FAQ #
What is the difference between reboot and shutdown -r now? Both reboot the system immediately. reboot (and systemctl reboot) is the more direct invocation. shutdown -r now goes through the shutdown utility, which is useful when you want to schedule a future reboot or attach a custom wall message. The end result is the same.
How do I cancel a scheduled reboot? Run sudo shutdown -c. This cancels any reboot or shutdown scheduled with the shutdown command. It does not affect a reboot already in progress.
Will open files or unsaved data be lost on reboot? A graceful reboot sends termination signals to all running processes, giving applications time to save data and close files. Unsaved data in applications that do not handle signals — or that are force-killed — may be lost. Always save your work before rebooting.
How do I check when the system was last rebooted? Run last reboot to see a history of reboots, or uptime -s to see the current boot time. You can also check the system journal with journalctl --list-boots.
Conclusion #
Use sudo reboot or sudo systemctl reboot for an immediate restart, and sudo shutdown -r when you need to schedule a reboot or notify users in advance. Add --force only when a normal reboot is unresponsive.
If you have any questions, feel free to leave a comment below.
Tags
linux commandsLinuxize Weekly Newsletter
A quick weekly roundup of new tutorials, news, and tips.
SubscribeUnsubscribe anytime. We respect your inbox.
About the authors

Dejan Panovski
Dejan Panovski is the founder of Linuxize, an RHCSA-certified Linux system administrator and DevOps engineer based in Skopje, Macedonia. Author of 800+ Linux tutorials with 20+ years of experience turning complex Linux tasks into clear, reliable guides.
View author pageTag » How Long Does Sudo Reboot Take
-
Time It Takes To Reboot A Linux Server - Unix Stack Exchange
-
How Long Does It Take For A Server To Restart? - Psychz Networks
-
How Long Does It Take To Reboot A Server? - Quora
-
`sudo Reboot` Vs `reboot` - What Is The Difference? - Ask Ubuntu
-
How To Reboot Your Linux PC Or Server With A Single Command
-
How To Restart A VPS Or Dedicated Server? | ScalaHosting Blog
-
How Long Does It Take To Reboot A Linux Server?
-
What Is Linux Restart Command?
-
How To Reboot Or Shut Down Your Virtual Machine?
-
Reboot Linux System Command - NixCraft
-
How Long Does A Server Reboot On DigitalOcean Take ... - TechWalls
-
How To Use Linux Shutdown Command With Examples - PhoenixNAP
-
How Long Does It Take To Reboot A Linux Server? - Celebrities Buzz
-
3 Commands To Reboot Linux (plus 4 More Ways To Do It Safely)