Windows uses port 3389 as the default Remote Desktop Protocol (RDP) port to establish connections. You can change the RDP port to a custom number using the Registry Editor or by running commands in PowerShell.
Changing the RDP port does not protect your server against brute-force attacks or other security threats. It can only reduce exposure to automated scans that target the default RDP port. To better protect your server, you should also use strong passwords, enable Network Level Authentication (NLA), and configure firewall rules to restrict access.
Whether you’re using a Windows VPS or a local Windows machine, you can follow this guide to change the default RDP port. The process is the same in both environments and covers two methods: Registry Editor and PowerShell. We’ll also show you how to update Windows Firewall rules, restart Remote Desktop Services, and connect to your machine using the new port.
Note:
The steps and commands in this guide have been tested and verified by the VPSMakers Technical Team on several Windows Server versions running on VPS servers and a local machine running Windows 10. Both Registry Editor and PowerShell methods have been tested to ensure the instructions work as expected. You will need administrator privileges to change the RDP port and configure Windows Firewall.
Check the Current RDP Port
Before changing the RDP port, you should check which port Remote Desktop is currently using. By default, when you get an RDP server, the VPS provider provides you with the default RDP port; however, they may have changed and configured it.
You can check the current RDP port using either PowerShell or Registry Editor. However, PowerShell is a more straightforward option because it displays the port number directly. Open PowerShell as Administrator and run the following command:
Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name PortNumberPortNumber : 3389Change the Default RDP Port Using Registry Editor
To change the default RDP port using the Windows Registry Editor, you should modify the PortNumber value in the registry configuration files. To open Registry Editor, press Win + R then type regedit to open Registry Editor.

Navigate to the RDP Port Configuration in Registry Editor
Copy the registry path below and paste it into the Registry Editor’s address bar to navigate directly to the required key.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp
Change Windows RDP Port
Find the PortNumber entry in the right-hand panel and double-click it. Under Base, select Decimal then, in Value, enter your preferred port number and click OK to save changes.
In the image below, we’ve set 1234 as the new port number. You can replace it with your preferred port, choosing any available port between 1 and 65535. However, it’s best to avoid ports below 1024, as they are well-known ports commonly reserved for standard services and applications.

Note:
After changing the port number, you can use the new port to connect to your Windows Server through Remote Desktop. However, if you’re using Remote Desktop Services (RDS), you should restart your Windows VPS to apply the changes and start using the new port. Before restarting, make sure the new port is allowed through Windows Firewall to avoid losing remote access to your server.
Change the Default RDP Port Using PowerShell
You can change the default RDP port directly through PowerShell without opening Registry Editor. PowerShell allows you to update the PortNumber registry value with a single command, making the process quicker and more straightforward than navigating through multiple registry keys.
First, open the Windows Start menu and search for PowerShell. Right-click it and select Run as administrator. Once PowerShell is open, run the following command to change the PortNumber registry value.
Replace 1234 with your prefered port number:
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name "PortNumber" -Value 1234To verify that the port number has been changed, run:
Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name "PortNumber"PortNumber : 1234Note:
The RDP port number should now be set to your preferred value. If you’re using Remote Desktop Services (RDS), you’ll need to restart your Windows Server for the changes to take effect. Before restarting, follow the next section to allow incoming connections through Windows Firewall on the new port.
Allow the New RDP Port Through Windows Firewall
As mentioned before, after changing the port number of the RDP connection, you may need to allow incoming connections through the new port in Windows Firewall. If the firewall is configured, it may block incoming remote desktop connections, preventing you from accessing your server.
You can follow this guide to learn how you can open a port on Windows or run the command below in PowerShell by replacing the 1234 with your port.
Follow this guide to learn how you can open a specific port on Windows Firewall:

You can also run this command in your firewall:
New-NetFirewallRule -DisplayName "Allow Custom RDP Port" -Direction Inbound -Protocol TCP -LocalPort 1234 -Action AllowThis command creates an inbound rule that allows TCP traffic through the specified port.
Important:
Make sure you use the same port number in Windows Firewall and your RDP configuration. Also, if your VPS provider has an additional network firewall, you may also need to ask them to allow the new port there.
Connect to Windows Server Using the New RDP Port
After changing the RDP port and configuring Windows Firewall, you can connect to your Windows Server using the new port. To do this, open the Remote Desktop Connection (RDC) app and enter your server’s IP address followed by a colon (:) and the new port number, like this 192.168.1.100:1234

How to Restore the Default RDP Port
To restore the default RDP port, follow the same steps described earlier using either Registry Editor or PowerShell, and set the PortNumber value back to 3389. Make sure port 3389 is allowed through Windows Firewall, then restart Windows Server or Remote Desktop Services to apply the changes. You can then connect to your server using its IP address without specifying a custom port.
As a shortcut method, you can open PowerShell as Administrator and run the following command to restore it to the default value:
Set-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name "PortNumber" -Value 3389Conclusion
To change the Remote Desktop Protocol (RDP) port on Windows, you have many methods. In this guide, we’ve walked you through changing the RDP registry port number using both Registry Editor and PowerShell, and opening a connection to the new port in Windows Firewall.
The best method mainly depends on your preference and requirements. PowerShell is a more straightforward option if you want to change the RDP port without using a graphical interface. It is also useful for automation and server administration, especially when managing multiple Windows Servers.
Having an alternative way to access your Windows Server can be useful if you don’t want to rely on a standard RDP connection or encounter connection issues. For example, you can connect to your Windows VPS using an Android device or set up Chrome Remote Desktop to access it from other supported devices through the Chrome browser.
You can learn setting up Chrome Remote Desktop by following this guide:

Chrome RDP provides you a simple remote desktop environment through browser, in this guide you learn to install and use it on Windows VPS.
Read the full article
