How to Change RDP Port on Windows Server 2012/2016/2019/2022



What is RDP (Remote Desktop) port? Default RDP Port Number


RDP (Remote Desktop Protocol), or Remote Desktop Protocol, is an application layer protocol used to provide remote access to Windows servers and workstations.

By default, RDP connection uses TCP port 3389, but sometimes it may be necessary to change rdp port, the most often used when you need to hide your RDP / RDS host from automatic port scanners that are looking for Windows hosts on the network with an open standard rdp port number 3389. Changing the RDP port will reduce the likelihood of exploiting RDP vulnerabilities, reduce the number of remote password guessing attempts using RDP SYN and other types of attacks.

In this article we will show you how to change the RDP port used in remote desktop access.


How to change port for RDP


Step 1


You need to connect to the Windows Client/Server over RDP. For it you need to click to Run option or use WIN+R, next type regedit and press Ok

Windows rdp

Step: 2


In the Windows Registry Editor you need to do next step HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp

Windows rdp

Step: 3


Change the PortNumber value to anything between 1024 and 65535, such as 50415

Windows rdp

Step: 4


Start Windows Firewall and create a new rule under "Inbound Rules"

Windows rdp


Windows rdp

Step: 5


Rule type - For port, Protocol TCP, Specific local ports - 50415, Allow connection, Profile - Domain, Public and Private, Name - Allow RDP

Windows rdp


Windows rdp


Windows rdp


How to Connect a Remote Desktop with a Custom RDP Port?


In the future, when connecting, use a new port, for example, 50415. Below you will find steps to connect a remote desktop with a custom RDP port:

Step 1

Start remote desktop connection mstsc, for it you need to press WIN+R keys then type mstsc and press Enter.

Step: 2

Now you need in a "Remote Desktop Connection" window enter the IP address of the remote server and a new port number separated by a colon.

You can change the default RDP port for the next versions of Windows: Windows Server 2022, Windows 10, Windows 8.1, Windows 8, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2008 R2.


Conclusion


In this article, we tried to briefly explain what an RDP port is, and also showed how to connect and change the RDP port on a Windows server. You can use this guide for almost all Windows versions like Windows Server 2022, Windows 10, Windows 8.1, Windows 8, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2008 R2. We hope this guide helped you.