Everyone knows that setting up a Raspberry Pi to be headless is the worst right? Wrong! You can write just two files on the root of the SD card, to have it connect to your WiFi on boot.

To do this:

  1. Mount the SD card
  2. In the root directory create an empty file called ssh.
  3. In the root directory create a file called wpa_supplicant.conf and have the content be:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
network={
    ssid="yourSSIDhere"
    psk="yourpasswordhere"
    key_mgmt=WPA-PSK
}

No more finding a spare monitor or television with an HDMI input. No more getting a wireless keyboard and mouse just to setup WiFi. Now you can provision your new Raspberry Pi effortlessly and experience the headless life painfree!

I thought about not posting this, as the content is so incredibly small, but I just learned about it and it definitely saved me some time. So hopefully it saves at least one other person time.