reboot Command in Linux: Restart with systemctl and shutdown -r

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 rebootreboot vs systemctl reboot
On a system running systemd, /sbin/reboot is a compatibility wrapper that hands the request to the system manager, so sudo reboot and sudo systemctl reboot produce the same graceful restart. The difference is in what each one accepts.
systemctl reboot is the full interface. It takes the options described in the systemctl
guide, including --message=, --when=, and the boot loader options covered below. The standalone reboot command carries a smaller set of SysV-compatible flags and is faster to type. The two also diverge when you force a restart, which the next section covers.
Force a Reboot
If a graceful reboot does not complete, for example because a service refuses to stop, --force changes how aggressively systemd brings the machine down. The number of times you pass it matters, because each level trades safety for speed.
Passed once, --force skips the orderly shutdown of running services, but still kills every process and unmounts or remounts all file systems read-only before restarting:
sudo systemctl reboot --forcePassed twice, systemctl performs the reboot itself without contacting the system manager. No processes are terminated and no file systems are unmounted, so anything not yet written to disk is lost:
sudo systemctl reboot --force --forceThe short form -ff is identical, and reboot -f is mostly equivalent to it:
sudo reboot -fsystemctl reboot -ff and reboot -f skip unmounting entirely. Buffered writes are lost, and file systems may need a check on the next boot. Use them only when a normal reboot cannot complete.Reach for the single --force first. Keep the double form for a machine that is unresponsive enough that nothing else works, since it is close to cutting the power.
Reboot Into Firmware Setup or a Boot Loader Entry
systemctl reboot can also tell the firmware or boot loader what to do on the next boot, which saves guessing at the right key during POST.
To restart straight into the firmware setup interface, commonly called the BIOS or UEFI setup:
sudo systemctl reboot --firmware-setupTo show the boot loader menu on the next boot with a ten second timeout:
sudo systemctl reboot --boot-loader-menu=10Passing 0 disables the timeout, so the menu waits for you instead of continuing on its own.
To boot a specific entry once, pass its identifier:
sudo systemctl reboot --boot-loader-entry=auto-windowsPass help to list the identifiers available on the machine:
sudo systemctl reboot --boot-loader-entry=helpThese options are not available everywhere. --firmware-setup relies on UEFI firmware that exposes the setup interface to the operating system, and the two boot loader options rely on a boot loader that implements the systemd boot loader interface, such as systemd-boot.
reboot Command Options
The standalone reboot command accepts a small set of flags inherited from the SysV tools:
-f,--force- Reboot immediately without contacting the system manager--halt- Halt the machine instead of rebooting it-p,--poweroff- Power off the machine (ignored whenrebootis the command you invoked)-n,--no-sync- Do not sync storage media before restarting-w,--wtmp-only- Write thewtmpshutdown entry only, without actually restarting-d,--no-wtmp- Do not write awtmpshutdown entry--no-wall- Do not send a wall message before restarting
The most useful of these in practice is -f. Because it bypasses the system manager, it still works when systemd itself is stuck, which is the situation where a plain reboot hangs.
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.
Schedule a Reboot with systemctl
systemd 254 and newer provide the --when= option, which takes a timestamp in the format described in systemd.time(7). On older releases, use shutdown -r to schedule the reboot. To reboot in ten minutes with systemd 254 or newer:
sudo systemctl reboot --when=+10minTo schedule the reboot for 03:00 tomorrow:
sudo systemctl reboot --when="tomorrow 03:00"Both forms register with systemd exactly as shutdown -r does, so a reboot scheduled with one command is visible to the other. To print the currently scheduled action, pass show:
sudo systemctl reboot --when=showCancel 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"Because both commands schedule through systemd, --when=cancel clears the same pending request:
sudo systemctl reboot --when=cancelQuick Reference
For a printable quick reference, see the reboot cheatsheet .
| Command | Description |
|---|---|
sudo reboot | Reboot immediately |
sudo systemctl reboot | Reboot using systemd |
sudo systemctl reboot --force | Skip service shutdown, still unmount file systems |
sudo reboot -f | Reboot at once without contacting systemd |
sudo systemctl reboot --firmware-setup | Reboot into the firmware setup interface |
sudo systemctl reboot --boot-loader-menu=10 | Show the boot loader menu on the next boot |
sudo systemctl reboot --when=+10min | Reboot in 10 minutes using systemd 254 or newer |
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 is still up after that, run sudo systemctl reboot --force to skip the service shutdown sequence, and sudo reboot -f only if that also hangs.
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 "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.
systemctl reboot --firmware-setup reports that the operation is not supported
The firmware does not expose its setup interface to the operating system, or the machine boots in legacy BIOS mode rather than UEFI. Reboot normally and enter setup with the vendor key during POST.
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.
Does systemctl restart reboot the system?
No. systemctl restart expects a unit name and restarts that single service, as in sudo systemctl restart nginx. Running it with no unit returns an error rather than restarting the machine. The command that reboots the system is sudo systemctl reboot.
Is there a reboot -h option?
The -h flag is not a halt option for reboot. On systemd systems, it is accepted as an ignored compatibility flag, so sudo reboot -h still reboots the machine. Use sudo systemctl halt to halt the system, or sudo shutdown -h now
to power it off.
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 one or warn users in advance. On systemd 254 and newer, systemctl reboot --when= provides another scheduling method. Save --force for a machine that will not come down on its own, and the double -ff form for when nothing else gets it there.
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