How to Properly Turn on and Shutdown the Raspberry Pi

This quick tip teaches you how to turn on Raspberry Pi and how to shut it down properly afterward.
Warp Terminal

I still remember when I got my first Raspberry Pi Zero W. I was so excited to dive into the world of DIY computing that I never thought about shutting it down properly.

I would just flip the power switch, only to realize later that this often led to corrupted SD cards, wasted hours of reinstallation, and frustrating data losses.

If you’re a Raspberry Pi user, this scenario may sound familiar, especially if you’re new to the platform. Learning the proper ways to power down a Pi can save you from these headaches and ensure your projects stay intact.

Shutting down Raspberry Pi

Let’s dive into the various ways to safely shutdown the Raspberry Pi. You'll also learn a thing or two about powering on your Pi.

Method 1: Shutting down Raspberry Pi via desktop GUI

If your Raspberry Pi setup includes a graphical user interface (GUI), such as the Raspberry Pi OS with Desktop, shutting down safely is simple:

  1. Close open applications: Always start by closing any running applications to prevent accidental data loss.
  2. Click the Power menu: In the top-right corner, click the Raspberry Pi icon, then choose “Shutdown” from the options.
  3. Wait for Shutdown to complete: You’ll know the process is done once the green activity LED stops flashing. Only then is it safe to unplug the power.
Raspberry Pi shutdown menu GUI

This method is quick, intuitive, and prevents data corruption. Just remember to be patient and wait for the activity light to stop blinking!

Method 2: Using the command line to shut down Raspberry Pi

💡
This method will also work when you are accessing the Pi via SSH.

For those who work with the command line or prefer a headless setup (no GUI), the Terminal is an efficient way to safely shut down:

To Shut Down: Open the Terminal and type:

sudo shutdown now
Raspberry Pi terminal shutdown

For a Reboot type:

sudo reboot now
Raspberry Pi terminal reboot

These commands make sure the Raspberry Pi completes all data operations before shutting down. This is especially handy for users who access their Pi remotely over SSH.

Turning on a Raspberry Pi

If you have never used Raspberry Pi like devices, you would probably search for the power button to turn on the Raspberry Pi. Unfortunately, that’s not always the case here.

💡
Only Raspberry Pi model 5 has a dedicated power button, which allows you to power down the system externally, as well as turn it on. Simply press and hold the power button for a few seconds to initiate a safe shutdown.

Sometimes, physical access makes shutdown quicker, especially if you’ve set up your Pi for embedded projects.

First, check if you have Raspberry Pi 4 or 5. If you have Pi 5, you already have a power button. For other devices, please read the instructions below.

The micro USB port powers the Raspberry Pi and the way you turn it on is by plugging in the power cable into the micro USB port.

Raspberry Pi 3 Microusb
Micro USB port for Power

Of course, you should have an operating system on the device otherwise there is no point in turning it on.

Plug in the power cable. This turns on the Raspberry Pi and the display will light up and load the Operating System. You should see a green light blinking periodically.

📋
If you turned it off and you want to turn it on again, you’ll have to unplug the power cord either from the power socket (preferred) or from the power port of the board as there is no power button.
Micro USB ports tend to be fragile, hence turn-off/on the power at source instead of frequently unplugging and plugging into the micro USB port.

Adding an external power button to your Pi 4 (if you really need to)

Sometimes, physical access makes shutdown quicker, especially if you’ve set up your Pi for embedded projects.

Adding a shutdown button to the GPIO (General Purpose Input/Output) pins can make the process much easier.

A diy powerbutton over Raspberry Pi 3, project by Hackaday
Image Credit: Hackaday
  1. Connect a momentary push button: Wire a momentary push button to the GPIO pin (e.g., GPIO 3 or 27) and ground. You'll have to purchase such a button.
  2. Set up the button in code: Use a Python script to monitor the button’s state. When pressed for a certain duration, the script initiates a safe shutdown.

You can follow this tutorial for detailed steps and the code.

Using Power over Ethernet (PoE) to remotely power your Pi

If you have a set-up that makes it difficult or inconvenient to reach the Pi device, you can take advantage of power over Ethernet. This way, you can power the device on remotely.

You'll need to ensure that your router has Ethernet ports that can supply power. Most routers don't have this feature. You can purchase a PoE injector (Amazon affiliate link) if your router doesn't support it.

Alternatively, if your router has 802.3af, even if it doesn't support PoE natively, an adapter such as this could help you out.

PoE Splitter with MicroUSB Plug 5V/2A for Raspberry Pi 4/3B+/3B
Power over Ethernet (PoE) splitters can make your project wiring a breeze - and best of all they work to connect any 802.3af-capable router to any Ethernet device, even if it doesn’t natively support PoE! 

Bonus: Handling power loss situations

To avoid losing data due to power loss, you can add a mini UPS to your Pi device.

SunFounder Raspberry Pi 4 UPS Power Supply Compatible with Raspberry Pi 4B/3B+/3B/Zero 2 W/Arduino/ESP32/Pico W
Superior Power Management Delivers a robust 5V/3A output, ideal for Raspberry Pi 4, ensuring stable and reliable power under high loads. Features an acrylic protective case and advanced battery protection, including overcharge, over-discharge, and overheating safeguards. Intelligent Monitoring and Control PiPower 3’s 3

Final Thoughts

As tempting as it might be to just pull the plug, safely shutting down your Raspberry Pi will spare you the hassle of corrupted SD cards and lost data.

Whether it’s through the GUI, command line, SSH, or a custom button, these methods make shutting down as effortless as possible.

After my experience with corrupted cards on my first Raspberry Pi Zero, I made a habit of using the shutdown command every time.

So take it from me: a few extra seconds of shutdown time is well worth the protection it offers for your projects.

About the author
Chinmay

Chinmay

I'm a Maker, love to tinker with electronics. PCMR fanatic and I occasionally make YouTube videos about tech. Philosophy and Psychology are my interests on the other side of the isle.

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world

itsfoss happy penguin

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.