In this tutorial, we will focus on setting up a headless Raspberry Pi, which means we will configure it without a monitor, keyboard, or mouse. The Raspberry Pi is a credit card-sized computer that was developed by the Raspberry Pi Foundation in the UK. It was initially designed to teach children how to program, but it has since become a popular platform for hobbyists, makers, and professionals.
Step1: Hardware and Software Requirements for Headless Raspberry Pi Setup
We need the following hardware and software for our headless raspberry pi setup without monitor and keyboard.
Hardware Requirements:
- Raspberry Pi: Any model of the Raspberry Pi should work, but for this tutorial, we will assume you have a Raspberry Pi 4.
- SD Card Or USB Flash Drive: You will need an SD card or Pen Drive with at least 8GB of storage capacity. A higher-capacity card is recommended if you plan to install a lot of software.
- Ethernet Cable(optional): You will need an Ethernet cable to connect the Raspberry Pi to your laptop.
- Power Supply: You will need a power supply that can provide at least 3A at 5V to power the Raspberry Pi.
- Laptop Or Desktop: A System to connect to your Pi.
Software Requirements:
- Raspberry Pi Imager: This is the official software for easy installing OS to Raspberry Pi. https://www.raspberrypi.org/downloads/raspbian/
- SSH Client: You will need an SSH client to connect to the Raspberry Pi from your laptop. If you are using a Mac or Linux computer, you can use the built-in Terminal app. If you are using a Windows computer, you can use a tool like PuTTY. https://www.putty.org/
- VNC Viewer – To connect to your Pi remotely as a live desktop.
Step2: Format the SD Card
1. First, download the Raspberry Pi Imager software from the above-given link then install and launch it on your laptop.

2. Now insert the SD card/ Flash Drive into your Laptop.
3. Under Operating System, select ERASE, under storage option select your SD card. Click on the write button.

4. Then click on OK. It will take a few minutes. It will erase your SD card completely. Once this is completed follow the next steps to install the Raspberry Pi OS on our Pi.
Step3: Install Raspberry Pi OS to SD Card
Now again under the Operating System select Raspberry Pi OS (32-bit). Under storage select your SD card.
1. Click on the setting icon in the bottom right corner.


2. Set hostname: Check mark this option. Give hostname “mypi“. You can give the default “raspberry” or any name of your choice. But take note of this. You will need this during login to your Pi.
3. Enable SSH: Select this option. Use password authentication will be auto selected.
4. Set username and password: Check this option. Give the username of your choice and password. Take note of this. You will require this during login to Pi.
5. Configure wireless LAN – Select this option. Here you will configure your Wi-Fi to connect your pi to the internet. This is mandatory to connect to your pi wirelessly. SSID: Enter Wi-Fi name. It will be auto filled if you are connected to Wi-Fi. Password: Enter your Wi-Fi password to connect your Pi to the internet.
6. Wireless LAN country: Select your country.
7. Set locale setting: Select your time zone and keyboard layout.
Give all the details carefully, take note of the values given and save them.
8. now click on the write button. It will take some time to write the OS to your SD card.

9. Once the above process is complete. Remove the SD card from your laptop and put it in your raspberry Pi any of the USB ports.
10. Power on the Raspberry Pi and wait for few seconds till the green light blinks. Once the green light blinks, we are ready for the headless connection. Make sure you are connected to the same Wi-Fi network that you gave in step no -5.
Connect To Raspberry Pi using SSH
1. Now download and install PuTTY from the given link if not already installed. This is one of the popular SSH clients for windows. For Mac you can use the default terminal.
2. Open PuTTY and enter the hostname we gave during our Pi setup, leave others as it is. You must give “. local” after your host name.

3. Click on open. Click OK if you get a security warning. That is not a problem. This will show for the first time connect.

Enter your username and password. your password will not be visible while you type. So, type the password carefully then press enter.

Now you are connected to the Pi using command prompt. But if you want to connect through a GUI (User interface) then follow the process below to connect our Pi using VNC viewer.
Enabling And Connecting VNC On Raspberry Pi
1. First, we must enable VNC on or Pi. Enter the command below in the command prompt.
sudo raspi-config
2. Now use the arrow key to navigate down and select option no 5 (Interfacing Options), hit Enter.

3. Select VNC enter.

4. Select Yes then Enter.

5. Hit Enter to acknowledge.
6. Use the right arrow key to select finish, then enter.

7. Now download the VNC Viewer software from the link given at the top and install it on your system.
8. Launch the VNC app and configure as below.
9. At the top you will see a search bar. Enter your hostname there which you had given during OS configuration. Mine is “mypi.local”. Hit enter.
Note: Use “.local” along with the hostname. In case that does not work then try without local. If it got connected, then follow from step 13 to 15.
If it is throwing error that “No host is known“, then follow the steps given below (step 10 to 12).
10. If you face the above error at step 9, then we have to try to connect using IP address of Raspberry.
11. To get the IP address of your raspberry Pi, enter the below command in command prompt, which you connected through PuTTY.
hostname -I

12. Now enter this IP address on your VNC viewer search bar at the top and hit enter.
13. Click on Ok if it shows any security warning. That is not a problem.
14. When prompted enter Raspberry Pi’s username and password that we configured during OS installation.

15. Once it is connected, your Raspberry Pi desktop will appear on your main window of your laptop. From there you can control your Pi and play around.
What Is Next:
Now that you have configured your Headless Raspberry Pi without keyboard and mouse successfully, next you can follow our guide to play around your Pi using PuTTY (command prompt).
If you face any challenge during the setup process, comment below, and we will help you to resolve your issue.