Remote Desktop allows remote connections to computers running Windows or Windows Server over the Remote Desktop Protocol (RDP), listening on port 3389 by default. For security or configuration purposes, you might want to change this listening port. This article provides step-by-step instructions to modify the listening port using either PowerShell or the Registry Editor.
⚠️ Important Note: We do not recommend changing the RDP port unless absolutely necessary. Modifying system-level networking settings can create conflicts with other services and may cause connectivity issues if done improperly. Proceed only if you’re experiencing RDP access problems due to network restrictions or firewall blocks.
Choosing a Custom Port
You can remap RDP to any unused port except port 3389 (the default). That said, some ports are more reliable than others, especially in restrictive environments.
Recommended Ports:
443 — Commonly open (used for HTTPS traffic)
80 — Also commonly open (used for HTTP traffic)
8443 — Alternate HTTPS port, often allowed
2222, 3390, 5000-5999 — Less common, but may work depending on your environment
These ports are suggested because they are frequently allowed through firewalls and are less likely to be blocked or throttled by corporate proxies.
How to Remap RDP to a New Port
Step 1: Modify the RDP Port in the Registry
Press Win + R, type regedit, and hit Enter
Navigate to:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp
Find the value named PortNumber
Right-click → Modify
Choose Decimal, and enter your desired port (e.g., 443, 8443, etc.)
Click OK and close Registry Editor
Step 2: Open the Port in Windows Firewall
Open Windows Defender Firewall with Advanced Security
Go to Inbound Rules > New Rule
Select Port, then TCP
Enter the new port number you selected
Allow the connection for all profiles
Name the rule (e.g., “RDP Custom Port”) and finish
Step 3: Restart the VPS
Apply the changes by restarting your VPS.
Step 4: Connect Using the New Port
Once your VPS reboots, use your RDP client to connect with:
your-server-ip:customport
For example:
192.168.1.100:443 or your-vps-ip:8443
Configure the Remote Desktop listening port (using PowerShell)
The listening port for Remote Desktop is specified in the registry. To change the registry value, here's how to change it using PowerShell or the Registry Editor. Select the relevant tab for the method you prefer.
To change the listening port using PowerShell, follow these steps:
Open PowerShell as an administrator.
Check the current port by running the following PowerShell command:
PowerShellCopy
Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name 'PortNumber'
The output is similar to the following example:
PowerShellCopy
PortNumber : 3389 PSPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations PSChildName : RDP-Tcp PSDrive : HKLM PSProvider : Microsoft.PowerShell.Core\Registry
Change the port by running the following PowerShell command. Be sure to replace
<Port Number>with the new port number. In this case, its 2222PowerShellCopy
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name "PortNumber" -Value 2222
Add the new port to the Windows Firewall
If you use the Windows Firewall, you need to add a new inbound rule to allow traffic on the new port. For more information about the different methods you can use to configure the Windows Firewall, see Windows Firewall tools.
Important
If you use any other firewall make sure you or your administrator permit connections to the new port number.
To create new Windows Firewall rules to allow the new port by running the following PowerShell command as an administrator. Be sure to replace <Port Number> with the new port number.
PowerShellCopy
New-NetFirewallRule -DisplayName "RDP Custom Port 2222" `
-Direction Inbound -Protocol TCP -LocalPort 2222 -Action Allow
Test the new Remote Desktop listening port
The next time you connect to this computer by using the Remote Desktop Connection or other client, enter the hostname along with the new port. For example, if you changed the port to use 3390 on computer pc1.contoso.com, the address is pc1.contoso.com:3390.
🤝 Need Assistance?
If any part of the setup feels unclear, the QuantVPS team is happy to help. If you’d like us to verify your environment from our side, feel free to open a support ticket and get connected with the team: https://www.quantvps.com/
