PORTUnencrypted unless extendedIANA assigned

Port 5900VNC (RFB)

Port 5900 is the base TCP port for VNC, the Remote Framebuffer (RFB) protocol used by RealVNC, TightVNC, UltraVNC, TigerVNC and macOS Screen Sharing. Display :0 uses 5900, display :1 uses 5901 and so on. Classic VNC sends the session unencrypted, so it should only be used inside a tunnel or with a variant that adds TLS.

BlackhawkHub Editorial · Updated

What port 5900 is used for

VNC transmits a computer's screen as a stream of pixel updates and sends back keyboard and mouse input. Unlike RDP, which understands Windows drawing operations, VNC works at the framebuffer level, which makes it platform-neutral: the same viewer connects to Linux, macOS, Windows, a Raspberry Pi or the KVM console of a server's management controller.

Ports are allocated per display:

DisplayPort
:05900
:15901
:25902

macOS Screen Sharing and Apple Remote Desktop also listen on 5900.

Security considerations

  • Plain RFB is unencrypted. Everything on screen, and every keystroke, is visible to a network observer. Use a VNC product with built-in TLS, or reach the server through an SSH tunnel (ssh -L 5901:localhost:5900 user@host) or a VPN.
  • Password handling is weak in classic VNC. The traditional authentication limits passwords to 8 significant characters. Prefer implementations that support stronger authentication or system accounts.
  • Never expose 5900 to the internet. Internet-wide scans routinely find unauthenticated VNC servers; many have been used to access industrial systems and point-of-sale terminals.
  • Bind to localhost when the server is only meant to be reached through a tunnel (-localhost in most Unix servers).

How to check port 5900

Is something listening locally? On Windows, open Command Prompt and run:

cmd
netstat -ano | findstr :5900

A line in the LISTENING state means a local program has bound port 5900; the last column is its process ID (PID). Match the PID in Task Manager (Details tab) or with tasklist /fi "PID eq <pid>". On Linux or macOS the equivalent is ss -tulnp | grep :5900 or lsof -i :5900.

Can you reach it on a remote host? PowerShell's built-in connection test attempts a TCP handshake:

powershell
Test-NetConnection example.com -Port 5900

TcpTestSucceeded : True means the remote system accepted a TCP connection on port 5900. False means the port is closed, filtered by a firewall, or the host is unreachable; the output's ping result helps tell those apart.

See the netstat and Test-NetConnection records for the full option sets.

Firewall considerations

Allow inbound TCP 5900–5910 only from specific management addresses, and only if a tunnel or VPN is not available. Home routers should not forward VNC ports.

On Windows, inbound rules live in Windows Defender Firewall with Advanced Security (wf.msc). A rule allowing port 5900 only takes effect on the profile (Domain, Private, Public) it is assigned to. The command-line equivalent is netsh advfirewall firewall add rule; see the netsh record.

Frequently asked questions

Why does my VNC server use 5901 instead of 5900?

VNC numbers displays. Port = 5900 + display number, so display :1 listens on 5901. On Linux, the first user-started server is often :1 because :0 is the physical console.

Is VNC encrypted?

The base protocol is not. VNC authentication uses a challenge-response that protects the password itself, but the screen content and keystrokes travel in clear text. RealVNC and some others add TLS; otherwise tunnel VNC over SSH or a VPN.

What is port 5800?

Some VNC servers offer a browser-based Java or HTML viewer on 5800 + display number. It is rarely used today.

Sources