Restarting an Ubuntu machine from the terminal takes one short command, but the right method depends on the situation. The ubuntu reboot command handles routine restarts. The shutdown command adds scheduling and user warnings. Force options exist for a frozen system. Here is the exact syntax for each case.
How to Use the Ubuntu Reboot Command
The quickest way to restart is the reboot command:
sudo reboot
This stops running processes in order, unmounts the filesystems, and brings the system back up. Nothing is lost under normal conditions. You need sudo because a restart requires root access.
You can also write it with the now argument:
sudo reboot now
The result is the same immediate restart. On current Ubuntu releases, reboot is part of systemd, so sudo systemctl reboot performs the job through the systemctl service manager. These commands behave the same across most distributions, and the wider Linux restart command works the same way on Debian and CentOS.
Reboot Ubuntu With the Shutdown Command
The shutdown command gives more control than reboot alone. The -r flag tells it to restart instead of powering off:
sudo shutdown -r now
This restarts right away while keeping the cleanup and broadcast features that reboot lacks.
Schedule a restart for a set time
Pass a clock time to delay the restart:
sudo shutdown -r 22:30
The system restarts at 10:30 PM. Logged-in users get time to save work and disconnect before the box goes down.
Warn users before the restart
Add a minute offset and a message to notify active sessions:
sudo shutdown -r +10 "Server restarting in 10 minutes for maintenance."
The +10 delays the restart by ten minutes. The quoted text broadcasts to everyone connected. Changed your mind? Cancel any pending action with:
sudo shutdown -c
Force Reboot When Ubuntu Stops Responding
Force options skip the clean shutdown of processes, so they carry a real risk of data loss. Keep them for a system that no longer answers normal commands.
sudo systemctl reboot --force
sudo reboot -f
Both trigger an abrupt restart without flushing buffers or stopping services in order. The systemd reboot service documents what runs during a normal shutdown sequence, which is what these flags bypass.
Ubuntu Reboot Command Quick Reference
| Task | Command |
|---|---|
| Restart immediately | sudo reboot |
| Restart through shutdown | sudo shutdown -r now |
| Schedule at a time | sudo shutdown -r HH:MM |
| Restart after a delay with a message | sudo shutdown -r +N "message" |
| Cancel a pending restart | sudo shutdown -c |
| Force restart | sudo systemctl reboot --force |
Best Practices for the Ubuntu Reboot Command
Notify users first. During production hours, send a warning with sudo shutdown -r +N "message" so people can close files and end sessions before the system drops.
Pick a quiet window. Plan maintenance restarts when traffic and active usage are lowest. After the box comes back, check that key services and daemons started and review logs if anything looks off.
Manage automation carefully. If a maintenance script triggers the restart, the same rules apply when you run a shell script, and any script that calls these commands needs executable permissions set first.
Running the command remotely is normal practice. Start by opening an SSH session and confirm you have sudo access. The connection drops when the server restarts, so reconnect once it returns. Restarts often follow file housekeeping, such as when you move directories during cleanup.
FAQs
What is the ubuntu reboot command?
Run sudo reboot to restart Ubuntu from the terminal. It stops processes cleanly, unmounts filesystems, and brings the system back online. sudo systemctl reboot does the same through systemd.
How do I reboot Ubuntu over SSH?
Connect with ssh username@server-ip, confirm sudo access, then run sudo reboot. The session drops as the server restarts. Reconnect once it comes back online.
How do I schedule a reboot in Ubuntu?
Use sudo shutdown -r with a time, such as sudo shutdown -r 22:30 for 10:30 PM, or sudo shutdown -r +10 to restart in ten minutes.
How do I cancel a scheduled reboot?
Run sudo shutdown -c. This stops any pending restart or shutdown and sends a notice to logged-in users. It has no effect once the sequence has started.
Is a force reboot safe?
Force reboot skips clean process shutdown and risks data loss. Use sudo reboot -f or sudo systemctl reboot --force only when the system stops responding to normal commands.