Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe

How to setup headless Raspberry Pi for remote access using SSH and VNC

By Nikhil Agnihotri February 16, 2025

Raspberry Pi is currently the most widely used single-board computer in the world. Launched in October 2023, Raspberry Pi 5 is the latest version of the development board, offering more significant computing power, an enhanced GPU, and faster memory than its predecessors.

Among single-board computers, Raspberry Pi remains the most ubiquitous, outpacing alternatives like BeagleBone, Banana Pi, Banana Pro, and CubieBoard. One reason for this is its versatility, making it an ideal tool for various applications. Its compact size and affordability also mean it’s ideal for projects like robotics, smart home automation, home theater systems, retro gaming consoles, and many others.

Additionally, Raspberry Pi is widely used in industrial applications for tasks like data logging and process automation. It also serves as an excellent platform for learning computer science and programming. Whether you’re a professional, educator, or enthusiast, Raspberry Pi offers a flexible and cost-effective way to bring ideas to life.

The board can be easily set up as a desktop system, but for many applications, it is often used in headless mode, running without a display, keyboard, or mouse. A headless setup is more power-efficient, reduces hardware overhead, improves stability, and simplifies management and maintenance.

In this project, we’ll set up a headless Raspberry Pi and configure SSH and VNC for remote access and control.

Components 

  1. Raspberry Pi 5B/4B x1
  2. Class 10 MicroSD card (at least 32GB) x1
  3. MicroSD card reader x1
  4. Power adaptor for Raspberry Pi x1
  5. A computer (for preparing MicroSD card)
  6. Internet connection

Preparing the MicroSD card

The first step in setting up Raspberry Pi in headless mode is preparing the MicroSD card. The card must be at least a Class 10 and 32 GB in capacity.

Insert the MicroSD card in an SD card reader and attach it to your computer. Format the SD card to the FAT32 system using an SD card formatting software of your choice.

You can download a SD card formatter here. After formatting the MicroSD card, download the Raspberry Pi Imager for your computer’s operating system using this link.

Install and run the Raspberry Pi Imager on your computer.

When you open the Raspberry Pi Imager, it look like this:

Next, click on the “CHOOSE DEVICE” tab, and select the target Raspberry Pi model. The Raspberry Pi 5 and Raspberry Pi 4 are currently the latest models.

We’re setting up the Raspberry Pi 4B for this project.

Next, click on the “CHOOSE OS” tab, and select “Raspberry Pi OS (other).”

Scroll down and select the “Raspberry Pi OS (Legacy, 64-bit) Full” option. You can also select any other operating system variant as per your requirements.

Next, select the “CHOOSE STORAGE,” tab and select the MicroSD card from the dropdown list. This card must be attached to the computer via an SD card reader.

Click on the “NEXT” button. A window will pop up prompting you to apply the OS customization setting. Click on the “EDIT SETTINGS” option.

Under the general tab, setup a hostname for your Raspberry Pi. Then, set a username and password. Configure the wireless LAN with the SSID and the network key of your Wi-Fi network. Select your country in the WLAN settings and set a local settings if required.

 

Under the “Services” option’, check the “Enable SSH” tab.

Next, click on “Yes.” A window will pop up with a warning message: All existing data on Generic-Mass-Storage-Device will be erased. Are you sure you want to continue. Click on “Yes,” and wait for the setup to continue.

The setup will write files to your MicroSD card. It will also verify the files written in storage. You can skip this verification, but it’s recommended to wait for the written files to be verified.

After the files are written and verified, the setup is complete. A message will pop up to remove the SD card from the reader. Click “Continue,” and safely remove the MicroSD card.

Booting up Raspberry Pi

Insert the OS-loaded microSD card into Raspberry Pi’s microSD card slot (ensure the power supply is turned off before inserting the card).

Once the card is in place, switch on the power by connecting the power supply. The lights on the board will start blinking, indicating that the board is booting. Once the boot process is complete, the power LED will remain stable.

Getting the IP address

To access the Raspberry Pi remotely, you’ll need its IP address. Since we already included our Wi-Fi credentials during OS customization, Raspberry Pi will automatically connect to the router upon booting.

There are several ways to find the Raspberry Pi’s IP address. You can use network scanner tools like the Advanced IP Scanner (Windows-only), Angry IP Scanner, or Zenmap from NMAP. Alternatively, you can log in to your router and check the list of connected devices for the Raspberry Pi’s IP. Another method is to enable your mobile Wi-Fi hotspot and look for available connected devices.

If you set a hostname during OS customization, you can also retrieve the IP address by using the ping command in your computer’s terminal (e.g., ping pi.local) Windows Command Prompt). For this setup, we used Angry IP Scanner to locate the Raspberry Pi’s IP address.

You can get the Angry IP Scanner from this link.

Accessing Raspberry Pi remotely

Once you have Raspberry Pi’s IP address, you can connect to it remotely using an SSH tool like PuTTY (Windows-only), Bitvise SSH, or MobaXterm.

SSH (Secure Shell) is a network protocol that enables secure remote access to and control of Raspberry Pi over a network. It establishes an encrypted connection between your computer and Raspberry Pi, ensuring safe communication. SSH is essential for setting up a headless Raspberry Pi.

For this setup, we used MobaXterm to establish an SSH connection with the Raspberry Pi. You can download MobaXterm from here.

Click on the “Start local terminal” button. This will launch a local terminal window. Run the ssh command in the terminal to access headless Raspberry Pi from your computer. The ssh command will have following prototype.

ssh <username>@<IP-address-of-Raspberry-Pi>

For example,

ssh [email protected]

Now, enter the password you assigned to the username in OS customization while preparing the SD card. If the password is correct, you’ll complete the SSH login to Raspberry Pi. You can then run terminal commands on Raspberry Pi remotely through the SSH tool’s terminal window.

Updating Raspberry Pi’s config tool

Next, let’s access Raspberry Pi’s Configuration Tool remotely using the SSH tool on our computer. We’ll also update the Configuration Tool.

First, access the SSH login to Raspberry Pi using MobiXterm, and run the following command after logging in.

sudo raspi-config

The Raspberry Pi Configuration Tool will open in the terminal window of the SSH tool (i.e., MobiXterm in this case), as shown in the image below.

Scroll down to select “7. Update,” and press enter. The Raspberry Pi Configuration Tool will be updated.

Updating and upgrading Raspberry Pi remotely

We’ll need to update and upgrade Raspberry Pi remotely using the SSH client. Login to your Raspberry Pi using the SSH client as described above. In our case, we are using the MobaXterm as the SSH client.

After logging in, run the following command in the terminal of the SSH client.

Sudo apt update && sudo apt upgrade –y

Raspberry Pi will update and upgrade remotely after executing this command.

Enabling VNC on Raspberry Pi

To remotely access the Raspberry Pi’s desktop environment, the Virtual Network Computing (VNC) must be enabled. VNC allows users to interact with Raspberry Pi in headless mode using a graphical desktop interface — even without a monitor, keyboard, or mouse physically connected.

Unlike SSH, which provides command-line access, VNC offers a full desktop experience with windows, icons, menus, and a mouse pointer, just like a standard computer.

First, a VNC server must be installed on Raspberry Pi. By default, the RealVNC Server comes pre-installed. Next, install a VNC Viewer on your computer, which will connect to the VNC server on Raspberry Pi and display its desktop.

After installation, you can connect to your Raspberry Pi’s VNC server by entering its IP address and, if required, the display number. Once connected, Raspberry Pi’s desktop will appear on your computer screen, allowing full interaction via mouse and keyboard.

However, before connecting via VNC, it must first be enabled on Raspberry Pi. To do so, login to Raspberry Pi using an SSH client, such as MobaXterm. Run the following command in the terminal window of the SSH client to open the Configuration Tool.

sudo raspi-config

In the Raspberry Pi Configuration Tool, select the “3 Interface Options.”

Next, select “I3 VNC.”

Then, select “Yes,” and press enter to enable the VNC server.

The VNC server is now enabled, but we’ll have to do one more thing. We must set the resolution of the VNC. To do so, select “2 Display Options” in the Raspberry Pi Configuration Tool.

Select the “D5 VNC Resolution.”

Choose the highest resolution and press, “SELECT.”

The resolution will be as selected.

Remotely accessing Raspberry Pi’s GUI

After enabling VNC on Raspberry Pi, it’s time to install the VNC Viewer on your computer to remotely access the desktop environment of Raspberry Pi.

There are several VNC Viewers available for remote desktop access on Raspberry Pi, including the TightVNC Viewer, RealVNC Viewer, and Remmina. As the RealVNC server is the default installed on Raspberry Pi, we’ll stick with using the RealVNC Viewer. Fortunately, this does not require installing an additional VNC server on Raspberry Pi.

You will need to download the RealVNC Viewer from here. Install the RealVNC Viewer on your computer and open it. Then, enter the IP address of your Raspberry Pi and press enter. A window will pop up prompting to authenticate to VNC server. Enter the username and password set during the OS customization (while preparing the SD card).

Remember to check the “Remember Password” to avoid authentication in the future. Click “Ok” to connect with the VNC server on your Raspberry Pi.

Once connected, you can access your Raspberry Pi desktop environment remotely from your computer.

Running the RealVNC server 

There’s one last thing left in our headless Raspberry Pi setup. We must configure the VNC server on Raspberry Pi to run upon start-up. Otherwise, we’d have to enable the VNC server on Raspberry Pi through SSH client every time we need to access the desktop environment.

Login to Raspberry Pi through the SSH client, MovaXterm. In the terminal window of the SSH client, run the following command:

sudo systemctl enable vncserver-x11-serviced

This command will enable the VNC server upon start-up. Next, restart the VNC server by running the following command in the terminal window of the SSH client.

sudo systemctl restart vncserver-x11-serviced

Now, whenever Raspberry Pi boots up, the VNC server will automatically launch during the start-up. So, you can easily access the desktop environment of your Raspberry Pi remotely by connecting through the VNC Viewer on your computer.

 

You may also like:

  • Raspberry Pi Models
    RPI Python Programming 02: Raspberry Pi Models
  • Raspberry Pi 4
    RPi Python Programming 01: Introduction to Raspberry Pi 4

  • How to build a LoRa gateway using Raspberry Pi

  • The top IoT projects for enhancing everyday life

  • The top mobile app development tools for IoT and electronics

  • What are the top development boards for AI and ML?

  • How to design a power supply for Raspberry Pi

Filed Under: Tutorials
Tagged With: headlessstartup, raspberrypi, raspberrypi4, raspberrypi5, ssh, tutorial, vnc
 

Next Article

← Previous Article
Next Article →

Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.



Tell Us What You Think!! Cancel reply

You must be logged in to post a comment.

EE TECH TOOLBOX

“ee
Tech Toolbox: Internet of Things
Explore practical strategies for minimizing attack surfaces, managing memory efficiently, and securing firmware. Download now to ensure your IoT implementations remain secure, efficient, and future-ready.

EE Learning Center

EE Learning Center
“engineers
EXPAND YOUR KNOWLEDGE AND STAY CONNECTED
Get the latest info on technologies, tools and strategies for EE professionals.

HAVE A QUESTION?

Have a technical question about an article or other engineering questions? Check out our engineering forums EDABoard.com and Electro-Tech-Online.com where you can get those questions asked and answered by your peers!


RSS EDABOARD.com Discussions

  • High Side current sensing
  • The comparison of different Tcl script checkers
  • Voltage mode pushpull is a nonsense SMPS?
  • Reducing "shoot-through" in offline Full Bridge SMPS?
  • How to simulate power electronics converter in PSpice?

RSS Electro-Tech-Online.com Discussions

  • Back to the old BASIC days
  • Parts required for a personal project
  • PIC KIT 3 not able to program dsPIC
  • Failure of polypropylene motor-run capacitors
  • Siemens large industrial PLC parts

Featured – RPi Python Programming (27 Part)

  • RPi Python Programming 21: The SIM900A AT commands
  • RPi Python Programming 22: Calls & SMS using a SIM900A GSM-GPRS modem
  • RPi Python Programming 23: Interfacing a NEO-6MV2 GPS module with Raspberry Pi
  • RPi Python Programming 24: I2C explained
  • RPi Python Programming 25 – Synchronous serial communication in Raspberry Pi using I2C protocol
  • RPi Python Programming 26 – Interfacing ADXL345 accelerometer sensor with Raspberry Pi

Recent Articles

  • What is AWS IoT Core and when should you use it?
  • AC-DC power supply extends voltage range to 800 V DC
  • Infineon’s inductive sensor integrates coil system driver, signal conditioning circuits and DSP
  • Arm Cortex-M23 MCU delivers 87.5 µA/MHz active mode
  • STMicroelectronics releases automotive amplifiers with in-play open-load detection

EE ENGINEERING TRAINING DAYS

engineering

Submit a Guest Post

submit a guest post
Engineers Garage
  • Analog IC TIps
  • Connector Tips
  • Battery Power Tips
  • DesignFast
  • EDABoard Forums
  • EE World Online
  • Electro-Tech-Online Forums
  • EV Engineering
  • Microcontroller Tips
  • Power Electronic Tips
  • Sensor Tips
  • Test and Measurement Tips
  • 5G Technology World
  • Subscribe to our newsletter
  • About Us
  • Contact Us
  • Advertise

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy

Search Engineers Garage

  • Electronic Projects & Tutorials
    • Electronic Projects
      • Arduino Projects
      • AVR
      • Raspberry pi
      • ESP8266
      • BeagleBone
      • 8051 Microcontroller
      • ARM
      • PIC Microcontroller
      • STM32
    • Tutorials
      • Audio Electronics
      • Battery Management
      • Brainwave
      • Electric Vehicles
      • EMI/EMC/RFI
      • Hardware Filters
      • IoT tutorials
      • Power Tutorials
      • Python
      • Sensors
      • USB
      • VHDL
    • Circuit Design
    • Project Videos
    • Components
  • Articles
    • Tech Articles
    • Insight
    • Invention Stories
    • How to
    • What Is
  • News
    • Electronic Product News
    • Business News
    • Company/Start-up News
    • DIY Reviews
    • Guest Post
  • Forums
    • EDABoard.com
    • Electro-Tech-Online
    • EG Forum Archive
  • DigiKey Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Learn
    • eBooks/Tech Tips
    • Design Guides
    • Learning Center
    • Tech Toolboxes
    • Webinars & Digital Events
  • Resources
    • Digital Issues
    • EE Training Days
    • LEAP Awards
    • Podcasts
    • Webinars / Digital Events
    • White Papers
    • Engineering Diversity & Inclusion
    • DesignFast
  • Guest Post Guidelines
  • Advertise
  • Subscribe