Skip to main content

How to Change the Remote Desktop (RDP) Port on Your VPS

Change the RDP listening port on your VPS to connect from restricted networks: registry steps plus firewall rules.

Remote Desktop allows remote connections to computers running Windows or Windows Server over the Remote Desktop Protocol (RDP), listening on port 3389 by default. For security or configuration purposes, you might want to change this listening port. The easiest way is QuantVPS Detect+ in your dashboard: it changes the port for you and moves it back if the new port cannot be reached. Manual steps for a VPS without Detect+ follow below.

​

When to change it: when a network you connect from blocks port 3389, or when Detect+ shows many failed sign-ins from unknown addresses. Bots scan port 3389 the most, so a random high port cuts those attempts. It does not replace a strong password.


Change the Port with QuantVPS Detect+ (Recommended)

Step 1: Open Settings › Remote Access

  1. Sign in to your QuantVPS dashboard and choose your VPS in the Selected server menu at the top.

  2. Click Detect+ in the sidebar, then click Settings.

  3. Click Remote access. It shows whether Remote Desktop is on, the port it uses and whether it is listening.

Detect+ Settings › Remote access: the Remote access table with the Remote Desktop port 3389, and the Change port button

When your VPS sees at least 10 failed sign-ins from 2 or more addresses on port 3389, a Too many unknown sign-ins? Change your port. notice appears at the top of Settings › Security with its own Change port button.

Too many unknown sign-ins? Change your port. notice with a Change port button

​

Step 2: Choose a Port

Click Change port. You can pick:

  • Suggested: a random high port from 20000 to 39999, filled in for you. Click Pick another for a different one.

  • 443: only if your network blocks other ports. Port 443 is the web (HTTPS) port, so it conflicts with a web server, reverse proxy or web app on the VPS.

  • Your own port: type 443 or any free port from 1024 to 49151 in New port.

Bots scan port 3389, the ports near it and common choices such as 2222 or 3390 much more than a random high port. Windows uses ports from 49152 up for its own outgoing connections, so those are not allowed.

Change the Remote Desktop port popup with the suggested port, Pick another, the 443 and 3389 choices, and What happens

​

Step 3: Change the Port and Reconnect

Click Change port. Then:

  • The VPS opens the new port in Windows Firewall and moves Remote Desktop to it. Your Remote Desktop session disconnects while the Remote Desktop service restarts; the VPS itself does not restart.

  • Our servers check the new port from outside. When it is reachable, Detect+ shows the new port, for example "Your Remote Desktop port is now 24817."

  • Click Download RDP file and open it to reconnect. The old RDP file will not connect. The RDP file and address in your Control Panel use the new port from then on.

  • If the new port cannot be reached from outside within 10 minutes, the VPS goes back to the old port by itself and your old RDP file works again.

To go back to the Windows default later, open Change port and click Back to 3389.

​

If You Do Not See Change Port

Change port appears once Detect+ is turned on and up to date on your VPS. If you do not see it, open a support ticket and we'll turn it on for you, or use the manual steps below.


Manual Method: Change the Port in Windows

Use these steps only on a VPS without Detect+. Throughout, replace <YourNewPort> with the port you chose (for example, 24817).

​

Choosing a Custom Port

  • Best: a random high port from 20000 to 39999 that is not a round number, such as 24817.

  • 443: only if your network blocks other ports, and only if nothing on the VPS (a web server, reverse proxy or web app) uses it.

  • Avoid: 3389 and the ports near it, 2222, 3390 and 80, which bots scan often, and ports from 49152 up, which Windows uses for outgoing connections.

​

Step 1: Open the Port in Windows Firewall

Do this first, so the new port is open before Remote Desktop moves to it.

  1. Open Windows Defender Firewall with Advanced Security.

  2. Go to Inbound Rules › New Rule.

  3. Select Port, then TCP.

  4. Enter <YourNewPort>.

  5. Allow the connection for all profiles.

  6. Name the rule (for example, "RDP Custom Port") and finish.

  7. Repeat these steps with UDP instead of TCP and the same port. Remote Desktop uses UDP for a smoother connection.

​

Step 2: Change the RDP Port in the Registry

  1. Press Win + R, type regedit, and press Enter.

  2. Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp.

  3. Right-click PortNumber and choose Modify.

  4. Choose Decimal, enter <YourNewPort>, click OK and close Registry Editor.

​

Step 3: Restart the VPS

Restart the VPS to apply the change. Restarting the Remote Desktop Services service is enough if you prefer not to restart the whole VPS.

​

Step 4: Connect Using the New Port

Once your VPS reboots, use your RDP client to connect with:

<Your-VPS-IP>:<YourNewPort>

For example, if your VPS's IP is 203.0.113.10 and you chose port 24817, you'd connect to 203.0.113.10:24817.

If you cannot connect on the new port, sign in through the console in your QuantVPS dashboard (click Request console access if you don't see it), set PortNumber back to 3389 in the same registry key and restart. If that does not work, open a support ticket and we'll help you get back in.


Further Reading

For Microsoft's official reference on changing the RDP listening port (including the PowerShell-based method), see Configure the Remote Desktop listening port on Microsoft Learn.

​

Related

​

Need Assistance?

Our support team is available 24/7. If you have any questions or run into issues, open a support ticket from your QuantVPS dashboard and we'll get back to you as quickly as possible.

Did this answer your question?