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
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
- Sign in to the Dashboard and open your Windows service.
- Open the control panel and choose Console (the browser console).
- 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.
- Sign in with your Windows username and password.
- Right-click the Start button and choose Terminal (Admin) or Windows PowerShell (Admin), depending on your Windows version.
The console sends keystrokes one at a time, so pasting may not work. Type the commands carefully. They are kept short on purpose.
Check the current port
Run this to see which port Remote Desktop is set to use:
$rdp = 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp'
Get-ItemProperty $rdp -Name PortNumberIf 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:
Set-ItemProperty $rdp -Name PortNumber -Value 12230 -Type DWord
Get-ItemProperty $rdp -Name PortNumberThe 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:
- Press Win + R, type
regeditand press Enter. - Go to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp. - Double-click PortNumber, choose Decimal, enter
12230and click OK.
Re-add the firewall rule
Check whether a rule already allows TCP 12230:
Get-NetFirewallPortFilter -Protocol TCP |
Where-Object LocalPort -eq 12230 |
Get-NetFirewallRule |
Format-Table DisplayName, Enabled, Direction, ActionIf the list is empty, or the rule shows Enabled False or Action Block, add an allow rule:
New-NetFirewallRule -DisplayName "Remote Desktop (TCP 12230)" `
-Direction Inbound -Protocol TCP -LocalPort 12230 -Action AllowIf 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:
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 you are doing this over Remote Desktop rather than the console, this command disconnects you. Make sure the firewall rule for 12230 exists first.
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
- Still in the console, confirm Windows listens on the right port:
Get-NetTCPConnection -LocalPort 12230 -State ListenYou should see at least one line with LocalPort 12230 and State Listen.
- From your own computer, test the port:
Test-NetConnection 203.0.113.10 -Port 12230- 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:
Get-NetFirewallRule -Direction Inbound -Enabled True |
Where-Object DisplayName -like "*RDP*" |
Format-Table DisplayName, NameThen 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
- Learn when the console is the right tool: When to use the browser console.
- Recover from other firewall mistakes: Fix a firewall lockout on Remote Desktop.
- Read why RunRacks uses this port: RunRacks RDP port 12230.
- Compare Windows VPS plans if you need more servers.
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.
Related guides
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
Troubleshooting
Fix "Your credentials did not work" in Remote Desktop
Fix rejected RDP logins: username format, the right password, stale saved credentials, account lockout and Remote Desktop permissions.
- Beginner
- Windows VPS · Admin RDP
- 3 min read