A good[ish] website

Web development blog, loads of UI and JavaScript topics

How to remotely reboot or shutdown your linux server from the command prompt

Filed under: Server— Tagged with: linux, shell, Raspberry PI

A quick post on how to restart or turn of a unix-like server.

There are 4 commands that all can restart or shutdown a machine:

  • shutdown
  • reboot
  • halt
  • poweroff

Many of them can achieve the same things, but this cacophony of commands guarantees backwards compatibility. This post uses the shutdown and reboot commands exclusively.

Reboot the machine

Log into the server, if you haven’t already:

$ ssh

Then type in:

$ reboot

If you’re not in as root, you need the sudo it:

$ sudo reboot

It takes a minute or two to boot.

Turn the machine off with shutdown

If you run shutdown without params:

$ shutdown

It will schedule the shutdown in one minute. But it can be cancelled using the -c flag:

$ shutdown -c

The now param shuts the system down immediately:

$ shutdown now

If you shutdown a cloud VPS server, you usually start it back up from the provider’s control panel. The shutdown command is more handy on computers you actually have in your house, like a Raspberry PI for example.

Comments would go here, but the commenting system isn’t ready yet, sorry.

  • © 2022 Antti Hiljá
  • About
  • All rights reserved yadda yadda.
  • I can put just about anything here, no one reads the footer anyways.
  • I love u!