You have three solid ways to control a headless Raspberry Pi: SSH for the terminal, VNC for the full desktop on your local network, and Raspberry Pi Connect for browser-based access from anywhere. Each solves a different problem. Picking the wrong one means wasted setup time, a laggy desktop, or a port forwarded to the open internet.
Quick Takeaways
- SSH (port 22) is the fastest, lightest, and most scriptable option. Use it for any terminal task.
- VNC streams the graphical desktop. It works well on a LAN, but the Wayland switch in Raspberry Pi OS Bookworm changed which VNC servers work out of the box.
- Raspberry Pi Connect needs no port forwarding. It gives browser access to your Pi’s desktop and command line from any device.
- Combine them. Use SSH as the daily driver, and Connect or VNC when you need a GUI.
Comparison at a Glance
| Feature | SSH | VNC | Raspberry Pi Connect |
|---|---|---|---|
| Interface | Terminal only | Full desktop | Desktop + terminal in a browser |
| Default port | 22 (TCP) | 5900 (TCP) | None to open (outbound only) |
| Bandwidth | Very low | Medium to high | Low (shell) to medium (desktop) |
| Works across the internet | Only with port forwarding or a VPN | Only with port forwarding, a VPN, or a cloud relay | Yes, out of the box |
| Setup effort | Low | Medium | Low |
| Client needed | Any SSH client | VNC viewer | Web browser |
| Cost | Free | Free (LAN) / paid (cloud) | Free (individuals) |
| Best for | Scripts, flashing, debugging | LAN desktop work | Remote access from anywhere |
Understanding the Three Options
SSH: Encrypted Terminal Access
SSH (Secure Shell) opens an encrypted command-line session over TCP port 22. It uses almost no bandwidth and no GPU on the Pi. It runs on every Raspberry Pi model, including Raspberry Pi OS Lite, which has no desktop.
Strengths:
- Works over a 1 Mbps link or a flaky Wi-Fi connection.
- Supports SCP, SFTP, and rsync for file transfer.
- Supports port tunneling, which lets you reach other services securely.
- Scriptable, so Ansible and CI jobs can drive it.
Weakness: no GUI. Anything that needs a window (a serial plotter, a camera preview, a browser) needs another tool or X forwarding.
VNC: Full Desktop Streaming
VNC (Virtual Network Computing) uses the RFB protocol to send your screen as pixels and your keyboard and mouse as events. A VNC server runs on the Pi. A viewer runs on your laptop or phone.
Bookworm complicates this. RealVNC was long installed by default on Pi OS, and many Pi users relied on it. RealVNC had not been updated for Wayland, so it does not run by default on current Pi OS unless you force X11. Check your OS version and display server before you pick a VNC route.
Strengths:
- Full desktop with mouse, clipboard, and multi-window support.
- Mature clients on Windows, macOS, Linux, iOS, and Android.
- Low latency on a wired LAN.
Weakness: it is heavier than SSH, and exposing port 5900 to the internet is risky. Never forward it without a VPN or tunnel.
Raspberry Pi Connect: Browser-Based Relay
Raspberry Pi Connect is the official remote access service from Raspberry Pi. The rpi-connect daemon on your Pi makes an outbound connection to Raspberry Pi’s servers. You sign in with a Raspberry Pi ID from any browser and pick a device.
It offers two modes:
- Screen sharing: Requires the Wayland window server, which Bookworm and later use by default. It is not compatible with Raspberry Pi OS Lite or X-based systems.
- Remote shell: Supports all Raspberry Pi computers, going back to the 2012 Pi 1, including Lite and desktop images.
Screen sharing and remote shell work whether the Pi shares your network or sits on a different one. Both work on the same network or across networks.
Pricing in brief: individuals get unlimited devices with screen sharing, remote shell, and remote update for free. Connect for Organisations costs $0.50 per device per month, with unlimited users.
Hardware and OS Compatibility
| Pi Model | SSH | VNC (X11 / Wayland) | Connect shell | Connect screen sharing |
|---|---|---|---|---|
| Pi 1 / Zero | Yes | Yes (X11) | Yes | No |
| Pi 2 / 3 / Zero 2 W | Yes | Yes (X11) | Yes | No* |
| Pi 4 / 400 | Yes | Yes | Yes | Yes |
| Pi 5 | Yes | Yes | Yes | Yes |
| OS Lite (no desktop) | Yes | No | Yes (Lite variant) | No |
*In practice, you can use screen sharing with Raspberry Pi 4 and later, and remote shell with all models. Screen sharing on other models depends on the OS release, so check current documentation for your board.
Setup Guide: SSH
Step 1: Enable SSH
Pick one method.
- In Raspberry Pi Imager, open the OS customization screen and tick Enable SSH.
- On a running Pi, use
sudo raspi-config, then Interface Options > SSH. - On a headless SD card, create an empty file named
sshon the boot partition.
Step 2: Connect
# Replace "pi" with your username and use the hostname set in Imager
ssh pi@raspberrypi.local
# Or use the IP address
ssh pi@192.168.1.50
Step 3: Switch to Key Authentication
Passwords invite brute-force attempts. Keys do not.
# On your laptop: generate an Ed25519 key pair
ssh-keygen -t ed25519 -C "laptop-to-pi"
# Copy the public key to the Pi
ssh-copy-id pi@raspberrypi.local
# On the Pi: disable password logins
sudo nano /etc/ssh/sshd_config
# PasswordAuthentication no
# PermitRootLogin no
# Apply the change
sudo systemctl restart ssh
Test the key login in a second terminal before you close the first one. A typo here locks you out.
Setup Guide: VNC
Option A: RealVNC Server (X11)
If you run a Pi OS release or session that uses X11:
# Enable the VNC server through raspi-config
sudo raspi-config
# Interface Options > VNC > Yes
# Or run the service directly
sudo systemctl enable --now vncserver-x11-serviced
Install VNC Viewer on your laptop and connect to raspberrypi.local:5900.
Option B: Wayland Sessions
Check your session type first:
# Prints "wayland" or "x11"
echo $XDG_SESSION_TYPE
On a Wayland session, use a VNC server built for Wayland, or switch to X11 in raspi-config under Advanced Options > Wayland. Switching display servers affects other desktop software, so test before you commit.
Headless VNC Without a Monitor
A Pi with no display attached may start with no usable desktop resolution. Set a virtual resolution in raspi-config under Display Options > VNC Resolution, or pick a fixed mode in /boot/firmware/config.txt.
Setup Guide: Raspberry Pi Connect
Step 1: Install or Enable
Connect is installed by default in Raspberry Pi OS Desktop and Full, but the service is disabled until you turn it on. On older images or Lite:
sudo apt update
sudo apt full-upgrade
# Desktop image: full Connect (screen sharing + shell)
sudo apt install rpi-connect
# Lite image: remote shell only
sudo apt install rpi-connect-lite
Step 2: Turn It On and Sign In
# Start the service for your user
rpi-connect on
# Sign in; this prints a link to open in a browser
rpi-connect signin
# Check status
rpi-connect status
A healthy status looks like this:
Signed in: yes
Subscribed to events: yes
Screen sharing: allowed (0 sessions active)
Remote shell: allowed (0 sessions active)
Step 3: Connect From a Browser
- Open connect.raspberrypi.com and sign in with your Raspberry Pi ID.
- Click Connect via next to your device.
- Choose Screen sharing or Remote shell.
Screen sharing signals itself on the Pi. The Connect tray icon rotates during a session, and a desktop notification appears when one starts.
Step 4: Control the Features
# Disable or enable screen sharing
rpi-connect vnc off
rpi-connect vnc on
# Disable or enable remote shell
rpi-connect ssh off
rpi-connect ssh on
Do not turn off both while you are working remotely. You will lose the way back in and need physical or SSH access to re-enable them.
Security Comparison
| Concern | SSH | VNC | Raspberry Pi Connect |
|---|---|---|---|
| Encryption | Strong by default | Varies by server and config | Encrypted browser session |
| Authentication | Password or Ed25519 keys | VNC password or system login | Raspberry Pi ID (2FA available for organisations) |
| Exposure risk | Port 22 attracts bot scans | Port 5900 is risky if exposed | No inbound ports |
| Hardening | Keys, fail2ban, non-root | Tunnel through SSH or a VPN | Strong ID password, revoke unused devices |
| Visibility | Auth logs in /var/log/auth.log |
Server logs | Device list in your account |
Security rules that apply to all three:
- Change default credentials. Never leave a Pi on a default password.
- Keep the OS patched with
sudo apt update && sudo apt full-upgrade. - Never forward ports 22 or 5900 to the internet without key-only auth or a VPN.
- Remove devices you no longer use from your Connect account.
Tunnel VNC Through SSH
If you must use VNC on an untrusted network, wrap it in SSH:
# Forward local port 5901 to the Pi's VNC port 5900
ssh -L 5901:localhost:5900 pi@raspberrypi.local
# Then point your VNC viewer at localhost:5901
Performance and Latency
| Scenario | SSH | VNC | Connect |
|---|---|---|---|
| Typing in a terminal over 3G | Smooth | Laggy | Shell is smooth |
| Running a GUI app on a LAN | Not applicable | Smooth | Smooth |
| Watching video | Not applicable | Choppy | Choppy |
| Idle resource use on the Pi | Near zero | Low to medium | Low |
Remote shell also works much better over low-bandwidth connections than screen sharing. On a weak link, use the terminal and skip the desktop.
Real-World Workflows
Workflow 1: Headless IoT Weather Station
You mount a Pi with a BME280 sensor in a garden shed.
- Flash Raspberry Pi OS Lite with SSH and Wi-Fi preconfigured in Imager.
- Install
rpi-connect-litefor off-network shell access. - Wire the BME280 to the Pi over I2C (SDA to GPIO2, SCL to GPIO3, VCC to 3.3V, GND to GND).
- Use SSH at home to edit code. Use Connect shell when you travel.
Quick sensor check over SSH:
# Enable I2C, then confirm the sensor appears at 0x76 or 0x77
sudo raspi-config nonint do_i2c 0
i2cdetect -y 1
Workflow 2: Kiosk Dashboard Debugging
A Pi 5 drives a wall display running a browser dashboard.
- Use Connect screen sharing to see exactly what the display shows.
- Use SSH to tail logs:
journalctl -u dashboard.service -f. - Restart the service remotely:
sudo systemctl restart dashboard.service.
Workflow 3: Classroom Fleet
A teacher manages 20 Pis for student projects. Connect for Organisations adds search, device tagging, bulk provisioning, a management API, and an audit log. That beats memorizing 20 IP addresses.
Troubleshooting Checklist
| Symptom | Likely Cause | Fix |
|---|---|---|
Connection refused on SSH |
SSH disabled or wrong IP | Enable in raspi-config; check hostname -I |
Permission denied (publickey) |
Key not installed | Run ssh-copy-id; check ~/.ssh permissions (700) |
| VNC shows “Cannot currently show the desktop” | No display or Wayland mismatch | Set a VNC resolution; confirm session type |
| Connect shows device offline | Service stopped or no internet | Run rpi-connect status; check network |
| Screen sharing missing in Connect | Lite image or X11 session | Use a desktop image with Wayland, or use remote shell |
| Connect session drops on weak Wi-Fi | Relay path unstable | Switch to remote shell; wrap work in tmux |
Wrap long jobs in tmux so a dropped session does not kill them:
sudo apt install tmux
tmux new -s build # start a named session
# Detach with Ctrl+B, then D. Reattach later:
tmux attach -t build
Which Option Should You Choose?
| Your Situation | Best Choice |
|---|---|
| Headless Pi, scripts, and code edits | SSH |
| Pi on your home LAN, need a GUI | VNC or Connect screen sharing |
| Pi behind CGNAT or a router you cannot configure | Raspberry Pi Connect |
| Slow or metered connection | SSH or Connect remote shell |
| Managing many devices | Connect for Organisations |
| Old Pi 1 or Zero with Lite OS | SSH or Connect remote shell |
A strong default setup: enable SSH with key authentication for daily work, and enable Connect for access when you leave home. Add VNC only if you rely on tools that need it.
FAQ
Is Raspberry Pi Connect better than VNC?
Not always. Connect is easier to set up and works across networks without port forwarding. VNC gives you more control on a local network and runs on X11 systems, which Connect screen sharing does not support. Screen sharing needs Wayland and does not work with Raspberry Pi OS Lite or X11.
Is Raspberry Pi Connect free?
For individuals, yes. The individual plan is free and includes unlimited devices, screen sharing, remote shell, and remote update. Organisations pay $0.50 per device per month. Check Raspberry Pi’s pricing page for current terms.
Is SSH or VNC safer for remote access?
SSH with key authentication is safer by default because it is encrypted, lightweight, and well hardened. Run VNC inside an SSH tunnel or a VPN on untrusted networks. Never expose port 5900 to the internet.
Can I use Raspberry Pi Connect on Raspberry Pi OS Lite?
Yes, for the terminal only. Lite ships with a variant of Connect that supports remote shell only, with no screen sharing. Install it with sudo apt install rpi-connect-lite if it is missing.



