cycool29's blog



“In a room full of top software designers, if two agree on the same thing, that’s a majority.”

Subscribe via RSS

Subscribe via Email

28 February 2022

Setting up headless Raspberry Pi

Read on Medium

Read on Dev.to

5 mins read

by cycool29


Table of Contents


You may just want to use your Raspberry Pi as a low-cost Linux computer.

However, you will need a monitor, keyboard, mouse… etc. This will be associated with a huge amount of money (that’s not low-cost anymore…). 💰

But, You may use a headless setup for your Pi to cut down all the cost. 😎

What is headless setup? 🤔

A headless setup is the Raspberry Pi minus the monitor, keyboard, and mouse. Running a headless setup lets us forego the extra peripherals and directly control the Raspberry Pi wirelessly from any other PC in local network.

In this tutorial, you need to install Raspberry Pi Imager, Angry IP Scanner and RealVNC Viewer.

RPI Imager

Angry IP Scanner

RealVNC Viewer

Install OS to your SD card ⏬

Your Raspberry Pi needs an operating system to work. If your SD card is not arrived with Raspberry Pi OS or NOOBS pre-installed, you will need to install an operating system into it first.

Insert your SD card into the SD card slot or SD card reader of your external PC.

Open Raspberry Pi Imager. You will use this tool to flash OS to your SD Card.

Raspberry Pi Imager

Click CHOOSE OS.

Choose OS

Choose any OS you want to install on your Raspberry Pi.

Choose OS

Choose OS

Click CHOOSE STORAGE.

Choose Storage

Choose the SD card you want to flash to your Raspberry Pi.

Choose Storage

Now, press Ctrl + Shift + X. This will open an Advanced options dialog.

Toggle on Enable SSH and Use password authentication.

Create a login password for your Raspberry Pi and fill it in the Set password for the ‘pi’ user . You must remember it as we will need this password later for SSH login.

If you are going to use WiFi for your Raspberry Pi’s connection, toggle on Configure wifi and configure your WiFi settings there.

Lastly, check Set locale settings. Choose your Time zone and Keyboard layout there and click Save.

Advanced options

Check all configurations are correct and click Write. This will start writing the Raspberry Pi OS to the chosen SD Card. It might take a while so you may have a coffee break.

Writing image to SD card

Verifying image is writen to SD card

  1. Now you have flashed an OS to your SD card. Safely unmount it and plug it into Raspberry Pi’s SD card slot.

Flash done

Enable VNC in your Raspberry Pi ✅

Connect your Raspberry Pi to power source.

Launch Angry IP Scanner.

Click Start to discover your Raspberry Pi.

You should see a list of IP addresses after scanning. Find raspberrypi or raspberrypi.local and note down the IP address.

Ipscan scan result

Exit Angry IP Scanner.

If you are on Windows, you will need to enable OpenSSH first.

Open a terminal window on your PC replacing <IP> with the IP address of the Raspberry Pi you’re trying to connect to.

ssh pi@<IP>

When the connection works you will see a security/authenticity warning. Type yes to continue. You will only see this warning the first time you connect.

You will be prompted for the password for the pi login, enter the password you set just now in Raspberry Pi Imager.

Now you should see something like this:

pi@raspberrypi ~ $

Now you can execute commands on your Pi. But there is no graphical desktop, yet.

Enter sudo raspi-config.

Do the following to enable VNC:

Raspi-config VNC

Now you have enabled VNC on your Raspberry Pi. Close the SSH session by entering exit or just simply close the terminal window.

Connect VNC to your Raspberry Pi 🔗

Launch RealVNC Viewer.

Select File > New connection.

Enter the IP address of your Raspberry Pi in VNC Server field and give it a name in Name field.

VNC property

Leave all other options default and click OK.

Right click at the property you just added and select Connect

VNC connecting

If it prompts you this window, simply click Continue.

VNC warning

Fill pi in the Username field and your Raspberry Pi’s password in the Password field.

VNC username password

Click OK.

Finally, you will be presented with your Raspberry Pi desktop!

VNC desktop

Thanks for reading!

BTW, today is the 10th anniversary of Raspberry Pi! Wish happy birthday to them in the comment box! 🎂

tags: raspberrypi - tutorial - beginners - linux


Share this article:

Subscribe to our newsletter

Get the highlights in your inbox when there is a new post.

Email Address:

First Name:

Last Name: