Headless Raspbian setup

Installing Raspbian is a bit a pain in the *beep* since the developers decided to deactivate SSH. Even more time consuming is configuring wifi in a headless setup, because you want it to work right from the first boot especially if you bought a Pi Zero.

There are just a few steps to get your Pi Zero up and running but you need to search all the information in different places.

  1. Download the actual Raspbian from download section raspberry.org
  2. Write the image to the SD card / MicroSD card with a tool like Win32DiskImager on Windows or with dd tool you can find on any *nix distribution of your choice
  3. After writing the image, create a file which is named ssh to activate ssh on boot. Windows users please check for extensions not visible. SSH will not work after boot if the file was named ssh.txt
  4. Create a file named wpa_supplicant.conf if you want to connect to a wifi network. Please note, that this file needs the extension „.conf“. If you forget the extension the wifi setup will not be done on first boot. This file should contain the following content:
  5. country=CH
    ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
    update_config=1
    network={
        ssid="your ssid"
        psk="your password with all the funny ascii characters possible like e.g. #,$,!,?"
        proto=WPA2
        key_mgmt=WPA-PSK
    }
  6. Insert SD card into your Pi, connect it to power and boot it for the first time. You should now be able to connect to your Raspberry through SSH.