Set up a headless Raspberry Pi

A headless Raspberry Pi runs without a monitor, keyboard, or mouse. To run a Raspberry Pi Raspian OS headless, you need a way to access it from another computer. To access your Raspberry Pi remotely, you’ll need to connect your Raspberry Pi to a network, and a way to access the Raspberry Pi over that network.

To connect your Raspberry Pi to a network, you can either plug your device into a wired connection via Ethernet or configure wireless networking.

Firstly after using a program such has Balena Etcher or Win2Disk Imager you will need to add 3 files to the boot partion on the sd card.

The first step is to enable ssh protocol on boot. This is a simple step. For this tutorial im using a windows 10 laptop. To enable ssh you need to Right Click on the boot partion of the sd card. Create a new blank text document, Call it ssh and remove the file extension .txt or .text. You will get a waringing about changining file extensions but just ignore it and hit OK.

Secondly, we need to set up a wpa_supplicant.conf file. Again in the boot folder, right click Create new text document, call it wpa_supplicant.conf and save. Again removing the file extension from the name. I personally use notepad++ software. Then Right click to open the new wpa_supplicant.conf file.

In this file we add our wireless network name and password. Below is an example , simply change the Country to your local country prefix, in this example mine is Great Britain “GB”, then edit your network name(ssid) and password(psk) to your own wifi login settings.

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
country=GB

network={
    ssid="change"
    psk="change"
    key_mgmt=WPA-PSK
}

Hit save again and ignore the file extension warning again.

Now we create a final file, userconf.txt

in this file we need to add a username and password. Has an example i will use the default username pi and password raspberry.

So once we have created the userconf.txt file in the boot partion, open it and copy and paste the code below, the password is encrypted.

pi:$6$c70VpvPsVNCG0YR5$l5vWWLsLko9Kj65gcQ8qvMkuOoRkEagI90qi3F/Y7rm8eNYZHW8CY6BOIKwMH7a3YYzZYL90zf304cAHLFaZE0

Hit save again. If all goes well, eject the sd card and insert it into your raspberry pi.

Boot up your PI , then you will need to find the raspeberry pi IP address on your network either by checking your router or using a mobile phone app, i persornally use Advanced IP Scanner on my windows laptop or Network Scanner app on my android phone.

Then you just need to login using your desired ssh program. On my windows laptop i use Putty.