Setting up a headless Raspberry Pi so that you can use it without a screen
This guide will teach you how to setup a Raspberry Pi so that you can configure and use it from another computer. This is helpful if you want to use your Pi for a project that does not need a screen (e.g. embedded applications), or simply want to set it up without the expense of having a separate set of keyboard / mice / screen.
Part 1: Installing the OS for your Raspberry Pi
Head over to https://www.raspberrypi.org/software/ and grab the Raspberry Pi Imager.
The above screen will greet you. Now just choose the default OS and choose your SD card and proceed to write the image to the card. Some screenshots below to guide you:
Part 2: Enable SSH (Secure Socket Shell)
This step enables SSH so that you can access your Raspberry Pi remotely.
Create an empty text file named “ssh” in your SD card’s root directory. A file without extensions named “ssh” works too. This enables SSH, which is disabled by default. It will allow you to remotely connect to your Raspberry Pi via the command line.
Part 3: Setting up a network connection for the Raspberry Pi
We now need to connect to your home network. If you are using an ethernet cable, you can skip this step. If you are using Wi-Fi, you will have to create a file “wpa_supplicant.conf” in the root folder of the SD card. It helps to enable the viewing of file name extensions so that you can edit them.
Enter the follwing in the file:
ssid="your WiFi ssid"
psk="your WiFi password"
You should change the country code to a 2 letter code representing your country. A list of codes can be found on wikipedia here.
scan_ssid should be set to 1 if your WiFi is hidden and not broadcasting its ssid.
Now you can plug in your Pi and power it up!
Part 4: Connecting to your Raspberry Pi from your PC
You will now need an SSH client in order to access your Pi. Download PuTTY from https://www.putty.org/ and install it.
The above screen will greet you as you start PuTTY. You need to enter “raspberrypi” as your host name and click “Open”. You may get a security warning, but just dismiss it by clicking “Yes”.
Now you will be at this screen above. Enter “pi” as the username and “raspberry” as the default password. We can change this later.
After logging in, you will be at the above screen. Now, let’s change our password to something else so that it is more secure. Type
sudo raspi-config and hit Enter.
The above screen will be shown. Enter into option 1.
You will now be able to change the password with option 3 as shown above. Congrats! Your Pi is now more secure.