In this tutorial, we will learn how to headless setup raspberry Pi without using Keyboard, Mouse, Monitor, or even a USB to serial converter. Firstly, we will see how to install raspberry image on Raspberry Pi using a Raspberry Pi imager. After that, we will enable SSH and Wi-Fi without external using Monitor, mouse, or Keyboard with raspberry pi.

Imagine, you have bought a new Pi board and you do not have Monitor, mouse, or Keyboard? How will you make it work? No worries, we will guide you through this tutorial.
I remember when I purchased the Raspberry Pi first time. I was excited to use it as soon as I received it. When I started to set it up, I came to know that I need an external keyboard, monitor, and mouse. Then, I started searching for a solution to set up raspberry pi without any external components. Because if we use external Keyboard, Mouse, Monitor, it will surely cost us some
bucks.
This is a step-by-step guide for an easy headless setup for Raspberry Pi without using a keyboard and monitor.
You will require the following equipment for the headless setup of Raspberry Pi.
Hardware components:
- Raspberry Pi (Buy here)
- MicroSDHC Card
- USB cable
Software components:
- Raspberry Pi Imager
- VNC Viewer (RealVNC)
Install Raspberry Pi OS to a microSD card
We will start by installing Raspberry Pi OS to a microSD card using the Raspberry Pi Imager.
The first step is to head over to the official Raspberry Pi OS website and download Raspberry Pi Imager. We will download the Windows version. You can download the version according to your operating system.
Make sure your system has an SD card reader.

After you click the download button the .exe file will start downloading. Click that file after the download is complete, and install the Raspberry Pi Imager on your system.
Write the OS to microSD card
After the installation is complete, run the Raspberry Pi installer. The following window will open. Here, head over to the operating system section and click ‘Choose OS.’

Select ‘Raspberry Pi OS (32-bit)’ as the operating system.

Now head over to the storage section and click ‘Choose storage.’

Make sure you have your microSD card inserted in your system when you reach this step. Select your microSD card as storage.

By now you should have selected the operating system and the storage as shown below:

Let us move forward. Click the settings icon. This will open the Advanced settings menu.

Tick the boxes as shown below. Here we are setting the hostname and then enabling SSH. For SSH, we have to provide a username and a password. Moreover, we also configure the Wi-Fi and select the wireless LAN country. Now save your options.

Now click the ‘Write’ button.

You will be notified that all your data already present on your microSD card will get deleted. Click ‘Yes’ to continue the process.

Now the writing process will start. It will take a few minutes for the OS to be written and then verified.


After the process is completed you will receive a ‘Write Successful’ notification. Click ‘Continue’.

Now you can remove the microSD card from your system. Insert the microSD card into Raspberry Pi and power it up.

SSH Raspberry Pi with Putty
Now after your Raspberry Pi is connected to your system with the microSD card inserted inside it, let us establish an SSH connection.
We need an application such as putty to establish an SSH connection with Raspberry Pi. We will be using Putty in this tutorial. We will use Putty for Windows. It is a free-to-download SSH client.
Download Putty from this link and install it on your Windows based system.
After downloading and installing Putty. Now type “Putty” in the Windows search bar and run it as an administrator.
After you have downloaded it successfully, open Putty. Enter raspberrypi.local as the host name and leave the port to 22 (default). Now press Open.

If you are using Linux or Mac, you can SSH into Raspberry Pi by using the following command:
ssh pi@raspberrypi.local
Now enter the username and password of Raspberry Pi that we previously set. By default the username is ‘pi’ and the password is ‘raspberry.’ But we have set the password to different in the above steps using raspberry pi imager.

Now our RPi is connected with the command prompt. Let us learn how to enable and connect over VNC next.
Access Raspberry Pi GUI using VNC
We can also access the Desktop or GUI of Raspberry Pi without using a monitor and keyboard. For that purpose, we will use a VNC viewer application.
Enable VNC
To access GUI, first, we need to enable a VNC interface option in Raspberry config settings. To enable it, first SSH into raspberry by following the steps mentioned in the last section.
Type the following command in the terminal:
sudo raspi-config

This will open the Raspberry Pi Software Configuration Tool window.
Select ‘Interface Options.’

Inside that, select ‘VNC’ to enable it.

Select ‘Yes’ to enable the VNC Server.

The following notification shows successful enablement of the VNC Server. Click ‘Ok.’

Head over to ‘Finish’ to close the configuration tool window.

Installing and Connecting over VNC
Now download and install the VNC viewer on your system.

After the installation is complete, open the VNC viewer. Go to File > New connection.

The Properties window will open up. Here specify the hostname as ‘raspberrypi.local‘ then click ‘Ok.’

Now click the connection icon to connect successfully.

If you get a warning, just click ‘Continue’ to proceed forward.

Now the authentication window will open up. Enter the username and password. The default username and password are ‘pi’ and ‘raspberry’ respectively. Click ‘Ok.’

The Raspberry Pi desktop will now open up.

Video demo:
Summary
This tutorial provides a step-by-step guide on setting up a Raspberry Pi without using external peripherals such as a keyboard, mouse, or monitor. The process, known as a headless setup, allows users to install and configure Raspberry Pi OS, enable SSH, set up Wi-Fi, and access the device remotely.
Key Steps:
- Install Raspberry Pi OS:
- Download and install Raspberry Pi Imager.
- Write the Raspberry Pi OS (32-bit) to a microSD card.
- Configure advanced settings (set hostname, enable SSH, and set up Wi-Fi).
- Click “Write” to flash the OS onto the microSD card.
- Enable SSH and Connect via Putty:
- Insert the microSD card into the Raspberry Pi and power it on.
- Use Putty (for Windows) or the
ssh
command (for Linux/Mac) to establish an SSH connection. - Default credentials: Username:
pi
, Password:raspberry
(or the custom password set earlier).
- Enable and Access Raspberry Pi GUI via VNC:
- SSH into the Raspberry Pi and enable VNC through
sudo raspi-config
. - Download and install VNC Viewer on your computer.
- Set up a new connection using
raspberrypi.local
as the hostname. - Authenticate using the same SSH credentials to access the Raspberry Pi desktop remotely.
- SSH into the Raspberry Pi and enable VNC through
This guide allows users to set up and control a Raspberry Pi without external peripherals, making it cost-effective and efficient. Additionally, it provides a video tutorial and links to related topics like Mosquitto MQTT Broker installation and cross-compilation for Raspberry