By Vivian / Last Updated January 21, 2022

How to change RDP port on Server 2016

“We have a Server 2016 that is configured for Remote Desktop Services, but we are unable to connect to it (it worked before). The RDS does not appear to be accepting connections on port 3389. As a result, I'll need to update and change the RDP port. Is there anyone who knows the exact steps?”

3 methods to change RDP port on Server 2016

As the user mentioned, he or she desires to change the default port number 3389 because it’s not working. Apart from that, some users  with other Windows versions are prone to change RDP port numbers for security, which can reduce the risk of hacking systems with automated password guessing. Here we mainly provide 3 methods to help you realize Windows Server 2016 RDP port change.

Method 1. Change RDP port by using Registry Editor

Step 1. Press Win + R and then input “regedit”, and then hot OK.

Run Box Regedit

Step 2. Navigation:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp

Server 2016 TCP Port

Step 3. Scroll down and find “PortNumber” and then double click on it. Change the port number you like, such as 3390, and then select Decimal. Click on “OK”.

3390 Decimal Port Number

Step 4. Reboot the computer.

Method 2. Change RDP port by the Windows Firewall

Step 1. Search Windows Firewall in the search box and then choose “Windows Firewall with advanced security”.

Firewall With Advanced Security

Step 2. From the left sidebar click on Inbound Rules.

Inbound Rules Firewall

Step 3. From the right sidebar click on New Rule.

New Rule

Step 4. Select Port and click Next.


Step 5. Select TCP and type the port number in a Specific local port and click Next.

TCP 3327

Step 6.  Type in a name for the rule such as "TCP port 3327," then click “Finish” to allow the 3327 port in Windows Firewall.

RDP Port 3327

Method 3. Change RDP port by running Powershell

Step 1. Search Powershell in the search box and then right-click, choose “Run as Administrator”.

Windows Powershell

Step 2. Type the following command line and then you can add a new RDP port like 3390 to the Registry:

★Command line:

$portvalue = 3390

Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "PortNumber" -Value $portvalue 

New-NetFirewallRule -DisplayName 'RDPPORTLatest-TCP-In' -Profile 'Public' -Direction Inbound -Action Allow -Protocol TCP -LocalPort $portvalue 
New-NetFirewallRule -DisplayName 'RDPPORTLatest-UDP-In' -Profile 'Public' -Direction Inbound -Action Allow -Protocol UDP -LocalPort $portvalue 

Change Port Number

Step 3. Reboot the PC.

Step 4. You can also input the following command to check whether the port number is changed.

Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "PortNumber"

A remote access software with no need for changing port: AnyViewer

For security and the speed of remote sessions, many users will choose to change the port number. However, a series of problems like RDP port not listening also annoy them, which produces more troubles for the users. Therefore, we strongly recommend free remote access software without the need to change port-- AnyViewer.

There’s no need to worry about the security of AnyViewer because it adopts ECC (elliptic curve encryption) algorithm. Apart from that, you don’t need to find the username or the IP address of the remote PC. More importantly, the connection won’t be limited on the same LAN and it works on a different network It’s worth noticing that it’s not only workable for Windows Server 2016, but also for Windows 11/10/8.1/8/7 and Windows Server 2022/2019/2012 R2.     

Download Freeware Win 11/10/8.1/8/7
Secure Download

Step 1. Download and install AnyViewer on both 2 computers, find the place of device ID and Settings.

Temporary Code

Step 2. On the remote PC, click on Settings > Recipient > Set my security code, and then type the security code. Return to the main interface.

Accept Remote Control

Step 3. Tell the device ID and the security code set before to the local PC, and then on the local PC, input the security code and then click on “Connect”.


Step 4. On the local PC, choose “Input security code”, and then enter the security code, click on “OK”.

Security Code

Step 4. Now the connection is completed.


How to change RDP port on Windows Server 2016? Here we provide 3 methods, like using Registry Editor, changing RDP port Firewall, and running Powershell to help you achieve it. Of course, the most recommended one is AnyViewer, with which you can easily and securely realize remote access.