How To Change Default RDP Port in Windows Server?

default RDP port is (3389) and to increase the security of all Windows Server 2012, 2016, 2019 and 2022, you can change it with registry editor and PowerShell.
6 min read
Intermediate
Change Default RDP Port on Windows

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 PortNumber
OUTPUT
PortNumber   : 3389

Change 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.

Open Registry Editor with Run dialog

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.

Registry path
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp
Navigate to RDP port number configuration path in registry editor

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.

Change Windows RDP Port

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 1234

To verify that the port number has been changed, run:

Get-ItemProperty -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name "PortNumber"
OUTPUT
PortNumber   : 1234

Note:

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:

How to Open a Port on Windows VPS?
READ How to Open a Port on Windows VPS?

You can also run this command in your firewall:

New-NetFirewallRule -DisplayName "Allow Custom RDP Port" -Direction Inbound -Protocol TCP -LocalPort 1234 -Action Allow

This 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

connect to RDP with custom rdp port

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 3389

Conclusion

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

Share:

Was this article helpful?

Your feedback helps us improve our technical guides.

Related Posts

You May Also Like

Explore more tutorials, guides, or documentation, from VPSMakers.

Learn how to temporarily or permanently disable IPv6 on Ubuntu, Debian, and other Linux distributions with simple commands.
Robert Smith
November 28, 2026
Learn how to easily update MikroTik router firmware manually using WinBox and CLI. Stay up to date with the latest updates!
Jacob Rafet
November 24, 2026
default RDP port is (3389) and to increase the security of all Windows Server 2012, 2016, 2019 and 2022, you can change it with registry editor and PowerShell.
Robert Smith
November 23, 2026
Learn how to change the default MikroTik WinBox port using Terminal or WinBox and allow connections through the new port in the firewall.
Jacob Rafet
November 22, 2026