To change the default Remote Desktop Protocol (RDP) port on a Windows Server, modify the PortNumber registry value, allow the new port through Windows Firewall and any external network firewall, restart Remote Desktop Services or reboot the server, and connect using the new IP:port address. Changing the default RDP port from 3389 can reduce exposure to automated scans, but it does not replace strong passwords, Network Level Authentication (NLA), or other security measures. Whether you use a dedicated server or Windows VPS hosting, verify the new connection before closing your existing RDP session to avoid losing remote access.
1. Change the RDP Port in the Windows Registry
You can change the RDP port manually through Registry Editor or by using PowerShell. Before making changes, ensure you have administrator privileges and access to your server's recovery console in case the new configuration prevents remote access.
Method 1: Change the RDP Port Manually
- Press
Windows + Rto open the Run dialog. - Type
regeditand press Enter to open Registry Editor.
Navigate to the following registry key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-TcpLocate the
PortNumbervalue, right-click it, and select Modify.Select Decimal, enter your preferred port number, and click OK.
Choose an unused TCP port between 1024 and 65535, and confirm that it is not already assigned to another service. For example, you can use 33899 instead of the default port 3389.
Method 2: Change the RDP Port Using PowerShell
You can also update the registry from an elevated PowerShell session.
- Open PowerShell as an administrator.
Run the following command to set the RDP port to
33899:Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -Name PortNumber -Value 33899
Replace 33899 with your chosen port number. Use the same port consistently in the registry, Windows Firewall, external firewall rules, and your RDP connection settings.
2. Open the New RDP Port in Windows Firewall
After changing the registry, create an inbound firewall rule that allows TCP traffic through the new RDP port. Otherwise, Windows Firewall may block remote connections even when the registry configuration is correct.
For detailed instructions, see How to Open a Port in Windows Firewall.
If your Windows VPS or dedicated server is protected by a provider-level firewall, cloud firewall, or network security group, update that rule as well. A reliable hosting provider may offer a separate control panel for managing these network rules.
For security, restrict the new RDP port to trusted source IP addresses whenever possible instead of exposing it to the entire internet.
3. Restart Remote Desktop Services
The new port setting may require Remote Desktop Services to restart or the server to reboot before the change takes effect.
- Type
servicesin the Windows search box and open Services.
- Find Remote Desktop Services.
- Right-click the service and select Restart if available.
Restarting Remote Desktop Services can disconnect active remote sessions. If restarting the service is unavailable or the port change does not take effect, reboot the server during an appropriate maintenance window.
Keep your existing session open until you have confirmed that the new port works.
4. Test the New RDP Connection
Open Remote Desktop Connection on your local computer.
Enter the server's IP address followed by a colon and the new port number in the Computer field.
For example:
10.10.XX.XX:33899Click Connect and enter your Windows credentials when prompted.
If the connection fails, verify the registry value, firewall rules, server status, and whether Remote Desktop Services is listening on the new port. You can check the listening port from an elevated PowerShell session:
Get-NetTCPConnection -State Listen -LocalPort 33899Replace 33899 with your configured port. If no listening connection appears, check the RDP configuration and service status before changing additional settings.
Once the new connection works, you can remove the old inbound firewall rule for port 3389 if it is no longer needed.
Conclusion
Changing the RDP port is a straightforward way to customize remote access on a Windows Server. Update the registry, allow the new port through all relevant firewalls, restart the required services, and verify the connection before ending your current session.
For businesses and traders using Windows VPS or dedicated server hosting, reliable remote access is essential for managing applications and maintaining server availability. When selecting a hosting provider, consider network security, firewall management, and remote recovery options. A USA hosting provider may be suitable if you need US-based infrastructure, but choose your USA hosting location based on your users, applications, and network requirements. Remember that changing the RDP port alone is not sufficient to secure a server; use strong authentication, NLA, restricted firewall access, and timely security updates.