reboot Command in Linux: Restart the System from the Command Line

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:
sudo systemctl rebootFor a shorter equivalent command, use reboot:
sudo 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:
sudo systemctl --no-wall rebootTo include a custom reason in the system logs, use --message=:
sudo systemctl --message="Kernel update applied" rebootThe message appears in the system journal:
System is rebooting (Kernel update applied)To view it after the system comes back up, use journalctl
:
journalctl -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:
sudo 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:
sudo 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:
sudo shutdown -r 10:00To reboot in 5 minutes:
sudo shutdown -r +5To reboot immediately:
sudo 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:
sudo 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:
sudo shutdown -cTo include a reason in the cancellation message:
sudo 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
Linuxize Weekly Newsletter
A quick weekly roundup of new tutorials, news, and tips.
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 page