Port 5900: VNC

Port 5900 (TCP) is used by VNC. Virtual Network Computing remote desktop (display :0). Display :1 is 5901, and so on.

5900Port
TCPProtocol
rfbIANA service name
Remote accessCategory

Port range

5900 is a registered port (range 1024–49151). Any user can bind to it; IANA records which service registered the number.

Security

Port 5900 should not be reachable from the public internet. Restrict it to trusted networks or a VPN, and scan your public IP to confirm it is closed.

Open port 5900 in a firewall

ufw         sudo ufw allow 5900/tcp
iptables    sudo iptables -A INPUT -p tcp --dport 5900 -j ACCEPT
firewalld   sudo firewall-cmd --permanent --add-port=5900/tcp
Windows     New-NetFirewallRule -DisplayName "VNC 5900" -Direction Inbound -Protocol TCP -LocalPort 5900 -Action Allow

Check if port 5900 is open

nc -vz example.com 5900
Test-NetConnection example.com -Port 5900   # PowerShell
sudo ss -tulpn | grep ':5900 '   # what is listening locally (Linux)

Other remote access ports

Frequently asked questions

What is port 5900 used for?
VNC. Virtual Network Computing remote desktop (display :0). Display :1 is 5901, and so on.
Is port 5900 TCP or UDP?
TCP.