Setting up a Raspberry Pi Zero for headless development is straightforward once you know the right OS to install and how to connect everything. Whether you’re building IoT devices, automation tools, or using frameworks like rpi_app_framework, this guide walks you through Raspberry Pi headless development setup—from flashing the OS to running code remotely through Thonny on Windows.
1. Install Raspberry Pi Imager and Flash Raspberry Pi OS Legacy (32‑bit)
Start by installing the official Raspberry Pi Imager on your Windows laptop:
👉 Download Raspberry Pi Imager: https://www.raspberrypi.com/software/
Once installed, open the Imager and select:
Raspberry Pi OS (other) → Raspberry Pi OS Legacy (32‑bit)
Even though the description mentions “Debian Bookworm with security updates and no desktop environment”, this is the correct Lite-style, ARMv6-compatible OS for the Pi Zero.
2. Configure Headless Settings in Imager
Before writing the image, open Advanced Options (Ctrl+Shift+X) and enable:
- SSH
- Hostname (e.g.,
rpi-zero) - Username and password
- Wi‑Fi SSID, password, and country
- Locale and timezone
Click Save, then write the image to your SD card.
3. Connect the Pi Zero to Your Windows Laptop and Boot It
To power and boot the Pi Zero:
- Insert the microSD card into the Pi Zero.
- Use a micro‑USB cable to connect the Pi Zero’s PWR IN port to your Windows laptop or a USB power adapter.
- The Pi will begin booting immediately—there is no power switch.
- Wait about 60–90 seconds for the first boot to complete.
Important:
- Use the PWR IN port (not the USB OTG port) unless you are intentionally setting up USB gadget mode.
- For normal Wi‑Fi headless operation, powering through PWR IN is all you need.
Once powered, the Pi will automatically connect to your Wi‑Fi network using the credentials you set in Imager.
4. Connect to the Pi via SSH
From your Windows laptop, open PowerShell and run:
Code
ssh youruser@rpi-zero.local
If .local discovery doesn’t work, find the Pi’s IP address using your router’s device list or by scanning your network.
5. Update the System
Run the standard update commands:
Code
sudo apt update
sudo apt full-upgrade -y
sudo apt autoremove -y
It’s normal for the Pi Zero to feel slow during this step.
6. Install Python Tools
Install Python package tools and virtual environment support:
Code
sudo apt install -y python3-pip python3-venv
7. Create a Python Virtual Environment
A virtual environment keeps your project dependencies clean:
Code
python3 -m venv ~/rpiapps
source ~/rpiapps/bin/activate
8. Install rpi_app_framework
With the virtual environment active:
Code
pip install rpi_app_framework
This installs the framework and its dependencies.
9. Configure Thonny on Windows for Remote Development
On your Windows laptop:
- Open Thonny
- Go to Tools → Options → Interpreter
- Select Remote Python 3 (SSH)
- Enter your Pi’s hostname or IP
- Set the interpreter path:
System Python:
Code
/usr/bin/python3
Or your virtual environment:
Code
/home/youruser/rpiapps/bin/python
Thonny will now run code on the Pi Zero while you edit it locally on Windows.
10. Start Developing Headlessly
Your workflow is now simple:
- Write code in Thonny on Windows
- Run it remotely on the Pi Zero
- Use the Pi’s Python environment and installed packages
- Deploy long‑running apps using systemd if needed
And Finally…
This Raspberry Pi headless development setup gives you a clean, lightweight, and reliable development environment for any headless Raspberry Pi Zero project.