Home Interests Raspberry Pi

How to Set up WiFi on Your Raspberry Pi Without a Monitor (Headless)

No monitor, keyboard, or mouse? No problem.
howchoo   (436)
August 8, 2023
9 minutes


You'll Need 1

What you'll need
Howchoo is reader-supported. As an Amazon Associate, we may earn a small affiliate commission at no cost to you when you buy through our links.
Posted in these interests:
linux • 12 guides
pi • 91 guides
wifi • 2 guides

I’m one of the rare software developers that doesn’t have an extra HDMI monitor, keyboard, and ethernet connection ready to go at a moments notice. So in the past, setting up a new Raspberry Pi has been tricky. Fortunately, you can configure a WiFi connection on the Raspberry Pi without having to first connect to ethernet, a monitor, keyboard, or mouse.

1 – Put the Raspberry Pi OS SD card into your computer

If you don’t have Raspberry Pi OS installed, go ahead and install it. Make sure the SD card with Raspberry Pi OS is in your computer using an SD card slot or SD card USB adapter.

How to Install Raspberry Pi OS on Your Raspberry Pi
Get the new official Raspberry Pi OS on your Pi.

 If you're using Raspbian (an older version of Raspberry Pi OS) for some reason, thats okay too!

The SD card will mount as a drive/directory on your computer called boot. Open the drive using Finder (Mac) or Explorer (Windows).

In Finder on Mac, you can also select Go > Go to Folder from the menu bar and enter /Volumes/boot.

3 – Add your wpa_supplicant.conf file

Open a plaintext editor such as Notepad (Windows) or TextEdit (Mac) and create a new file. Add the following to the file for Raspberry Pi OSRaspbian Stretch, or Raspbian Buster:

country=US # Your 2-digit country code
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

If you’re using Raspbian Jessie or older, use this instead:


Finally, save the file. If you’re using TextEdit on Mac, you’ll need to go to Format > Make Plain Text in the menu bar before saving. Make sure the filename is exactly wpa_supplicant.conf (remove .txt if it gets added).

Connecting to unsecured networks

To connect to wireless networks with no password on your Raspberry Pi, use the following:

country=US # Your 2-digit country code
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev # Include this line for Stretch

With this file in place, Raspberry Pi OS will automatically move it in /etc/wpa_supplicant/ when the Raspberry Pi is booted.

The next step is to boot the Pi and test, but while the SD card is still in your computer I’ll mention this now. If you’re going to try to connect via SSH, you may need to enable it first. The process is similar to this one.

4 – Put your SD card in the Raspberry Pi, boot, and connect

Next, put the micro SD card into the Pi, boot it, and your Wi-Fi should be connected!

The wpa_supplicant.conf file should disappear from the SD card’s boot directory automatically—so if you don’t see it next time, that’s normal.

5 – Troubleshooting

If your Pi hasn’t connected to Wi-Fi, try these wpa_supplicant troubleshooting tips:

  1. Double-check that the file was written in plaintext, without any special characters.
  2. Double-check that the file has disappeared from your boot directory.
  3. Connect the Pi to a TV or monitor via HDMI to ensure it is booting normally.
  4. If you’re using a Raspberry Pi Zero W, make sure you’re attempting to connect to a 2.4GHz network (the Zero doesn’t support 5G).
  5. If you’re using a Raspberry Pi Zero, make sure it’s a Raspberry Pi Zero W, not a regular Zero (only the W supports Wi-Fi and Bluetooth).

If you’d like to monitor your network performance with your Raspberry Pi, check out guide on setting up a network monitor with a Raspberry Pi.


HeaterMeter: Control your Grill Using a Raspberry Pi!

Fire up the summer with a new Pi project.
howchoo   (436)
November 28, 2023

With summer right around the corner, it’s time to fire up the grill! But who will watch the grill while you’re beating the heat? This year, kick things up a notch with your own Raspberry Pi-powered HeaterMeter. Don’t just throw a BBQ, be a part of it. HeaterMeter lets you keep a close eye on

Continue Reading


 436 guides

Introducing Howchoo, an enigmatic author whose unique pen name reflects their boundless curiosity and limitless creativity. Mysterious and multifaceted, Howchoo has emerged as a captivating storyteller, leaving readers mesmerized by the uncharted realms they craft with their words. With an insatiable appetite for knowledge and a love for exploration, Howchoo's writing transcends conventional genres, blurring the lines between fantasy, science fiction, and the surreal. Their narratives are a kaleidoscope of ideas, weaving together intricate plots, unforgettable characters, and thought-provoking themes that challenge the boundaries of imagination.

Discover interesting things!

Explore Howchoo's most popular interests.