How to connect headless Raspberry pi to Wifi?

Photo by Stefan Cosma on Unsplash

I am only putting this out on the medium.com because I had hard time googling the proper way to do it.

I am using 2021–05–07-raspios-buster-armhf-lite.img.

Testing on Raspberry Pi 3 Model B Rev 1.2.

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=<country_code_here>

network={
ssid=”ssid”
psk=”password"
key_mgmt=WPA-PSK
}

Save this file as plain text, and drop it onto “boot” partition of SD card you have prepared for your Raspberry Pi.

That’s it.