How to Change RDP Port in Windows Server (Secure Your VPS) Meta Description: Protect your Windows VPS from brute-force attacks by changing the default RDP port (3389). Step-by-step guide for Windows Server 2016/2019/2022.

  • Home
  • VPS Windows Support
  • How to Change RDP Port in Windows Server (Secure Your VPS) Meta Description: Protect your Windows VPS from brute-force attacks by changing the default RDP port (3389). Step-by-step guide for Windows Server 2016/2019/2022.

Hackers use automated bots to constantly scan the internet for the default Remote Desktop port (3389). If they find it open, they launch “Brute Force” attacks to guess your password. This not only puts your data at risk but also consumes your server’s CPU, making it slow.Change RDP Port

The best defense is simple: Change the port number to something unique. In this guide, we will walk you through the process step-by-step.

⚠️ Important Warning:
Do not restart your server after Step 1 until you complete Step 2 (Firewall). If you forget the Firewall step, you will be locked out of your server!

Step 1: Edit the Windows Registry

First, we need to tell Windows to listen on a different port. We do this via the Registry Editor.

  1. Press Win + R, type regedit, and hit Enter.
  2. Navigate to this specific path:
    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp
  3. Find the file named PortNumber on the right side.
  4. Double-click it, select Decimal, and change the value from 3389 to your desired number (e.g., 4545).
  5. Click OK.
Changing PortNumber in Windows Registry Editor regedit

Step 2: Update the Firewall (Crucial Step)

Now that Windows knows the new port, we must allow traffic through it via the Firewall.

  1. Search for and open Windows Defender Firewall with Advanced Security.
  2. Click on Inbound Rules (Left menu) > New Rule (Right menu).
  3. Select Port and click Next.
  4. Select TCP and enter your new port number (e.g., 4545) in the “Specific local ports” box.
Creating a new Inbound Rule in Windows Firewall for specific port
  1. Click Next, select Allow the connection, and keep all profiles checked.
  2. Finally, give the rule a name (e.g., “RDP Custom Port”) and click Finish.
Naming the new firewall rule for RDP

Step 3: Restart and Connect

Now it is safe to restart your server. Once it reboots, the old port (3389) will no longer work.

To connect, open your Remote Desktop Connection client and type your IP address followed by a colon and the new port number. Example:

192.168.1.50:4545
Connecting to Remote Desktop using custom port IP:Port

Secure Your Business with WPressly

Changing ports is a good start, but real security begins with a reliable hosting provider. At WPressly, our infrastructure is built with security in mind.

WPressly secure server hosting solutions
  • DDoS Protection: We mitigate attacks before they reach your server.
  • Regular Backups: Your data is always safe with us.
  • 24/7 Monitoring: We keep an eye on the network so you can sleep soundly.

Get a Secure Windows VPS Now