Imagine having a Raspberry Pi, a tiny computer that fits in your palm, running smoothly without the need for a monitor, keyboard, or mouse. This is what we call running a headless Raspberry Pi: a setup where the Pi operates without a traditional display and input devices. It might sound a bit techy, but it's simpler than you think.
In this article, we'll walk through the basics of running your Raspberry Pi headlessly, unlocking its potential without the clutter of additional peripherals.
Aside
I recently got a Raspberry Pi from a friend and many things have been flooding my mind on what to use it for:
- Perhaps If I add another Raspberry Pi I could run a Kubernetes Cluster
- Practice my Linux skills
- Use it for some home automation ideas in the future.
Even though I have Ubuntu Linux running on my Windows machine, I still need the feel of a standalone Linux machine and my tiny raspberry pi cuts it for me.
Anyway, let's get to it.
These are the list of things I will be working with:
- Raspberry Pi 3 Model B
- SD card
- A private Wifi network
- Raspberry Pi Imager
- RealVNC viewer
- Putty
Note:
I recommend you install the recommended software on your machine before we start.
Overview
In summary, we are going to perform 9 steps:
- Insert Or connect our SD card to our computer
- Format the SD card
- Selecting the Device and operating system in the Raspberry Pi Imager
- Configure settings for our Raspberry Pi Os
- Download Raspberry PI OS to our SD card
- Insert Our Sd card into the Raspberry PI
- Connect the Raspberry Pi to a power source
- Remotely SSH into the Raspberry PI over a Wi-Fi network
- Use RealVNC viewer to Remotely access the Raspberry PI over a Wi-Fi network
About Raspberry PI
According to Wikipedia, Raspberry Pi is a series of small single-board computers (SBCs) developed in the United Kingdom by the Raspberry Pi Foundation in association with Broadcom.
In summary, they say that a Raspberry Pi is a small computer that has all the Storage and memory (RAM) on a single and small board.
As earlier stated, I will be using a Raspberry Pi 3 model B with 1 gigabyte of Random Access Memory(RAM) and 8 gigabytes SD card for storage
First connect your SD card to your computer, if your machine has an SD card slot like mine then you may just slide it in else you should get an SD card adapter.
Launch the Raspberry Pi Imager and you’ll get to see the below screen:
Next, you will get to choose your Raspberry Pi device, go ahead and choose your device
In my case, I selected Raspberry Pi 3 as my option. You can see that it has all the submodels under it.
Go ahead and choose the Operating system(OS)
Next, click on Choose Storage and select your SD card as the storage
You may now click on the Next button.
At the click of the Next button, you’ll be prompted with the OS Customisation menu as below:
Under the OS customization menu are 3 tabs
- General
- Services
- Options
First, the General tab provides a way to set our hostname for the Raspberry Pi and set username and password. Under Configure wireless LAN, Add your Wifi network name and password. Also choose your country under Wireless LAN country, in my case, I selected NG which is the symbol for Nigeria.
Next, under Set locale settings, choose your timezone and keyboard layout.
Move to the services tab:
Under the services tab, enable SSH(Secure Shell). This is very important as it will allow us to communicate with this device over the Wifi network through the terminal. Also, choose password authentication.
Done with the services tab, move to the Options tab:
Just as the name suggests, The Options tab is optional, but for me, I need my machine to play sound when it is finished downloading the OS. I also need it to automatically eject the SD card when completed and also enable telemetry which provides OS downloads data to Raspberry.
When done, click on the Save button and you will be presented with the confirmation screen below:
Click Yes.
You’ll then be prompted to confirm if you want to do this:
Since you are sure of what you are doing, click Yes.
If everything goes well, you should see the below output:
If you are getting the “Please insert a disk into ..” error like the below output
This little SD formatter tool should fix the issue.
After some time, the download will start:
If you chose the Eject media option, your SD card will be automatically ejected when installation is completed. If you did not, you will have to eject it yourself manually.
Next, we will run the Raspberry OS on our Raspberry PI.
Getting Raspberry Pi Running
Insert the SD card card into your Raspberry PI and plug in the power cable.
After some seconds your Raspberry PI should be up and running.
We need to find a way to communicate with this device.
Remember we had a wifi network as one of the things you’ll need in this tutorial?
Get your Raspberry Pi and your machine on the same Wifi network you configured in Os customization for the Raspberry Pi.
After you have them both connected to the same network, under
This is the time that we bring in one Putty. Putty is an SSH client that will let us communicate with our Raspberry Pi on the Wifi network using its IP address.
Open your Wifi router menu and copy the IP address of the Raspberry Pi on the network. Open Putty and paste the IP address like so:
Click on open.
You will be prompted to enter your username and password. If the login is successful, you should see a screen similar to below
Hurray, we are in.
We can use our tiny computer from here(command line) or even take it further and get a graphical user interface(GUI) from it.
To achieve this we need Virtual Network Computing(VNC) software. VNC is a remote access technology that enables computers to access and take control of another computer.
In this tutorial, we will be using a type of VNC called RealVNC viewer.
RealVNC comes in 2 parts: RealVNC viewer that we have installed on our machine and RealVNC Server that talks to us from the computer we want to access.
We have to get into our tiny machine and enable the RealVNC Server.
In the Putty terminal run the command below:
sudo raspi-config
On running the above command, you’ll be shown the screen below
What is of particular interest to us is the Interface Options. Navigate to the Interface Options using the arrow down key and press enter when you are there.
This gets you to the screen below:
Use the down arrow key to scroll to VNC and hit enter
Use the left and right arrow keys to toggle between Yes and No. Toggle it to Yes and press the enter key.
It shows that the RealVNC server is enabled by showing the following output
Click on enter and use the right arrow key to navigate to finish. Then press enter.
RealVNC Server is now ready to talk to our machine.
Accessing Raspberry Pi through RealVNC viewer(Desktop)
Open RealVNC viewer, click on the file tab then “new connection”.
The below output is what you should see next.
Copy and paste the Raspberry Pi IP address to the “VNC Server” then click OK.
Right-click on the monitor icon and click connect
It will ask for your RealVNC username and password, supply it and
Click Ok
You may play around with it, ensure you shut it down before you unplug the power cable.
Accessing Raspberry Pi through RVNC viewer(Mobile)
It is also possible to remotely access the Raspberry Pi with your smartphone.
To achieve this, search and install RVNC viewer on Google Play Store for Android or App Store for iOS.
Click on the + button
Next, input your Raspberry Pi IP address and click Create.
You will be presented with the below screen
Click on “Connect”
Add your username and password and click “Continue”
Behold your Raspberry PI on mobile
Conclusion
Running a headless Raspberry Pi offers an efficient way to use this versatile mini-computer. By eliminating the need for monitor and input devices, you not only save space but also open up possibilities for various projects and applications.
Top comments (0)