Step-by-step instructions for setting up a VNC Server on a Raspberry Pi.
These procedures apply to Raspberry Pi 5, 4 or 3 with Raspberry Pi OS (64-Bit), (32-Bit) or (Legacy, 32-Bit).
General Notes
1. General:
The procedures below are optimized for setting up a VNC Server on a Raspberry Pi 5, 4 or 3 with Raspberry Pi OS (64-Bit), (32-Bit) or (Legacy, 32-Bit).
2. Internet access during setup:
Many of the steps below assume and require the target Raspberry Pi is connected to a network with access to the Internet.
Notice about updates, upgrades and installations failing due to repository or network congestion or outages
Occasionally updates, upgrades and installations fail due to repository or network congestion or outages.
Sometimes there is an appropriate message saying as such, sometimes a missing file is reported, and sometimes there is just a failure message without an explanation.
When this occurs, simply run the command again.
If that does not solve the issues immediately, try again later.
Connect to the target Raspberry Pi
Connect to the target Raspberry Pi using Raspberry Pi Connect Remote shell or Raspberry Pi Connect Screen share and open a Terminal window.
Connect directly to the target Raspberry Pi via a Display, Keyboard and Mouse, then open a Terminal window.
sudo hostname -I
- or -
Connect to the target Raspberry Pi using Raspberry Pi Connect Remote shell or Raspberry Pi Connect Screen share and open a Terminal window.
sudo hostname -I
- or -
Login to your router and examine the DHCP assignments, sometimes labeled "Connected Devices" or similar.
Update Raspberry Pi OS and Components
Download latest package lists
sudo apt-get update -y
Download and install updated listed packages
sudo apt-get upgrade -y
Configure and Enable VNC
See "General Notes" 5. near the top of this document.
Enable VNC and Set VNC Display Resolution
Via Raspberry Pi Config
sudo raspi-config
Interface Options | VNC | Yes | OK | Display Options | VNC Resolution | 1024x768 | OK | Finish | Yes (Reboot required for Raspberry 4 and 5)
- or -
Via the Rasberry Pi GUI (Desktop)
Click on "Start" (Raspberry) On the left side of the Task Bar at the top of the Raspberry Pi desktop
Click on "Preferences"
Click on "Control Centre"
Click on the "Interfaces"
Click on the "VNC:" | On
Click on the "Display"
Click on the "Headless Resolution:" | "1024x768"
Click on the "Close" Button
When this is displayed: "The changes you have made require the Raspberry Pi to be rebooted to take effect. Would you like to reboot now?" | Yes
Connect to the target Raspberry Pi via VNC (Optional)
Use a tool such as RealNVC Viewer to connect to the Raspberry Pi