Yes, the Raspberry Pi does not come with a power button to either shut down or reboot the board. You need to use the Terminal or the Desktop GUI to apply the changes. But the best part is that you can remotely connect to Raspberry Pi and SSH your way into the Terminal. From there, you can shut down or reboot the Raspberry Pi with ease. You can even choose to use your Windows laptop as a monitor for Raspberry Pi to execute these operations. So to learn about the steps to shut down the Raspberry Pi in detail, let’s head over to the tutorial.
Shut Down or Reboot Raspberry Pi
We have explained multiple ways to shut down or reboot a Raspberry Pi in this article. You can either use the Desktop GUI, Terminal, or even add a physical power button to the RPi board. With that said, let’s dive in and take a look at these methods:
How to Shut Down Raspberry Pi
Method 1: Desktop GUI
If you are using Raspberry Pi through the Desktop GUI (say Raspbian OS), shutting down the board is as simple as it can get.
1. Simply click on the Raspberry menu on the top-left corner and click on “Logout“.
2. Next, click on the “Shutdown” button in the pop-up window, and that’s pretty much it. Your Raspberry Pi will shut down immediately.
Method 2: Using Terminal Commands
If you like to use the Terminal on the Raspberry Pi through SSH or wired connection, you have several ways to shut down the Raspberry Pi.
1. To begin with, open the Terminal and run any one of the below commands. They will instantly shut down your RPi.
sudo poweroff
or
sudo shutdown -h now
2. In case you want to shut down your Raspberry Pi after a certain period of time, you can define your argument like this. Here, 30
means that your Raspberry Pi will shut down after 30 minutes. Moreover, you can use the shutdown -c
command to cancel the scheduled shutdown operation.
sudo shutdown -h 30
3. For shutting down the Raspberry Pi at a particular time, say at 9:00 PM, you can define the command as under. Remember that the Terminal follows the 24-hour clock system.
sudo shutdown -h 21:00
Method 3: Add a Power Button to Raspberry Pi
If you are an advanced user, you can go ahead and add a physical power button through the GPIO pins on the Raspberry Pi board. You also need to configure the GPIO headers through the Terminal. For a detailed tutorial, head over to this page. Apart from that, if you want a simpler solution, buy a USB Type-C Power Switch cable from Amazon ($7.99) to turn off/ on your Raspberry Pi without any hassles.
Method 4: Pull the Plug
Lastly, if you are too lazy to go through the Terminal or desktop GUI, you can simply disconnect the power cable to shut down your Raspberry Pi. This will turn off the Raspberry Pi instantly, but we advice you to use any of the other methods described above. That said, make sure you save all your work if you prefer to pull the plug.
How to Reboot Raspberry Pi
Method 1: Desktop GUI
Similar to the shutdown process, you can reboot your Raspberry Pi from the Desktop GUI environment. The steps are also the same.
1. Open the Raspberry menu from the top-left corner and click on “Logout“.
2. Here, click on “Reboot” in the pop-up window, and the Raspberry Pi will restart right away.
Method 2: Using Terminal Commands
1. To restart Raspberry Pi instantly, fire up the Terminal and run either of the below commands. These commands work via a wired or SSH connection, so you can reboot a Raspberry Pi board remotely as well.
sudo reboot
or
sudo shutdown -r now
Power Off or Restart Your Raspberry Pi in a Few Easy Steps!
So that is how you can shut down your Raspberry Pi or restart it using the Desktop GUI or Terminal. And if you are good with hardware, adding a power switch through the GPIO header pins on the board could be a good idea. Anyway, that is all from us. To learn more about the best Raspberry Pi commands, follow our linked article. And if you have any questions, comment down below and let us know.