RaspberryPi - Connect to WLAN via conf file / Headless Configuration

Just deploy a file called “wpa_supplicant.conf” in your boot partition - can even be done in Windows since the “/boot” partition is the only partition recognized by Windows natively - with the following bash code

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=DE
 
network={
    ssid="[REPLACE_YOUR_SSID]"
    psk="[REPLACE_YOUR_WLAN_PASSWORD]"
    key_mgmt=WPA-PSK
}