Change the Remote Desktop (RDP) port number in Windows

Stefan

In all Windows versions, the default Remote Desktop Port (RDP) is 3389 (TCP/UDP). But if you want to better protect your computer against attacks, I recommend that you change the default RDP port number 3389 to another number.

Microsoft Remote Desktop is an app that allows you to access and manage the resources and data of a remote computer (host computer) over an Internet connection. It is, in essence, remote control software. Remote Desktop allows you to access a work computer from home, regardless of whether the work computer connects to a network or not.

When you begin a remote desktop session, the client computer sends a signal over the Internet to the host computer via a standard “listening” port 3389 asking for permission to connect and log in. The host computer responds with a request for your login information, which is checked against a list of Remote Desktop users using an internal authentication process.

Once you log in, display data and keyboard keystrokes are sent from the host to the client computer, so you can view and interact with the host computer as if you were sitting right in front of it.

Change Remote Desktop port number

To change the default Remote Desktop port (3389) to a different port number, open the registry editor. In the search bar or using the magnifying glass, search for: regedit. Open the registry editor.

open regedit

In the registry editor navigate to the following key:

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

Double-click on “PortNumber”. Then click on Decimal. Enter a new port number for Remote Desktop.

Read also
Enable Hyper-V or install Hyper-V in Windows 11/10 Home

change port number of remote desktop in the windows registry

close the Windows registry editor off.

After you change the Remote Desktop port in the Windows registry, you must allow incoming traffic on the new RDP port in Windows Firewall.

In the Windows search bar, use the magnifying glass. Search for: Firewall. Click on the Windows Defender Firewall result.

Open Windows firewall

Click on Advanced settings in the menu on the left.

Windows Firewall advanced settings

Click on Inbound Rules and then right-click: New Rule.

Windows Firewall incoming connections

The rule type click on Port.

Windows Firewall port

Then click on TCP or UDP (TCP first then repeat the step again for UDP) and click on Specific Ports. Enter the new Remote Desktop port number.

firewall local TCP ports

Click on Allow the connection.

Allow the connection

Click on all three options, domain, private and public.

Firewall domains

Give the new Windows Firewall rule a meaningful name.

Add RDP port to firewall

Click finish.

You have now successfully changed the port number of Windows Remote Desktop. You must restart the computer. The next time you try to connect via remote connections from another computer, enter: IP number:NEW-PORT-NUMBER.

For instance: 192.168.178.1: 3399.

I hope this helped you. Thank you for reading!


Problem solved?


Help other people too.
Share this article on a website, forum or via social media.

Join our new computer forum for questions and computer help.
Do you have a computer question?

The email address will not be published. Required fields are marked with *