How to Change the Default RDP Port on Windows Server

Changing the default RDP port enhances the security of your server by reducing the risk of brute force or automated attacks. This guide will walk you through updating the RDP port and configuring your firewall settings to allow access.

Prerequisites

Before starting, ensure you have the following:

  • Administrative access to the server.
  • Basic knowledge of using the Windows Registry Editor.
  • The new port number you'd like to use (ensure it's not already in use).

Steps to Change the RDP Port

Step 1: Open the Registry Editor

  • Press Win + R, type regedit, and press Enter.

images

  • Navigate to the following path in the Registry Editor:
HKEY_LOCAL_MACHINE --> SYSTEM --> CurrentControlSet --> Control --> TerminalServer --> WinStations --> RDP-Tcp

images

Step 2: Modify the PortNumber Key

Locate the PortNumber key in the right-hand pane. Right-click on it and select Modify.

images

In the dialog box, choose Decimal, enter any random port number within the range 49152–65535 (use any random high-range ports) and click OK.

images

images

Step 3: Update Firewall Settings

To allow traffic through the new RDP port:

Open the Control Panel, navigate to System and Security, and select Windows Defender Firewall.

images

images

Click on Advanced Settings in the left menu.

images

Go to Inbound Rules and create a new rule:

images

images

Choose Port as the rule type.

images

Select TCP and specify your new port number.

images

Choose Allow the connection.

images

Specify when the rule applies (e.g., Domain, Private, Public).

images

Give the rule a descriptive name (e.g., "Custom RDP Port").

images

Step 4: Restart the Server

The changes will only take effect after a restart. Use the following steps:

  • Save any open work and restart your server.

  • After the reboot, use the new port number to connect via RDP.

Important Notes

  • Make sure your new port number doesn’t conflict with other services.

  • Remember to update any remote connection settings to include the new port number (e.g., IP_Address:Port).

Done, This guide will walk you through configuring your server to use a custom RDP port securely and ensuring proper access through the firewall.


CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS