In this guide, we will show you how you are able to change the Remote Desktop port of your server. The default Remote Desktop port of a Windows server is 3389. In order to secure your server, it is advised to change the port you use to connect to your server.

Important: When changing the port of your Remote Desktop, please make sure to allow the new port in your firewall. In case you change the port and the firewall is not adjusted you might lose connection to your server.

In this guide, you will find an explanation on how to add a firewall rule with the Remote Desktop port.

Change the port

When logged in to your server, use the Windows menu to search for “regedit”. Then run this program as Administrator. You will see a page similar to the below picture:


In the registry please go to the following path: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp

You will see a list of files in this location. In this list search for PortNumber. Then right-click the file and select ‘Modify’. An edit screen will open similar to the below example:


The port can be changed in two different values. You can use hexadecimal and decimal. If you are not familiar with hexadecimal values we would advise you to select decimal as “base”.  When you have selected base you are able to enter a port number of your choice.

Once you have adjusted the port there are two ways to apply the change. The first option is to restart the server. Please make sure that the firewall has been adjusted before restarting the server. The second option would be to manually restart the Remote Desktop Services. In order to achieve this press ‘Windows key + R’. Then type services.msc and hit enter. In the menu scroll down to Remote Desktop Services. When you right-click the service you are able to select restart.


In this guide, we have learned how to adjust the Remote Desktop port. It is important to make sure the firewall is adjusted properly before you apply the changes. If you would like to learn some of the basics of the Windows Firewall please visit the following guide.

If you are facing any difficulties while changing the port of Remote Desktop feel free to send us an email here.