Restart a Linux Server from the Command Line

Traducciones al Español
Estamos traduciendo nuestros guías y tutoriales al Español. Es posible que usted esté viendo una traducción generada automáticamente. Estamos trabajando con traductores profesionales para verificar las traducciones de nuestro sitio web. Este proyecto es un trabajo en curso.
Create a Linode account to try this guide with a $100 credit.
This credit will be applied to any valid services used during your first 60 days.

While your Linux server can run continuously for weeks or months, some configuration tasks may require a manual system reboot. This guide shows you how to restart a Linux server over SSH, using PuTTY, or on your server’s console interface.

When Do I Need to Restart a Linux Server?

Generally, you do not need to regularly restart your Linux server. It should be able to keep running for weeks or months, without needing to be “refreshed” with a reboot.

However, several factors may make you want to restart your server. Some software installations require a manual reboot after installation, and some applications benefit from the system being periodically rebooted. There are also many administrative processes that require restarting the server for changes to take effect.

For those cases and others, it is helpful to know the available commands to quickly initiate a graceful system reboot.

How Do I Restart a Linux Server from the Command Line?

In this section, you learn how to reboot your Linux server using the command line. These commands work whether you are connected directly to your server’s console or are connecting to it over SSH.

How to Restart a Linux Server with the reboot Command

The most straightforward way to restart your Linux server is with the reboot command.

sudo reboot

This command starts a graceful shutdown, letting processes exit, temporary files are removed, and other system clean up tasks.

If you need to force a reboot, you can do so with the --force option. However, this should only be used when no other option is available. This option forces a reboot without allowing the usual clean up tasks, which can lead to loss and/or corruption of data.

How to Schedule a Restart on a Linux Server with the shutdown Command

The reboot command accomplishes the same system state as the shutdown command with the -r option and a schedule of now. The complete command is as follows:

sudo shutdown -r now

You can safely use the above command and alter the time (now) to schedule when your Linux server restarts. For the time option, the shutdown command accepts either several minutes or a local time in 24-hour format. The command below, for example, schedules the server to reboot in 15 minutes.

sudo shutdown -r 15

The server then sends out a warning message to all logged-in users.

Broadcast message from root@localhost on pts/0 (Wed 2021-06-30 12:00:00 UTC):

The system is going down for reboot at Wed 2021-06-30 12:15:00 UTC!

You can even send a custom message. In the example below, the server is scheduled to restart at 3:30 PM (local time), and a custom message is provided.

sudo shutdown -r 15:30 "Please wrap up your current tasks and save your work."
Broadcast message from root@localhost on pts/0 (Wed 2021-06-30 19:15:00 UTC):

Please wrap up your current tasks and save your work.
The system is going down for reboot at Wed 2021-06-30 19:30:00 UTC!
Note
While the time you give in the shutdown command is local time, it gets broadcast to users in UTC.

Finally, you may want to cancel a scheduled reboot. You can do that with the following command:

sudo shutdown -c

How Do I Restart a Linux Server over PuTTY?

The process for restarting your Linux server over PuTTY is the same as above. The only difference is that you need to use PuTTY to open an SSH connection to your server.

If you are unsure how to do that, take a look at our guide on Connecting to a Remote Server Over SSH using PuTTY.

This page was originally published on


Your Feedback Is Important

Let us know if this guide made it easy to get the answer you needed.


Join the conversation.
Read other comments or post your own below. Comments must be respectful, constructive, and relevant to the topic of the guide. Do not post external links or advertisements. Before posting, consider if your comment would be better addressed by contacting our Support team or asking on our Community Site.