Skip to main content

Change the Remote Desktop listening port on your computer

This guide walks you through remapping RDP to those ports so you can connect even in restricted environments.

Updated over a week ago

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

  1. Press Win + R, type regedit, and hit Enter

  2. Navigate to:

    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp

  3. Find the value named PortNumber

  4. Right-click → Modify

  5. Choose Decimal, and enter your desired port (e.g., 443, 8443, etc.)

  6. Click OK and close Registry Editor

Step 2: Open the Port in Windows Firewall

  1. Open Windows Defender Firewall with Advanced Security

  2. Go to Inbound Rules > New Rule

  3. Select Port, then TCP

  4. Enter the new port number you selected

  5. Allow the connection for all profiles

  6. 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:

  1. Open PowerShell as an administrator.

  2. 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
  3. Change the port by running the following PowerShell command. Be sure to replace <Port Number> with the new port number. In this case, its 2222

    PowerShellCopy

    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/

Did this answer your question?