The following article describes the most straightforward way to setup and connect a Raspberry Pi Zero W to your WPA2 Wi-Fi network.
Download and unpack the image:
wget -O raspbian-stretch-lite.zip https://downloads.raspberrypi.org/raspbian_lite_latest unzip raspbian-stretch-lite.zip
Mount the image to the local filesystem:
Configure Wi-Fi interface
Automatically setup wlan0 for DHCP:
source-directory /etc/network/interfaces.d + +auto wlan0 +allow-hotplug wlan0 +iface wlan0 inet dhcp + wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
Create and open file wpa_supplicant.conf:
Configure wpa_supplicant according to your Wi-Fi network:
Unmount image partitions and clean up:
Install image to MicroSD card
Insert the MicroSD card into your host computer and check the systemd journal for the appropriate device node:
Use dd to write the image to the card:
Be careful when running the following command! The output file (of) has to be the MicroSD card's device node!
Now put the MicroSD card into your Raspberry Pi and attach the power supply. Give the device some time to boot up.