How to Change Remote Desktop Port in Windows 11
- 2 steps
- Needs administrator rights
Changing the Remote Desktop port in Windows 11 moves incoming connections off the default port 3389 to a number you choose. Remote Desktop is the built-in Windows tool for controlling one PC from another device.
The change takes about five minutes: one registry edit, one firewall rule and a restart.
Change the Remote Desktop port by editing PortNumber in Registry Editor. Go to 🗝️HKEY_LOCAL_MACHINE\
Why change the Remote Desktop port?
Moving away from port 3389 makes it harder for attackers to find your computer. That number is the standard address Remote Desktop uses by default, and automated scanners check it first.
Check two things before you start. A Windows 11 PC can accept incoming Remote Desktop connections only if it runs the Pro, Enterprise or Education edition of a currently supported Windows 11 version (25H2 or 26H2). Windows 11 Home can connect out to other PCs but cannot host.
Also confirm that Remote Desktop is switched on under Settings System Remote Desktop. If the toggle is missing, the PC is probably running Home.
What happens when done?
Once you change the port and update the firewall, the computer stops listening on port 3389. Incoming remote connections arrive only on the new custom port, so every device that connects must include that number.
Pick a number between 1024 and 65535 that no other service on the PC uses. Avoid well-known ports such as 80, 443 or 445. Write the number down before you begin, because you will need it in the registry, in the firewall rule and on every client.
Step 1Back Up Your Registry (Required)
Once the Registry Editor is open (the next section shows how), go to File Export, choose a name and a location, and save the file. Your Documents folder works well. If something goes wrong later, double-click the exported file to restore the old values.
Step 2Change the Port in Registry Editor
This part changes the port number itself. Sign in with an administrator account first, because the Registry Editor cannot save changes under a standard account.
- Click the Search icon and type
regeditto open the Registry Editor. If Windows shows a User Account Control prompt, click Yes. The Registry Editor window should now open. - Navigate to this path:
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp. Paste it into the address bar at the top of the Registry Editor, or expand the folders in the left pane one by one. When you reach the last key, its values appear in the right pane.

- Find the
PortNumberentry on the right side. Its data shows the default port, but the editor displays it in hexadecimal (a base-16 number format) at first, typically as 0x00000d3d (3389). - Right-click the entry and select Modify. An Edit DWORD (32-bit) Value box opens.
- Select the Decimal option under Base. Do this before you type anything. If you leave it on Hexadecimal, Windows reads your number as a different port.
- Type your new port number (for example, 5555) in the Value data box and click OK. The entry in the right pane should now show your new number in brackets.
That’s it for the registry. The new port is saved, but Windows does not use it until the PC restarts.

Step 3Update Windows Firewall
The built-in Remote Desktop firewall rule covers only the old port, so you need a new inbound rule (a rule for traffic coming into the PC) for your custom port. The rule allows TCP connections on the new number across all network profiles.
- Search for Windows Firewall with Advanced Security in the Start menu and open it. It needs administrator rights.
- Click Inbound Rules in the left pane, then click New Rule on the right. The New Inbound Rule Wizard opens.
- Select Port, click Next, and choose TCP.
- Select Specific local ports, enter your new port number and click Next.
- Select Allow the connection and click Next.
- Leave Domain, Private and Public all ticked and click Next.
- Give the rule a name you will recognize, such as “RDP custom port”, and click Finish. The new rule should appear in the Inbound Rules list.
That’s it for the firewall. Windows now accepts TCP traffic on your new port on every network profile.
If you connect from outside your home or office network, change the port-forwarding rule on your router so it points to the new port. The router sits outside Windows, so the exact steps depend on the model.
Step 4Verify and Connect
- Select Start, then Power Restart. The PC reboots and Remote Desktop starts on the new port.
- Sign in, then open PowerShell as an administrator and check the active ports. The PC should be listening on your new port, and nothing should be listening on 3389.
You should now have a PC that accepts Remote Desktop connections only on your custom port.
To connect from a client device, include the new port in your connection settings: 192.168.1.50:5555.
If a connection fails with a certificate mismatch, install update KB5132061 (released Nov 9, 2026) first. Microsoft says it fixes Remote Desktop connections that failed on the client because of a certificate mismatch after the October 2026 non-security preview update.
If you cannot install that update yet, check that the port in the registry and in the firewall rule match. Also confirm that you chose Decimal when you entered the number, and that the client address includes the new port.
To undo the change, set the port value back to 3389 in Decimal, then restart. You can also disable or delete the custom firewall rule. The built-in Remote Desktop rules work again for 3389.
Summary
A custom port only hides the PC from bots that scan the default number, so a determined attacker can still find it. Keep Network Level Authentication turned on and use strong passwords. If you need access from the internet, set up a VPN so the port is never exposed directly.
Have a question about this guide?
Answered by AI from this guide. Good questions may be added to this page — please don't include personal details.
Did this guide fix your problem?
About the Author
Richard
Tech Writer, IT Professional
Richard is a writer at Geek Rewind who turns complex IT tasks into clear, step-by-step guides. He draws on years of hands-on experience in system administration and enterprise IT operations, focusing on Windows, Linux and WordPress: the problems people actually run into, and the fixes that work. His server and WordPress guides come from systems he runs himself. Richard builds and maintains the platform behind Geek Rewind, from its Ubuntu servers and Nginx configuration to its custom WordPress plugins. Many new tutorials start with readers' questions, and he's always glad to answer them in the comments.
No comments yet — be the first to share your thoughts!