Introduction

Setting up a Raspberry Pi for the first time without a monitor or keyboard? You're in the right place. In this guide, you'll learn how to configure your Raspberry Pi headlessly using SSH (Secure Shell) and RealVNC, allowing you to control your Pi remotely from your laptop or phone.

Whether you're building an IoT project, coding a robot, or just tinkering, this method saves time and space.
What You’ll Need

  • Raspberry Pi (any model with Wi-Fi support, e.g. Raspberry Pi 4 or 5)

  • microSD card (8GB or larger)

  • Card reader

  • Power supply for the Pi

  • Wi-Fi connection

  • Laptop or PC with Raspberry Pi Imager installed


Step 1: Flash Raspberry Pi OS to Your microSD Card

  1. Download and install Raspberry Pi Imager from raspberrypi.com/software.

  2. Insert your microSD card into your computer.

  3. Launch the Imager and:

    • Choose Raspberry Pi OS (32-bit).

    • Select the SD card.

    • Click ⚙️ (Advanced Options) and preconfigure:

      • Enable SSH (use password or key-based login)

      • Set hostname

      • Configure Wi-Fi (SSID, password, country)

      • Set username and password

  4. Click "Write" to flash and wait until it completes.


Step 2: Boot the Raspberry Pi

  1. Insert the flashed SD card into your Raspberry Pi.

  2. Power on the device using the appropriate power adapter.

  3. Wait 1–2 minutes for it to boot and connect to the Wi-Fi network.


Step 3: Connect via SSH (Headless)

  1. On your PC, open a terminal (Linux/macOS) or PowerShell (Windows).

  2. Run:

ssh [email protected]
  1. (Replace "pi" and "raspberrypi.local" with your custom username and hostname if configured)

  2. Accept the SSH fingerprint prompt and enter your password.

You’re now inside your Raspberry Pi via SSH!

Step 4: Enable and Use RealVNC for Remote Desktop

RealVNC lets you access your Pi’s desktop GUI remotely.

Enable VNC on Raspberry Pi

  1. Run:

sudo raspi-config
  1. Navigate to:

    • Interface Options

    • VNC

    • Select Yes to enable

  2. Install the RealVNC Viewer on your PC from realvnc.com.

Connect

  • Launch VNC Viewer.

  • Type:

raspberrypi.local
  • Use the same login credentials.

You’ll now see the Raspberry Pi desktop on your computer!


Expected Outcome

By the end of this guide, you’ll be able to:

  • Access your Raspberry Pi via terminal using SSH.

  • Access the desktop environment remotely with RealVNC.

  • Perform all configurations without connecting a monitor, mouse, or keyboard (headless setup).
    Troubleshooting and Tips

  • Can't find hostname? Use your router's connected device list or a tool like arp-scan to find the Pi's IP address.

  • 🔒 SSH Refused? Ensure SSH was enabled correctly and that the Pi is on the same network.

  • 📶 Wi-Fi not connecting? Double-check the SSID and password in Raspberry Pi Imager.


  • Conclusion

  • You’ve successfully configured your Raspberry Pi for remote access using SSH and RealVNC. This method streamlines future projects by making your Pi more accessible and portable.

  • 👉 Next up: How to Control GPIO Pins Remotely via Python