wpa_supplicant.conf for Raspberry Pi

Written by Adi on Jan 28, 2025
Category: 

This code works. I've tested it with a Raspberry Pi Zero 2 W.

  1. Create a new text file, copy the code from below, paste it, and replace the following:
  2. country= with your country Alpha'a code (e.g., US, IN, list here).
  3. ssid="your WiFi name" (remove any spaces).
  4. psk="your WiFi password" (remove any spaces).
  5. Save the file, rename it to wpa_supplicant.conf, and move it to the root of your freshly installed Pi.

That's it!

country=IN
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
ssid="yourWifiName"
psk="yourWifiPassword"
key_mgmt=WPA-PSK
}