/
/

How to Change Remote Desktop Port in Windows 11

How to Change Remote Desktop Port in Windows 11 blog banner image

Remote Desktop Protocol (RDP) is a reliable networking and troubleshooting tool for IT administrators. However, admins must first build proper security arrangements around it to ensure the connection cannot be exploited.

One way to do this is by changing the Remote Desktop port on networked devices. This simple switch up helps in securing a vulnerable entry point and in streamlining protocols across any managed environment. Follow along this guide to see how these settings can be configured and validated soon after.

Prerequisites and method for changing the Remote Desktop port

Before making any changes, take note of these systems and access requirements for smooth deployment and testing.

✔️ You must be signed in with administrator privileges.

✔️ Ensure Remote Desktop is enabled.

✔️ Support multiple RDP endpoints behind a shared IP.

✔️ Comply with organizational security policies.

✔️ Familiarity with Registry Editor interface and functionalities.

⚠️Warning: Unintended changes to the Windows Registry can affect your system’s performance and stability. Learn how to back up the Registry and create a restore point before configuring the database.

Change RDP port via Registry Editor

To complete this action, you will need to modify the Windows Registry. To familiarize yourself with the Registry database, check out our interactive video on how to use the Registry Editor.

Otherwise, you may refer to these steps to continue:

  1. Press Win + R, type regedit, and tap OK to open the Registry Editor.
  2. Navigate or copy and paste the following path to the Registry address bar: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp
  3. On the right pane, find the PortNumber DWORD value.
  4. Double-click it and select Modify.
  5. Under Base, choose Decimal and replace the value from 3389 (default) to your desired port (e.g., 3390, 443, 50001)
  6. Click OK to confirm and close Registry Editor.

You may need to restart the system or the Remote Desktop service to apply the changes.

The next time you connect to this device by using the Remote Desktop Connection, enter the hostname along with the updated port number.

Update Windows Firewall for New RDP Port

After changing the port, it’s essential to update the firewall settings to acknowledge the new port and permit connections. To do this, you can create a new Inbound Rule.

  1. From Windows Search, open Windows Defender Firewall with Advanced Security.
  2. Click Inbound Rules and click on New Rule… to open the New Inbound Rule Wizard.
  3. Under Port Type, toggle the Port option, then click Next.
  4. Choose TCP, enter the new port into the Specific local ports field, and click Next.
  5. Toggle Allow the connection, click Next, and apply the rule to all profiles.
  6. Set a name for the rule (e.g., RDP Custom Port) and tap Finish to confirm and exit.

After setup, test the RDP connection by using the new port. If the connection fails, make sure that the rule is active and correctly configured to allow TCP traffic on the designated port.

Confirm that the new port is active or listening

In Command Prompt or PowerShell, use the netstat -an | findstr :<your-port> command to verify if the new port is open and listening.

Example:

netstat -an | findstr :3389 3390

You should see the LISTENING status if the change was successful.

Changing the RDP port: Additional considerations and tips

Changing the port adds obscurity, but it should not be treated as a replacement for strong authentication and firewall protocols. Keep those settings up to standard and consider these additional pointers to enforce your new settings and maximize the use of RDP.

  • RDP Clients: When connecting via the new port, use: <hostname or IP>:<port>.
  • Port Range: Choose a non-conflicting, unused port above 1024 and below 65535.
  • Router/NAT Port Forwarding: If you are accessing the machine remotely over the Internet, configure your router to forward the new RDP port.
  • RDP sessions can lock the remote desktop, making it ideal for managing endpoints but less so for collaboration.

ℹ️ Note: Unfortunately, there is no direct GPO that controls RDP port change. As a result, IT managers must rely on Registry or scripting to make mass deployments.

Best practices for configuring Remote Desktop Port

Leaving the default settings unchecked is a big risk for IT environments. These configurations are no secret to advanced users and hackers, which renders your system vulnerable even to internal compliance concerns.

The Remote Desktop service is a powerful and essential tool for IT administrators, so configuring its settings should be one of the key priorities when boosting network security. You can learn more ways on how to use RDP in our blog or check out NinjaOne Remote® to discover advanced integration for remote access management.

You might also like

Ready to simplify the hardest parts of IT?
×

See NinjaOne in action!

By submitting this form, I accept NinjaOne's privacy policy.

NinjaOne Terms & Conditions

By clicking the “I Accept” button below, you indicate your acceptance of the following legal terms as well as our Terms of Use:

  • Ownership Rights: NinjaOne owns and will continue to own all right, title, and interest in and to the script (including the copyright). NinjaOne is giving you a limited license to use the script in accordance with these legal terms.
  • Use Limitation: You may only use the script for your legitimate personal or internal business purposes, and you may not share the script with another party.
  • Republication Prohibition: Under no circumstances are you permitted to re-publish the script in any script library belonging to or under the control of any other software provider.
  • Warranty Disclaimer: The script is provided “as is” and “as available”, without warranty of any kind. NinjaOne makes no promise or guarantee that the script will be free from defects or that it will meet your specific needs or expectations.
  • Assumption of Risk: Your use of the script is at your own risk. You acknowledge that there are certain inherent risks in using the script, and you understand and assume each of those risks.
  • Waiver and Release: You will not hold NinjaOne responsible for any adverse or unintended consequences resulting from your use of the script, and you waive any legal or equitable rights or remedies you may have against NinjaOne relating to your use of the script.
  • EULA: If you are a NinjaOne customer, your use of the script is subject to the End User License Agreement applicable to you (EULA).