How To Change The RDP Port?


October 14, 2019 by Harry Hill

Change The RDP Port

The default RDP port is 3389. Since this port is well known, it can be used to attack servers. To prevent this, we have to change the RDP port to something else.

Steps To Change The RDP Port

  1. Choosing A New Port Number.
  2. Adding The New Port Number To The Firewall To Accept The Connection.
  3. Changing The Port In The Windows Registry Setting.
  4. Connecting Through The New Port To Your Server.
  1. Choose A New Port Number

    The range between (0-1023) is for system ports and (1024-49151) is for user ports that have been given to the applications, so it’s better to choose an RDP port number between range (49152-65535), but it’s ok if you also find a free number between (1024-49151).

    Note: In this topic, we have chosen port number 7952 as the new port.

  2. Add The New Port Number To The Firewall To Accept The Connection

    Now you should open your chosen port number in the Windows firewall to let the firewall accept that port’s connection.
    You can use the below tutorial link to open a port in the Windows firewall.

    Open A Port On The Windows Firewall

  3. Changing The Port In The Windows Registry Setting

    Once you opened the port in the firewall, you should change the port number in the registry setting.
    Open the RUN windows using Windows key + R, type Regedit, and click OK.
    On the new window, navigate to the below path:

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

    Change the RDP port in the registry editor

  4. Click on RDP-Tcp, find PortNumber on the right section, and double click on it.
    In this section, put the Base on decimal and change the 3389 to your desired port number and click OK.
  5. Enter new port number
  6. Note: Close the registry and restart your server.The next time you connect to this server using the Remote Desktop connection, you must type the new port.Note: If you faced any issue connecting to your RDP server, check the below link o find out the issue.

    Remote Desktop Connection Issues

    connect to RDP server with the new port


Also, you can check the below video to see how to change the RDP port.



It is essential to change the RDP port after you buy RDP to increase your connection to the server and prevent hackers from gaining unauthorized access to your server. Note that it’s vital to add the new port to the Windows firewall to prevent losing the server’s connection.


​ ​ ​ ​

About the Author Harry Hill

I like to learn and to teach to make things easier

Leave a Reply

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