What is port 51820 used for?
WireGuard VPN’s default port.
Should port 51820 be open?
Usually open to the internet. This port is meant to be reachable publicly on servers that offer the service. WireGuard doesn’t answer unauthenticated packets, so it can look filtered to scanners even when it works.
See what is listening on port 51820
# Linux
sudo ss -ulnp | grep ':51820 '
# macOS
sudo lsof -nP -i UDP:51820
# Windows (PowerShell)
Get-NetUDPEndpoint -LocalPort 51820
Open or block port 51820 in a firewall
# Ubuntu / Debian (ufw)
sudo ufw allow 51820/udp
sudo ufw deny 51820/udp
# Windows (PowerShell, as administrator)
New-NetFirewallRule -DisplayName "Port 51820" -Direction Inbound -Protocol UDP -LocalPort 51820 -Action Allow
On cloud servers, also open the port in the provider’s security group or network firewall. At home, a service behind a router needs a port-forwarding rule to the device’s local IP.