Enable remote access
A Raspberry Pi often runs as a server or performs tasks that require it to be in an inconvenient location, or to run headless (without a display attached). Instead of connecting a monitor, keyboard, and mouse every time you need to make changes, you can access the Pi remotely from another computer on the same network.
Raspberry Pi OS includes two built-in remote access methods: SSH (Secure Shell) for command-line access, and VNC (Virtual Network Computing) for graphical desktop access. You can connect from Mac, PC, Linux, another Raspberry Pi, tablets, or smartphones.
First, enable SSH and VNC on your Pi:
METHOD A
Desktop method
- Open the Raspberry Pi menu (top-left corner) and select Preferences → Raspberry Pi Configuration.
- Go to the Interfaces tab.
- Enable both SSH and VNC by clicking their toggle switches.
- Click OK. Restart if prompted.
METHOD B
Command line method
- Open Terminal and run:
sudo raspi-config - Select Interface Options.
- Choose SSH and select Yes to enable it.
- Return to the menu, select Interface Options again, and choose VNC. Select Yes to enable it.
- Exit raspi-config and reboot if prompted.
Before connecting remotely, you'll need your Pi's IP address or hostname. See our guide on how to find and assign a Raspberry Pi's IP address for details.
Connect via SSH
SSH (Secure Shell) lets you control your Pi via the command line from another computer. Once connected, the terminal on your computer interacts with the Pi exactly as though you were using the terminal on the Pi itself.
SSH works as long as both computers are on the same network. You'll need your Pi's username and either its IP address or hostname.
Find your Pi's username. If you're unsure, look at the terminal prompt on your Pi. For example,
vilros@vilros-servershows the username isvilrosand the hostname isvilros-server.On your other computer (Mac, Linux, or Windows), open Terminal (or PowerShell on Windows) and type:
Replacessh username@hostname.localusernamewith your Pi's username andhostnamewith your Pi's hostname. For example:
Alternatively, use the IP address instead of the hostname:ssh vilros@vilros-server.localssh vilros@192.168.1.100Press Enter. If this is your first time connecting, you'll see a security warning asking you to confirm the connection. Type
yesand press Enter.Enter your Pi's password when prompted. The cursor won't move as you type—this is a security feature. Press Enter when done.
You're now connected! You can run any command you would normally run on the Pi itself.
To disconnect, type exit or press Ctrl + D.
Modern Windows 10 and 11 include an SSH client by default. If your Windows version doesn't have SSH, you can use PuTTY, a free SSH client for Windows.
Connect via VNC
VNC (Virtual Network Computing) lets you control your Pi through its graphical desktop interface from another computer. It's like having a window into your Pi's screen without needing a physical display connected to it.
VNC has two components: the server (on your Pi, which you've already enabled) and the viewer (software on your other computer that connects to the Pi).
Install a VNC viewer
You'll need VNC viewer software on the computer you want to connect from. There are many options, both free and paid, depending on your platform and needs. Some popular choices:
- RealVNC Viewer (free for personal use) — Available for Windows, macOS, Linux, iOS, and Android. Download from realvnc.com.
- TigerVNC (free and open source) — Available for Windows, macOS, and Linux.
- Built-in options — Some operating systems have VNC viewers built in. Check your system's remote desktop features.
Connect to your Pi
- Open your VNC viewer application.
- Enter your Pi's IP address or hostname (e.g.,
192.168.1.100orvilros-server.local). - Connect. You may see a security warning about an unencrypted connection or an unrecognized certificate. Accept it to proceed.
- Enter your Pi's username and password when prompted.
- You should now see your Pi's desktop in a window on your computer. You can interact with it using your mouse and keyboard as though you were sitting in front of the Pi.
VNC performance depends on your network speed and the complexity of what you're displaying. For best results, use a wired Ethernet connection on both devices when possible.
If it doesn't work
- Connection refused or timeout: Confirm SSH or VNC is enabled on your Pi. Check that both devices are on the same network. Verify the IP address or hostname is correct. Try pinging the Pi:
ping raspberrypi.local(replace with your hostname). - Host key verification failed (SSH): This can happen if you've reinstalled Raspberry Pi OS. Remove the old key with
ssh-keygen -R hostname.localorssh-keygen -R ip-address, then try connecting again. - VNC shows a gray or blank screen: This can occur when running headless without a display resolution set. Connect via SSH and run
sudo raspi-config, go to Display Options → Resolution, and set a specific resolution (e.g., 1920×1080). Reboot and try VNC again. - Permission denied: Double-check your username and password. Remember that Linux passwords are case-sensitive.
- Cannot resolve hostname: If
hostname.localdoesn't work, use the IP address instead. Ensure mDNS is working on your network (see the IP address guide for details).
Need help with remote access?
Tell us your Pi's operating system version, the device you're connecting from, and which method you're trying (SSH or VNC).
Contact Vilros Support ↗