Don't Pull the Plug: How to Safely Shut Down or Reboot Your Raspberry Pi

Zach Zach (249)
3 minutes

Like any computer, simply pulling the plug on your Pi can have dire consequences; but unlike most computers, the Raspberry Pi does not have a native power button. The following commands should be used to safely shut down or reboot your Pi. Obviously, these commands should be run from the command line. Note: You must have sudo privileges to run sudo commands. The default raspberry pi user has such privileges so this shouldn't be an issue unless you've drastically altered your Pi's user configuration.

Raspberry PiRaspberry Pi ×1

Howchoo is reader-supported. As an Amazon Associate, we may earn a small affiliate commission at no cost to you when you buy through our links.

sudo halt

This is shorthand for the following:

sudo shutdown -h now

An explanation:

sudo - run the command as superuser
shutdown - shut down the pi
-h - halt after shutting down (do not reboot)
now - do this now (required time command)
sudo reboot

This is shorthand for the following:

sudo shutdown -r now

An explanation:

sudo - run the command as superuser
shutdown - shut down the pi
-r - reboot the pi after shutting down
now - do this now (required time command)

You can also safely shut down the Pi by adding a Pi power button!

We’re wrapping up 2021 with a list of Pi goodies that were worth the wait!
Ash Ash (354)
0

Nothing can slow down the Raspberry Pi Foundation, as even in 2021, the team managed to serve up a selection of new Raspberry Pi boards, modules, and fun accessories.