Insights
RDP Port: Default, Custom Listener and Gateway Ports
RDP defaults to TCP 3389 and can also use UDP 3389. Learn gateway ports, how to check the listener, and how to change it with recovery steps.

On this page
RDP uses TCP port 3389Opens in a new tab by default. Modern RDP can also use UDP port 3389 for a more responsive sessionOpens in a new tab. An administrator can configure a custom listener on a different port. Connections that go through RD Gateway usually reach the gateway on TCP 443, with UDP 3391 available for its UDP transport.
In short:
- Direct connection: TCP 3389 (and optionally UDP 3389) on the RDP host.
- Through RD Gateway: TCP 443 (and optionally UDP 3391) on the gateway.
- Changing the port: update the listener, the firewall and the client together.
TCP is the baseline, UDP adds responsiveness
For a direct connection, the port that matters is the destination port on the RDP host. It isn't the client's source port. And a default port doesn't mean every Windows computer has an active RDP listener.
| Direct RDP transport | Default destination port | Role |
|---|---|---|
| TCP | 3389 | Baseline connection to the RDP host |
| UDP | 3389Opens in a new tab | Optional transport that improves responsiveness when enabled and permitted |
Start troubleshooting a direct connection by checking that you can reach the host's configured TCP port. If UDP is blocked, the session can still work over TCP, so a failed UDP check doesn't by itself explain a complete connection failure.
Allow the intended transport only from approved access paths and source addresses. If TCP is reachable but the session still fails, look at RDP configuration, authentication and authorization instead of assuming another port needs to be opened.
Gateway ports are different from the host's listening port
The connection path decides which destination your client has to reach. A direct client contacts the host's RDP listener. A gateway client contacts RD Gateway, which then connects to the internal host on that host's configured RDP port.
| Connection path | Client destination | Host-side listener |
|---|---|---|
| Direct, default listener | RDP host on TCP 3389 (UDP 3389 when enabled) | Default listener on 3389 |
| Direct, custom listener | RDP host on the port the administrator configured | Configured RDP port |
| RD Gateway over HTTPS | Gateway on TCP 443Opens in a new tab | Internal host's configured RDP port |
| RD Gateway UDP transport | Gateway on UDP 3391Opens in a new tab | Internal host's configured RDP listener |
For a custom direct listener, enter the destination as hostname:port. The client has to use the new port, and the firewall has to allow itOpens in a new tab. Allowing only the default port won't reach a listener configured somewhere else.
With RD Gateway, check both network segments: client to gateway, and gateway to internal host. A successful connection to TCP 443 doesn't prove the gateway can reach the desktop. In the same way, UDP 3391 is the gateway's UDP path. It isn't a replacement default listener on every Windows desktop.
Build firewall permissions around the path you actually use. Keep gateway-facing rules separate from internal host rules, and don't pad a general RDP allowlist with unrelated ports.
Check the configured port and the active listener
On a Windows RDP host you're authorized to administer, look at the configuration first and the live state second. These checks are read-only. They don't change the listening port, restart the host or touch the firewall.
- Inspect the configured port. Open Registry Editor and go to
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp. OpenPortNumber, switch the display to Decimal, and note the value without changing it. Cancel the dialog when you're done. - Inspect current endpoints. Run
netstat -a -n -oin a Windows terminal. Find the TCP local endpoint with the port you just noted and check whether it's markedLISTENING. - Identify the owning process and service. Take the PID from
netstat, find that process in Task Manager and look at its services. This endpoint-to-process checkOpens in a new tab helps you tell the intended listener from some other process using the port. - Compare with the client's path. Confirm whether the client connects straight to this host or through RD Gateway. The gateway's external port and the host's internal listener serve different parts of the connection.
The registry value shows the configured port, not that the service is listening right now. A matching listener shows the port is available locally. It doesn't prove remote reachability, successful sign-in, authorization or certificate validation.
If the configured port and the active listener don't match, check whether Remote Desktop is enabled and whether a restart is pending from an earlier change. If the listener matches but the client still can't connect, check the route and the firewall rules. None of these checks needs a rollback, and a missing listener is never a reason to open more firewall ports.
Changing the port requires a matching firewall rule
Changing the listening port is an optional administration task, not something you need in order to use RDP privately. Windows lets you change the RDP listening port in the registryOpens in a new tab, but the listener, the firewall rules and the client destination must all stay in line.
Only go ahead with authorization, a registry backup and a maintenance window. Have console or out-of-band recovery access ready first, because a wrong port or rule can lock you out remotely.
- Record the original configuration. Save the current decimal
PortNumberand the relevant firewall settings. Pick an unused port and check existing listeners before assigning it. - Prepare narrowly scoped permissions first. Set up the firewall before changing the RDP portOpens in a new tab. Allow the new port through the host firewall and any network firewall in between, limited to approved private sources. Include UDP only if you intend to use it and it's enabled.
- Change the listener value. In Registry Editor, open
PortNumberat the path above, choose Decimal and enter the new port. Keep your recorded original value and backup within reach. - Restart and reconnect. Restart the host during the maintenance window, then connect using
hostname:port. If nothing responds, check the active listener again. - Validate before removing old permissions. Confirm that an authorized session works through the intended private path. Then remove rules you no longer need, including old rules for port 3389Opens in a new tab.
If the new connection fails, use your recovery access to restore the original registry value and firewall rules, then restart again. Don't keep widening access rules to make up for a listener change you haven't confirmed.
A nonstandard port can cut down on routine scanning noise, but it can still be found and attacked if it's exposed publiclyOpens in a new tab. Treat renumbering as a configuration choice, not a substitute for restricting access.
Keep RDP reachable through a private access path
Use an authorized private network path or a properly administered RD Gateway. Don't expose the host's RDP listener directly to the public internet. Publishing TCP 3389 publicly is a high-risk choiceOpens in a new tab, and moving the listener to another port doesn't remove that exposure.
For a default direct connection, the network requirement is a route to TCP 3389 on the targetOpens in a new tab. A routed private connection doesn't need public port forwarding for each host. When devices sit on separate networks, give them an appropriate access path. That requirement comes from your network layout, not from the client's Windows version.
Keep network reachability, host firewall permission and RDP authentication separate when you diagnose a failure. A working route can't override a host firewall restriction, and an open TCP port can't prove an account is allowed to sign in. Keep the host patched, use Network Level Authentication and limit access to approved accounts.
If you need a private device connection, doxx.net is a private network with firewall controls. Create an accountOpens in a new tab, download the appOpens in a new tab and connect your devices. You'll still configure Windows RDP, host firewall scope and account permissions separately. The private network is an access path. It isn't an RDP server, an RD Gateway or a replacement for endpoint security.