Skip to main content

Going headless with the Raspberry Pi

·444 words·3 mins
tech debian linux raspberry-pi raspbian ssh technology wireless
James Pettigrove
James Pettigrove
Cloud Engineer with a focus on Microsoft Azure
Table of Contents

At some point last year I decided to expand my love of Pi from the A+ unit I have played with over the last couple of years to a shiny Zero (which has since been replaced with the Zero W which includes Wireless and Bluetooth) and the Unicorn pHAT from the pirates at Pimoroni.

Sadly it has sat and gathered dust while my A+ continues to be my Pi server of choice. After updating the firmware and apps during the week it was no longer as stable as I desired. This gave me the necessary push to migrate to the Zero, and with that, setting up a Pi in headless configuration.

Now this isn’t all that difficult when the Pi is plugged into a monitor over HDMI but what if you don’t have a spare monitor + keyboard/mouse?

Get Raspbian

Head on over to Raspian section on the Raspberry Pi Foundation’s website and grab the latest copy of Raspbian LITE (no use having the PIXEL/Desktop version if we are going headless).

Apply Raspbian to the SD Card

Download a image writer such as Win32DiskImager (for fellow Windows users) and apply the Raspbian LITE .IMG file to the SD Card.

Configure for headless operation

To improve security, the Raspberry Pi foundation have disabled SSH access by default in the Raspbian images. Weird as hell decision for the LITE image (although I could understand for the PIXEL image) but alas, it is easy to remedy.

Use a text editor and create a file named “ssh” on the Boot partition of the SD Card (which should now be visible after successfully applying the image in the previous step).

If you are running of WiFi, create another file in the same location named “wpa_supplicant.conf” and enter the below as the contents:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev

Replace the x’s with your country code from here, wireless network name and password respectively.

Plug and play

Pop the SD Card into your Raspberry Pi, plug in your power, check your routers DHCP logs for the latest client to connect to your WiFi and point your favourite SSH client to pi@ipaddressofpi

Once you are in I suggest running the following:


which is the built in configuration utility for Raspbian and running the update option, change the hostname, password and memory split down to 16mb for the GPU. Don’t forget to update the operating system via

sudo apt-get update && sudo apt-get upgrade

Last but not least, get rid of passwords altogether and setup certificate based authentication.

Now you have no excuse for those Pi’s gathering dust. Get them on, connected and computing!


Predictable failure - Tweeting with Python Part 2
·320 words·2 mins
tech debian iot linux python raspberry-pi raspbian technology twitter twython
Part 1 of the series saw us signing up to Twitter and getting access to the API to send tweets, setting up Twython and developing out shutdown script.
Predictable failure - Tweeting with Python Part 1
·867 words·5 mins
tech bitcoin cryptocurrency debian iot linux python raspberry-pi raspbian technology twitter twython
As explained in a previous series of mine, I run a small Bitcoin mining operation on my Raspberry Pi.
Mining Bitcoins with Raspberry Pi - Part 3
·405 words·2 mins
tech bitcoin cgminer cryptocurrency debian iot linux raspberry-pi raspbian technology
Continuing on from the good work we have achieved thus far in Part 1 & Part 2, we are going to complete our Bitcoin Mining journey by making our Raspberry Pi start mining as soon as it is powered on.