Port 5900: VNC
TCP 5900 is the port for Virtual Network Computing (remote desktop). Never directly; many VNC servers have weak or no passwords. Tunnel it over SSH.
| Service | Virtual Network Computing (remote desktop) |
|---|---|
| Protocol | TCP |
| Exposure risk | High: do not expose to the internet |
| Range | Registered (1024–49151) |
What port 5900 does
VNC servers (RealVNC, TightVNC, macOS Screen Sharing) listen on 5900 for display :0, 5901 for :1 and so on.
Should port 5900 be open?
Never directly; many VNC servers have weak or no passwords. Tunnel it over SSH.
Find what's listening on port 5900
- Linux:
sudo ss -tulpn | grep :5900 - macOS:
sudo lsof -nP -i :5900 - Windows:
netstat -ano | findstr :5900, then look up the PID in Task Manager.
Open or block it in a firewall
- ufw:
sudo ufw allow 5900/tcp(ordeny) - firewalld:
sudo firewall-cmd --add-port=5900/tcp --permanent && sudo firewall-cmd --reload - Windows:
New-NetFirewallRule -DisplayName "Port 5900" -Direction Inbound -Protocol TCP -LocalPort 5900 -Action Allow
Port assignment per the IANA Service Name and Transport Protocol Port Number Registry. Test several ports at once with the port scanner, or any port with the open port checker.
Questions about port 5900
What is port 5900 used for?
Virtual Network Computing (remote desktop). VNC servers (RealVNC, TightVNC, macOS Screen Sharing) listen on 5900 for display :0, 5901 for :1 and so on.
Is port 5900 TCP or UDP?
TCP. VNC uses TCP port 5900.
Is it safe to open port 5900?
High: do not expose to the internet. Never directly; many VNC servers have weak or no passwords. Tunnel it over SSH.
How do I check if port 5900 is open?
Use the checker on this page: it connects to your host on TCP 5900 from the internet. Locally, run
nc -vz host 5900 (macOS/Linux) or Test-NetConnection host -Port 5900 (PowerShell). To see what is listening on your own machine, run ss -tulpn | grep :5900 (Linux) or netstat -ano | findstr :5900 (Windows).