How To Reboot A Linux Server using the command line [Beginner's Tutorial]
# tutorial# how to

How To Reboot A Linux Server using the command line [Beginner's Tutorial]

Are you trying to reboot or shutdown your Linux or CentOS server using the command line? Whether you’re making modifications to config files or are restarting the server to do some debugging, restarting a Linux from the command line should be a breeze.

There are many reasons why you might want to reboot your server, so in this blog post, I’m going to tell you how to do just that.

Ready? Let’s dive right into this tutorial…

Linux/CentOS Shutdown / Reboot Command

On Linux, the shutdown and reboot commands can be executed via the command line, there’s several commands that you can run, they include:

  • reboot
  • shutdown
  • half
  • poweroff

I’ll teach you how to use these commands to restart your server. Up until this point, you might be familiar with just turning the machine off and on again, this is okay if you have a screen/monitor.

But more often than not, you’re remotely connected to the server without a screen or fancy interface.

Sometimes you need to restart a server if you’re doing upgrades or carrying out maintenance work.

Linux "reboot" command

The easiest and safest way to reboot a Linux server is to use the reboot command. To reboot the server gracefully and do it right now, run:


This command would attempt to stop and running services, and then attempt to reboot the server.

If running that command doesn’t work, you can forcefully reboot a Linux server using:

reboot -f

Although it’s recommended to reboot gracefully first.

Linux "shutdown" command

The first of the commands is the shutdown command. It can be used to shut down the server, but can also be used to restart it.

In order to shutdown Linux, you’ll want to run:

shutdown -h now

The -h flag is used to halt the server and the now param is used to shutdown the system right away.

If you wanted to reboot the server using the shutdown command, you’d run:

shutdown -r now

If you needed to schedule a reboot within the next 5 minutes, you would run:

shutdown -r +5

And what this is doing, is essentially saying to reboot the server within the next 5 minutes. Which would notify all users logged in the server, and also prevent new users from logging in.

You could specify any duration in minutes here.

Once you run this command and wanted to cancel the scheduled restart or shutdown, simply run:

shutdown -c

Linux "halt" command

Another option at your disposal is to use the halt command. Unlike reboot and shutdown, this command will halt the server. Although, the behaviour of this command may not be consistent across several servers.



Linux "poweroff" command

Have you ever held the power button on your computer before to turn it off, well, the poweroff command is similar to the halt command, but is simply an alternative.


Why might you want to reboot a Linux server?

If you’re making changes to a server such as upgrading it or carrying out maintenance works, then you’ll likely need to reboot the server at some point.

Sometimes though, computers and servers can experience all kinds of glitches from simply being left on for long periods of time, and so a reboot could be a way of clearing out temporary files and is useful for debugging situations!


As a beginner, the shutdown and reboot commands are meant to be as simple and as effective as possible, so there shouldn’t be any troubles when trying to run these commands.

Of course though, just ensure that any changes have been saved before you restart the server. Or you’ll lose them!

More posts

Domain availability monitoring [new feature]

Are you looking to register a domain name that could soon be available to register? Our advanced domain name availability monitoring checker will automate the checking of your domain name and notify you as soon as it's available for registration, learn more today.

Read more
Domain blacklist monitoring [new feature]

Trying to improve your domain's reputation for email marketing? Is your domain's IP blacklisted? With our domain blacklist monitoring feature you'll be notified in real-time when your domain appears on one of these lists.

Read more
Our integrations marketplace [new feature]

Looking to get monitoring notifications through more than just email and web? Look no further than our all-new integrations marketplace feature. Learn more about it in this short blog article.

Read more

Subscribe to our PRO plan.

Looking to monitor your website and domains? Join our platform and start today.