Microsoft · Windows
Remote Desktop listening port (PortNumber)
The TCP and UDP port the Remote Desktop listener uses. The default is 3389.
Where it lives
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp
Values
| Name | Type | Data and meaning | Default |
|---|---|---|---|
PortNumber | REG_DWORD | 1-65535 TCP/UDP port for this listener | 3389 |
In plain English
RDP-Tcp is the default listener. Each listener under WinStations has its own PortNumber. Regedit shows DWORDs in hexadecimal by default; select Decimal before you type the port.
Clients then connect with host:port, for example pc1.contoso.com:3390. Microsoft recommends keeping 3389 and controlling access with firewalls or a gateway instead.
| Restart | Restart the Remote Desktop Services service (TermService) or reboot. Add a firewall rule for the new port first, or you lock yourself out. |
|---|---|
| Group Policy | No ADMX policy for the port. Use Group Policy Preferences or a script. |
| Risk | Changing the port isn't a security control on its own. A wrong value or missing firewall rule cuts off remote access. |
How to configure it
Move RDP to port 3390 safely
PowerShell
$port = 3390
New-NetFirewallRule -DisplayName "RDP-TCP-$port" -Direction Inbound -Protocol TCP -LocalPort $port -Action Allow
New-NetFirewallRule -DisplayName "RDP-UDP-$port" -Direction Inbound -Protocol UDP -LocalPort $port -Action Allow
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -Name PortNumber -Value $port
Restart-Service TermService -ForceOfficial sources
- Change the Remote Desktop listening port on your computer · checked 2026-12-05
Verified Confirmed automatically on the cited source.