Windows Server & RDP8 min read•Last updated: •By SkyRain Cloud Team

How to Change the RDP Port on Windows Server (Without Locking Yourself Out)

Every Windows server listening on port 3389 receives a steady stream of automated login attempts from the moment it gets a public IP address. Learning how to change the RDP port is one of the first things new Windows VPS owners look up, because moving Remote Desktop to another port makes most of that noise disappear from the logs.

It is a simple change, but done in the wrong order it locks you out of your own server. This guide walks through the safe sequence: open the new port in the firewall first, change the listening port, restart the service, test, and only then close 3389. It also explains what a port change does and does not protect you from.

Quick answer

To change the RDP port on Windows Server: (1) allow the new port in Windows Firewall and any provider firewall; (2) set PortNumber under HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp to the new decimal value; (3) restart the Remote Desktop Services service or reboot; (4) connect with server-ip:newport; (5) once it works, disable the old 3389 rules. Changing the port reduces automated scanning but is not a replacement for strong passwords, NLA and IP restrictions.

Before you change the RDP port

Two minutes of preparation prevents the most common lockout:

  • Know your fallback. Find the web console in your hosting control panel (a browser-based screen that works without RDP). If something goes wrong, you will fix it from there.
  • Pick a port. Use a number between 49152 and 65535, which is the dynamic range that well-known services do not claim. Avoid ports that other software on the server already uses.
  • Check for provider firewalls. Some hosts filter traffic before it reaches your VPS. If yours does, the new port must be allowed there too.
  • Tell your users. Anyone with a saved connection will need the new address. If several staff share the server, see our guide to multiple RDP sessions for managing their accounts.

To check that your chosen port is free, run this in PowerShell as Administrator. No output means nothing is listening on it:

Get-NetTCPConnection -LocalPort 53389 -ErrorAction SilentlyContinue

We use 53389 in the examples. Replace it with your own number.

Change the RDP port – SkyRain Cloud servers in India

How to change the RDP port with PowerShell (recommended)

PowerShell does each step precisely and is easy to repeat. Open Windows PowerShell as Administrator on the server.

Step 1: Open the new port in Windows Firewall first

Remote Desktop uses TCP for the connection and can also use UDP for better performance, so allow both:

New-NetFirewallRule -DisplayName "RDP custom port TCP 53389" -Direction Inbound -Protocol TCP -LocalPort 53389 -Action Allow
New-NetFirewallRule -DisplayName "RDP custom port UDP 53389" -Direction Inbound -Protocol UDP -LocalPort 53389 -Action Allow

If you already know the IP addresses you connect from, add -RemoteAddress 203.0.113.10 to each rule. That single option blocks far more attacks than the port change itself.

Step 2: Change the listening port in the registry

Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -Name PortNumber -Value 53389
Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -Name PortNumber

The second command confirms the new value. PowerShell writes it as a decimal number, which is what you want.

Step 3: Restart Remote Desktop Services

Restart-Service -Name TermService -Force

Your current RDP session will disconnect, which is expected. If the service does not restart cleanly, reboot the server from your hosting panel.

Step 4: Connect on the new port

In the Windows Remote Desktop Connection app, type the address followed by a colon and the port, for example 203.0.113.25:53389. From the command line:

mstsc /v:203.0.113.25:53389

On the Microsoft Remote Desktop app for macOS, iOS or Android, enter the same ip:port format as the PC name.

Changing the port with Registry Editor instead

If you prefer a graphical method, Microsoft documents it in Change the listening port for Remote Desktop. In short:

  1. Create the firewall rules first, in Windows Defender Firewall with Advanced Security → Inbound Rules → New Rule → Port.
  2. Run regedit and open HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp.
  3. Double-click PortNumber, select Decimal, enter the new port and click OK.
  4. Restart the server or the Remote Desktop Services service.

The most common mistake here is leaving the base on Hexadecimal. Typing 53389 in hex sets a completely different port, and you will not be able to connect.

Step 5: Close port 3389 once the new port works

Only after you have logged in successfully on the new port, disable the default rules:

Get-NetFirewallRule -DisplayGroup "Remote Desktop" | Format-Table DisplayName, Enabled
Disable-NetFirewallRule -DisplayGroup "Remote Desktop"

The first command shows which built-in rules exist on your version of Windows. The second disables them, leaving your custom rules active. Because the service no longer listens on 3389 anyway, this is mainly tidiness and a guard against the port being changed back by mistake.

StepCommand or locationUndo
Allow new portNew-NetFirewallRule … -LocalPort 53389Remove-NetFirewallRule -DisplayName "RDP custom port TCP 53389"
Change listening portRegistry value PortNumberSet it back to 3389
ApplyRestart-Service TermService -ForceRestart again after undoing
Close default rulesDisable-NetFirewallRule -DisplayGroup "Remote Desktop"Enable-NetFirewallRule -DisplayGroup "Remote Desktop"

If you get locked out

If the new port does not answer, open your provider's web console and log in locally. Then work through these checks:

  1. Is the service listening? Get-NetTCPConnection -LocalPort 53389 -State Listen
  2. Is the firewall rule enabled and on the right profile? Get-NetFirewallRule -DisplayName "RDP custom*"
  3. Was the registry value entered in decimal?
  4. Does an upstream firewall at your provider still allow only 3389?

If all else fails, set PortNumber back to 3389, re-enable the Remote Desktop rules and restart the service. Our guide to fixing Remote Desktop connection errors covers other causes.

Does changing the RDP port actually improve security?

It helps, but less than people hope. Mass scanners try port 3389 on every address, so moving away from it cuts automated attempts sharply and keeps your security logs readable. A targeted attacker, however, can scan all 65,535 ports in minutes and find RDP wherever it is. Treat the port change as noise reduction, and add the controls that actually stop attacks:

  • Restrict RDP to known IP addresses in the firewall, or put it behind a VPN.
  • Keep Network Level Authentication (NLA) enabled so users authenticate before a session starts.
  • Use long, unique passwords and rename or disable accounts attackers guess first.
  • Turn on account lockout to slow down password guessing.
  • Install updates promptly, because RDP vulnerabilities do appear.

Our full RDP security guide explains each of these with the exact settings.

Why teams run Windows on SkyRain Cloud

SkyRain Cloud Windows servers are built for this kind of control:

  • Windows Server ready to use. Plans come with Windows Server pre-installed and activated, so you log in over RDP and start working.
  • Full Administrator access. Install your own software, change the RDP port, create users and set firewall rules yourself.
  • Resources that are yours. Each plan is a private virtual machine with its own vCores, RAM and disk, not a shared terminal-server account.
  • Indian locations, Indian latency. Servers sit in India, so a remote desktop session from Mumbai, Delhi or Bengaluru feels responsive.
  • Unmetered 1 Gbps port. Updates, file transfers and browser work are not capped by a monthly data allowance.
  • Simple billing and real support. Monthly billing in rupees with UPI, net banking and cards, plus 24/7 tickets, WhatsApp and Discord.

Frequently Asked Questions

What is the default RDP port?
Remote Desktop listens on TCP port 3389 by default, and can also use UDP 3389 for faster transport.
Which port should I use for RDP?
Choose an unused port between 49152 and 65535, and check that no other software on the server uses it.
Do I need to restart the server after changing the RDP port?
You need to restart the Remote Desktop Services service (TermService) or reboot. Your current session will disconnect when you do.
How do I connect to RDP on a custom port?
Add the port to the address with a colon, for example 203.0.113.25:53389, in the Remote Desktop app or with mstsc /v:203.0.113.25:53389.
Is changing the RDP port enough to secure my server?
No. It reduces automated scanning, but you should also restrict access by IP or VPN, keep NLA enabled, use strong passwords and account lockout, and install updates.
What if I changed the port and cannot connect?
Log in through your hosting provider's web console, check the firewall rule and that the registry value was entered in decimal, or set the port back to 3389 and restart the service.

Conclusion

To change the RDP port safely, always follow the same order: firewall first, then the registry, then a restart, a test connection, and finally closing 3389. Keep your provider's web console handy as a fallback, and remember that a custom port is one layer of protection, not the whole defence.

If you need a Windows server where you control all of this, see our Windows RDP plans in India.

SkyRain Cloud Windows RDP Plans

Windows RDP servers in India with full Administrator access and a 1 Gbps unmetered uplink.

PlanvCoresRAMStorageNetworkPriceGood forBuy
RDP Plan 148 GB DDR460 GB Enterprise Disk1 Gbps, unmetered₹999/monthData entry, virtual assistants, one MetaTrader terminalOrder
RDP Plan 2616 GB DDR480 GB Enterprise Disk1 Gbps, unmetered₹1,799/monthTally Prime for small teams, several browser profiles or terminalsOrder
RDP Plan 3824 GB DDR4120 GB Enterprise Disk1 Gbps, unmetered₹2,499/monthMulti-user remote work, automation and SEO toolsOrder
RDP Plan 41232 GB DDR4160 GB Enterprise Disk1 Gbps, unmetered₹3,499/monthRemote teams, large ERP datasets, many concurrent sessionsOrder

Prices are monthly in INR as listed on the SkyRain Cloud store (verified 2026-11-23). Live stock and final price are shown at checkout.

Instant UPI • ₹649/mo
Fast KVM Cloud Provisioning