How to Shutdown or Restart Raspberry Pi

Yes, the Raspberry Pi does not come with a power button to power off or restart the board. You must use the Terminal or Desktop GUI to apply the changes. But the best part is that you can remotely connect to Raspberry Pi and SSH while entering Terminal. From there you can shut down or restart the Raspberry Pi with ease. You can even choose to use your Windows laptop as a monitor for the Raspberry Pi to perform these operations. Let’s go to the tutorial to learn the steps to turn off Raspberry Pi in detail.

Shutdown or Restart Raspberry Pi (2021)

We have explained many ways to shut down or restart a Raspberry Pi in this article. You can use the desktop GUI, Terminal or even add a physical power button to the RPi card. That said, let’s dive in and take a look at these methods:

How to Shutdown Raspberry Pi

Method 1: Desktop GUI

If you’re using the Raspberry Pi via the Desktop GUI (let’s say Raspbian OS), turning the board off is as simple as it gets.

1. Click on the Raspberry menu in the upper left corner and select “Sign out“.

2. Then, “CloseThe ” button is in the popup and that’s it. Your Raspberry Pi will shut down immediately.

Shutdown or Restart Raspberry Pi (2021)

Method 2: Using Terminal Commands

If you like to use Terminal on Raspberry Pi via SSH or wired connection, there are several ways to shut down Raspberry Pi.

1. To get started, open Terminal and run any of the following commands. They will instantly shut down your RPi.

sudo poweroff

or

sudo shutdown -h now

Shutdown or Restart Raspberry Pi (2021)

2. In case you want to turn off your Raspberry Pi after a certain time, you can define your argument like this. Here, 30 It means your Raspberry Pi will shut down after 30 minutes. Also, you can use shutdown -c command to cancel scheduled shutdown.

In relation :  Connecting Raspberry Pi to Windows Laptop Without Monitor or Ethernet Cable

sudo shutdown -h 30

terminal

3. To turn off the Raspberry Pi at a certain time, let’s say at 21:00, you can define the command as follows. Note that the terminal follows the 24-hour system.

sudo shutdown -h 21:00

Shutdown or Restart Raspberry Pi (2021)

Method 3: Adding Power Button to Raspberry Pi

If you are an advanced user, you can go ahead and Physical power button via GPIO pins On the Raspberry Pi board. You also need to configure the GPIO headers via Terminal. For a detailed tutorial go to this page. Other than that, if you want a simpler solution, buy a USB Type-C Power Switch cable from Amazon ($7.99) to smoothly turn off/on your Raspberry Pi.

Raspberry Pi 4 power switch

Method 4: Unplug

Finally, if you’re too lazy to go through Terminal or desktop GUI, unplug the power cord To turn off your Raspberry Pi. This will shut down the Raspberry Pi instantly, but we recommend using any of the other methods described above. However, if you choose to pull the plug, be sure to save all your work.

How to Reboot Raspberry Pi

Method 1: Desktop GUI

Similar to the shutdown process, you can restart your Raspberry Pi from the Desktop GUI environment. The steps are the same.

one. raspberry menu Click in the upper left corner and click “Sign out“.

Shutdown or Restart Raspberry Pi (2021)

2. Here, “restart” pops up and the Raspberry Pi will reboot immediately.

restart the rpi

Method 2: Using Terminal Commands

1. To reboot Raspberry Pi instantly, fire up terminal and run one of the commands below. These commands work over a wired or SSH connection, so you can also reboot a Raspberry Pi board remotely.

sudo reboot

or

sudo shutdown -r now

sudo reboot

Shut Down or Restart Your Raspberry Pi in Few Easy Steps!

So you can shut down your Raspberry Pi or restart it using Desktop GUI or Terminal. If you’re good with hardware it might be a good idea to add a power switch from the GPIO header pins on the board. Anyway, that’s it for us. Follow our linked article to learn more about the best Raspberry Pi commands. And if you have any questions, comment below and let us know.

Moyens I/O Staff has motivated you, giving you tips on technology, personal development, lifestyle and strategies that will help you.