Restore Remote Desktop to port 12230 after changing it

Changed the RDP port and now you cannot connect? Use the browser console to set Remote Desktop back to port 12230, re-add the firewall rule and get back in.

  • Intermediate
  • Windows VPS · Admin RDP
  • 5 min read

By RunRacks Team · Published

RunRacks Windows VPS and Admin RDP servers accept Remote Desktop on TCP port 12230. If you or a script changed that port, Remote Desktop now listens somewhere else and the firewall may not allow it. This guide puts it back: set the port to 12230 in the registry, make sure the firewall allows it, restart the Remote Desktop service and reconnect.

Before you start

  • Access to your Dashboard, where the server's control panel and browser console live.
  • The server's Administrator (or admin user) password, also shown in the Dashboard if you have not changed it.
  • About ten minutes.

If you can still connect on the new port, you can do every step below over Remote Desktop instead of the console. Do the firewall step first in that case, so you never lose both ports at once.

Open the browser console

  1. Sign in to the Dashboard and open your Windows service.
  2. Open the control panel and choose Console (the browser console).
  3. If the screen is dark, click inside it and press a key. To reach the login screen, use the console's Ctrl+Alt+Del button, not your keyboard shortcut.
  4. Sign in with your Windows username and password.
  5. Right-click the Start button and choose Terminal (Admin) or Windows PowerShell (Admin), depending on your Windows version.

Check the current port

Run this to see which port Remote Desktop is set to use:

PowerShell
$rdp = 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp'
Get-ItemProperty $rdp -Name PortNumber

If it already returns PortNumber : 12230, the port is not the problem. Skip to the firewall step and then see Check that Windows is listening on RDP port 12230.

Set the port back to 12230

Still in the same PowerShell window, set the value:

PowerShell
Set-ItemProperty $rdp -Name PortNumber -Value 12230 -Type DWord
Get-ItemProperty $rdp -Name PortNumber

The second line should now show PortNumber : 12230. PowerShell stores the number in decimal, so you do not need to convert it to hex as you would in Registry Editor.

If you prefer Registry Editor:

  1. Press Win + R, type regedit and press Enter.
  2. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp.
  3. Double-click PortNumber, choose Decimal, enter 12230 and click OK.

Re-add the firewall rule

Check whether a rule already allows TCP 12230:

PowerShell
Get-NetFirewallPortFilter -Protocol TCP |
  Where-Object LocalPort -eq 12230 |
  Get-NetFirewallRule |
  Format-Table DisplayName, Enabled, Direction, Action

If the list is empty, or the rule shows Enabled False or Action Block, add an allow rule:

PowerShell
New-NetFirewallRule -DisplayName "Remote Desktop (TCP 12230)" `
  -Direction Inbound -Protocol TCP -LocalPort 12230 -Action Allow

If an existing rule is disabled, you can enable it by name instead, for example Enable-NetFirewallRule -DisplayName "Remote Desktop (TCP 12230)".

You may also have a rule for the port you changed to. Leave it alone until you have reconnected on 12230, then remove it in the clean-up step.

Restart the Remote Desktop service

Windows reads the port number when the Remote Desktop Services service starts. Restart it:

PowerShell
Restart-Service -Name TermService -Force

-Force is needed because another service, the Remote Desktop Services UserMode Port Redirector, depends on it. Any open Remote Desktop sessions will drop, which is expected.

If the service does not come back, restart the whole server from the Dashboard control panel instead. That always reloads the setting.

Check it works

  1. Still in the console, confirm Windows listens on the right port:
PowerShell
   Get-NetTCPConnection -LocalPort 12230 -State Listen

You should see at least one line with LocalPort 12230 and State Listen.

  1. From your own computer, test the port:
PowerShell
   Test-NetConnection 203.0.113.10 -Port 12230
  1. Connect with Remote Desktop to 203.0.113.10:12230.

Clean up the old port

Once you are back in on 12230, remove any firewall rule you created for the other port, so it is not left open. List custom inbound rules to find it:

PowerShell
Get-NetFirewallRule -Direction Inbound -Enabled True |
  Where-Object DisplayName -like "*RDP*" |
  Format-Table DisplayName, Name

Then remove the old one by its display name, for example Remove-NetFirewallRule -DisplayName "RDP 50000". Double-check you are not deleting the 12230 rule.

Troubleshooting

  • Get-NetTCPConnection shows nothing on 12230: the service did not reload the setting. Restart the server from the Dashboard and check again.
  • Listening, but the port test from home fails: the firewall rule is missing or scoped to another IP. Check the rule's Scope tab in Windows Defender Firewall with Advanced Security.
  • Console keyboard types the wrong characters: the console uses a US layout. Look out for \, | and ', which often land on different keys.
  • Connected on 12230, but credentials fail: that is a separate issue. See Fix "Your credentials did not work".

Next steps

Was this guide helpful?

Still stuck?

Ask RunRacks AI for a quick answer, or open a ticket and our team will take a look at your server.

Troubleshooting

Fix Nginx 413 Request Entity Too Large

Nginx returns 413 Request Entity Too Large when an upload is bigger than client_max_body_size. Raise the limit for one site or the whole server, match PHP's limits, and test.

  • Beginner
  • Linux VPS
  • 5 min read

Troubleshooting

Is your ISP or router blocking port 12230? How to tell

Work out whether your internet provider, home router, parental controls or a proxy is blocking RDP port 12230, and collect the details support needs to help.

  • Intermediate
  • Windows VPS · Admin RDP
  • 5 min read