By default, Windows uses port 3389 for Remote Desktop (RDP). Changing the RDP port can help reduce unauthorized access attempts. This guide will show you how to safely change the RDP port in your Windows VPS.
⚠️ Important: Make sure you open the new RDP port in Windows Firewall and your VPS provider’s firewall (if applicable), or you may get locked out.
Step-by-Step Guide
1. Open the Windows Registry Editor
-
Press Win + R, type regedit, and press Enter.
-
Click Yes if prompted by User Account Control.
2. Navigate to the RDP Port Registry Key
Go to the following path in Registry Editor:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp
3. Modify the Port Number
-
In the right-hand panel, find the entry named PortNumber.
-
Double-click on it.
-
Select Decimal, then enter your new port number (e.g., 3390, 4422, etc.).
-
Click OK.
✅ Choose a port number between 1025 and 65535 that is not in use by other services.
4. Allow the New Port Through Windows Firewall
-
Open Control Panel > Windows Defender Firewall.
-
Click Advanced settings on the left.
-
Click on Inbound Rules, then New Rule.
-
Select Port, click Next.
-
Choose TCP, then Specific local ports, and enter the new port number.
-
Allow the connection, apply to all profiles, and name the rule (e.g., “RDP Custom Port”).
5. Restart the Remote Desktop Services
You can restart the RDP service or reboot the server.
To restart via PowerShell or Command Prompt:
net stop termservice
net start termservice
❗ If you’re connected via RDP, this might disconnect you. To be safe, reboot from your VPS control panel (e.g., https://vps.hosteons.com) after applying changes.
6. Connect Using the New Port
-
Open Remote Desktop Connection (mstsc).
-
In the Computer field, enter:
YOUR_SERVER_IP:NEW_PORT
-
Example:
192.168.1.100:3390
Notes:
-
These steps apply to:
-
✅ Windows Server 2019
-
✅ Windows Server 2022
-
✅ Windows Server 2025
-
-
The interface and registry paths are the same across these versions.
-
Always test the new port before closing your current RDP session.