Skip to content
Oasis-Knowledge
Pi Zero Boards

Raspberry Pi Zero Setup Guide (Advanced)

Setting up a Raspberry Pi Zero for a purely headless installation of Raspberry Pi OS Lite involves configuring the microSD card with network settings and enabling SSH before inserting it into the Raspberry Pi. This allows you to connect to the Raspberry Pi over your network without needing a monitor or keyboard.

This is an advanced tutorial. Depending on your local machine and network settings, and you may need to troubleshoot some of the steps for everything to work properly. Your mileage may vary with this one.

Materials Needed:

- Raspberry Pi Zero W or Zero 2 W (for built-in Wi-Fi)
- MicroSD card (at least 8GB recommended)
- MicroSD card reader
- Home PC with internet access
- Balena Etcher or Raspberry Pi Imager

Steps:


1. Download Raspberry Pi OS Lite

Visit the [Raspberry Pi website](https://www.raspberrypi.org/software/operating-systems/) and download the Raspberry Pi OS Lite image.

2. Prepare the MicroSD Card

Insert the microSD card into your PC using a card reader.
Download and install either [Balena Etcher](https://www.balena.io/etcher/) or the [Raspberry Pi Imager](https://www.raspberrypi.org/software/).

Using Balena Etcher:
Open Balena Etcher.
Click "Flash from file" and select the downloaded Raspberry Pi OS Lite image.
Select the microSD card as the target.
Click "Flash" to write the image to the card.

Using Raspberry Pi Imager:
Open Raspberry Pi Imager.
Click "Choose OS" and select "Raspberry Pi OS (other)" > "Raspberry Pi OS Lite (32-bit)".
Click "Choose Storage" and select your microSD card.
- Click "Write" to flash the OS onto the card.

3. Enable SSH

After flashing, open the boot partition of the microSD card on your PC.
Create a new empty file named `ssh` (no file extension) in the root directory of the boot partition. This enables SSH access on boot.

4. Configure Wi-Fi

In the boot partition, create a file named `wpa_supplicant.conf` with the following content:
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="Your_SSID"
psk="Your_Password"
key_mgmt=WPA-PSK
}
Replace `Your_SSID` and `Your_Password` with your Wi-Fi network's SSID and password. Ensure the country code matches your location (e.g., `US` for the United States).

5. Router Configuration

Ensure your router is set to allow new devices to connect and that it assigns IP addresses via DHCP.
Optionally, reserve a static IP address for your Raspberry Pi based on its MAC address for easier access.

6. Boot the Raspberry Pi

Insert the microSD card into the Raspberry Pi Zero.
Power the Raspberry Pi using a micro USB power supply.

7. Find the Raspberry Pi on Your Network

Use your router's admin interface to find the IP address assigned to the Raspberry Pi. Look for a device named `raspberrypi` or check the list of connected devices.

8. Connect via SSH

Open a terminal or SSH client on your PC.
Connect to the Raspberry Pi using its IP address:
run: ssh pi@<Raspberry_Pi_IP_Address>
Replace `<Raspberry_Pi_IP_Address>` with the actual IP address of your Raspberry Pi.
The default username is `pi` and the password is `raspberry`.

9. Final Configuration

Once logged in, change the default password using the `passwd` command.
Run `sudo raspi-config` to configure additional settings like localization, hostname, and more.
This setup allows you to deploy your Raspberry Pi Zero in a headless configuration, managed entirely over SSH, without needing a monitor or keyboard. This is particularly useful for remote projects or when physical access to peripherals is limited.
Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.