I recently was working on getting the Raspberry Pi Zero W set up, a tiny computer with a wifi chipset built-in. I run these headless, so I need to manually configure these to be available via SSH right out of the box. This will be a short overview of what I did, as it took way too long and I plan on setting up many of these over the coming years.

setup

flashing raspbian lite

The first step is to download the Raspbian OS Lite image from the Raspbian website. Unzip that and keep the .img file accessible. You can use dd or a tool like Balena Etcher for OSX systems to flash the image to your formatted SD card.

boot up the pi

Boot up the Pi using the PWR micro usb port, and give it a few minutes to initialize for the first time.

configuring the os

After the pi boots up, power it off and stick the SD card into your computer once more. Once the SD card is mounted, we’ll make a few modifications to add WiFi credentials and enable SSH access.

In my circlefiles repo, I have a python script that uses the python invoke library to make it easy to run tasks against your machine.

# run rasp pi zero setup to configure wifi and enable ssh
$ inv rasp-pi-zero-setup

Once those steps are complete, the SD card can be ejected and added back to the Pi. The Pi Zero is now ready to boot and should be able to connect to your wifi without issue. Give it a few minutes to fully boot up, and then you can find the ip on your router device list and connect.

# default user is pi and password is raspberry
$ ssh pi@<fake_ip>

looking ahead

These are some simple instructions that outline configuring a Pi Zero with little to no extras added. I plan on adding ansible playbooks to setup docker and various other utilities sometime in the near future.