How to Change the RDP Port for a Windows Server

The default Remote Desktop Protocol (RDP) port for Windows servers is 3389. This article introduces the steps to change the RDP port for a Windows server.

1 Change the RDP port on registry

There are two methods to change an RDP port on registry.
1.1 Change the RDP port by modifying the registry manually

Press “Windows + R” to open Windows Run dialog. Type “regedit” in the Run box and press Enter to open Windows Registry Editor.

open Windows Registry Editor.

Navigate to the following registry subkey:

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp\PortNumber

Click Edit > Modify, and then click Decimal. Type the new port number, and then click OK.
Note: The recommended range for RDP ports is 1024-65535.

Type the new rdp port number
1.2 Change the registry with PowerShell Command
Open Windows PowerShell
# Run the following command:
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp'
chang rdp port by powershell

Note: 33899 is the RDP port changed in the last step. Please change the parameters according to your settings.

2 Open the new RDP port in Windows Firewall

The newly set RDP port must be open in the firewall before it can be used. About how to open a port in Windows Firewall, please refer to How to Open a Port in Windows Firewall.

Open Services

3 Restart the RDP service

3.1 Type services in the Search box. Open Services
Open Services
3.2 Restart Remote Desktop Services
Restart Remote Desktop Services

4 Test

Test the connection to the server with the new RDP port.
Note:You need to fill in "IP:port" in the Computer column. For example: 10.10.XX.XX:33899

Remote Desktop Connection
Windows Security