Skip to content

VPS: Change Windows RDP Port

Learn how to change the Windows RDP port

12 November 20262 min read41 Views0 helpful

Introduction

The Remote Desktop Protocol uses port 3389 by default. This port is well-known and often targeted by automated scans. Changing the RDP port can reduce unwanted connection attempts and improve basic security.

Change the RDP Port in the Registry

Log in locally to the server or via an existing Remote Desktop connection. Open the Run dialog with Win + R, type regedit, and confirm to open the Registry Editor. Navigate to the following registry path:

Code
HKEY_LOCAL_MACHINE
 └─ SYSTEM
    └─ CurrentControlSet
       └─ Control
          └─ Terminal Server
             └─ WinStations
                └─ RDP-Tcp

Find the registry entry named PortNumber. Change the value format to Decimal and enter the desired new port number. It is recommended to choose a port above 1024 that is not already used by another service. After making the change, close the Registry Editor.

Adjust Windows Firewall Rules

The new RDP port must be allowed in the Windows Firewall. Open Windows Defender Firewall with Advanced Security and go to the inbound rules section.

Modify the existing Remote Desktop rule or create a new inbound rule that allows TCP traffic on the newly configured port. Make sure the rule allows the connection and applies to the required network profiles.

Restart Services to Apply Changes

The port change only takes effect after restarting the Remote Desktop services or performing a full system restart. A complete server reboot is recommended to ensure the configuration is consistently applied.

Connect Using the New Port

When establishing a new Remote Desktop connection, you must explicitly specify the port by appending it to the IP address or hostname. Example:

Code
203.0.113.10:3390
Info: Note on ZapX Dashboard and Network Firewall

The RDP port shown in the Server Access card (under the Access tab of your VPS in the ZapX Dashboard) still defaults to 3389 and does not automatically update to the port changed in the registry — so be sure to remember your new port. Additionally, the Windows Firewall rule you adjusted only applies at the OS level. If you have set a restrictive default policy or custom rules for incoming traffic in your VPS’s separate Network Firewall (its own tab in the ZapX Dashboard), you must also allow the new port there.

Conclusion

Changing the Windows RDP port reduces the attack surface against automated scans and unauthorized connection attempts. The process involves updating the Windows registry, allowing the new port in the firewall, and restarting the system or services.

After completing these steps, immediately verify access and document the configured port to avoid future connection issues. If you have any questions or need assistance, our support team is available daily to help! 🙂

Free tools

Related tools for servers and developers

View all

FAQ

Frequently asked questions

Open the Registry Editor (regedit) and navigate to HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Control > Terminal Server > WinStations > RDP-Tcp. Find the PortNumber entry, set the value format to Decimal, and enter the desired new port number.
It is recommended to use a port above 1024 that is not already in use by another service.
Yes, you must also allow the new RDP port in the Windows Firewall by modifying the existing Remote Desktop rule or creating a new inbound rule for TCP traffic on the new port. Then restart the Remote Desktop services or reboot the system for the change to take effect.

Feedback

Was this article helpful?

Your feedback helps us prioritize and improve content.

0 of 0 people found this article helpful.

Personal support

Need more help than the guide provides?

Our ZAP-Hosting support team knows your product — briefly describe your issue and we'll help you personally.

Zappy knows this guide and answers you right in the chat.