Configure WiFi for Raspberry Pi Zero without keyboard and monitor

Mount the main partition of memory card on your computer.

$ sudo mount /dev/sdb2 /mnt

Now you need to edit wpa_supplicant.conf to include your wifi information.

$ vim /mnt/etc/wpa_supplicant/wpa_supplicant.conf
country=GB
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

# Add this block
network={
    ssid="ENTER-SSID-HERE"
    psk="ENTER-PASSWORD-HERE"
}

via raspberrypi.org