What RD Gateway does

RD Gateway is a Windows Server role that tunnels RDP sessions inside HTTPS (port 443). Instead of every internal server exposing RDP to the internet, clients connect to the gateway — which authenticates them, checks authorization policies, and proxies the session to the right internal host. The security win is architectural: one hardened, monitored entry point instead of dozens of exposed 3389 listeners, and users connect with the built-in Remote Desktop client, no VPN software required.

Typical deployments: companies giving staff RDP access to office servers from home, MSPs managing client servers, and anyone who wants remote desktop without punching RDP holes through the perimeter firewall for every box.

Prerequisites

  • Windows Server (2016 or newer recommended) joined to your domain, with a static internal IP.
  • A public DNS name pointing at the gateway, e.g. rdg.example.com — clients connect to a name, and the SSL certificate must match it.
  • A trusted SSL certificate for that name (public CA or your internal PKI — details below).
  • Network Policy Server (NPS) — installed automatically with the role; it evaluates the authorization policies.
  • Domain user accounts for the people who'll connect, organized into groups for policy targeting.

Installing the role

  1. Open Server Manager → Manage → Add Roles and Features.
  2. Choose Remote Desktop Services installation → Standard deployment (or a role-based install if you only want the gateway).
  3. Select the RD Gateway role service and complete the wizard on your chosen server.
  4. After install, open Server Manager → Remote Desktop Services → Overview and confirm the gateway server appears in the deployment.
  5. Reboot if prompted — role services bind during startup.

SSL certificate

The gateway's certificate is its identity — clients must trust it or they'll see warnings (and should refuse to connect). You have two legitimate options:

  • Public CA certificate (recommended for internet-facing gateways): buy a standard TLS certificate for your gateway DNS name from any public CA, import it into the server's Computer certificate store, and bind it in the RD Gateway Manager under SSL Certificate.
  • Internal PKI certificate: fine for purely internal use, but every client device must trust your internal CA root — manageable for domain-joined machines via Group Policy, painful for BYOD.

Set a renewal reminder: an expired gateway certificate is a company-wide outage for remote workers. Bind the renewed cert in RD Gateway Manager before the old one lapses.

Laptop at home HTTPS 443 RD Gateway auth + policies rdg.example.com File server internal only App server internal only Workstation internal only One public entry point; internal servers never touch the internet directly.
Fig. 1 — The gateway pattern: clients reach one HTTPS endpoint; the gateway proxies to internal RDP hosts.

CAP and RAP policies

Authorization in RD Gateway is two policies, evaluated in order:

  • CAP — Connection Authorization Policy: who may connect through the gateway. Typically: members of an AD group (e.g. "Remote Desktop Users"), using password or smart-card auth, optionally with device or time conditions.
  • RAP — Resource Authorization Policy: where they're allowed to go. Typically: an AD group of computers, or a specific list of internal hosts.

Create them in RD Gateway Manager → Policies. The secure pattern: a CAP per user group, and a RAP per group limited to only the servers that group needs — accountants reach the accounting server, not the domain controllers. Test with a non-admin account; admins testing their own access prove nothing about the policies.

PortDirectionPurpose
443 (TCP)Internet → gatewayHTTPS tunnel — the only public port needed
3389 (TCP/UDP)Gateway → internal hostsRDP to backend servers (internal only)
3391 (UDP)Internet → gateway (optional)UDP transport for better performance
RPC / AD portsGateway → domain controllersAuthentication and policy lookup

Firewall and ports

The perimeter firewall needs exactly one inbound rule for basic operation: TCP 443 to the gateway. Add UDP 3391 if you want the UDP transport (recommended — it noticeably smooths sessions). Internally, the gateway needs RDP (3389) outbound to the backend hosts and AD ports to the domain controllers. The backend servers need no internet exposure at all — that's the point. If you're also changing backend RDP ports, align the RAP targets and client files; our registry guide covers the PortNumber value.

🔐Certificatetrusted TLS 👥CAPwho connects 🖥️RAPwhere to 🧱Firewall443 in Certificate, CAP, RAP, firewall — miss one and the gateway fails closed (safely, but uselessly).
Fig. 2 — The four things that must all be right: trusted certificate, CAP, RAP, and the 443 firewall rule.

Client configuration

On the user's machine, open Remote Desktop Connection → Advanced → Settings (under "Connect from anywhere"):

  1. Select "Use these RD Gateway server settings".
  2. Enter the gateway's public DNS name (rdg.example.com).
  3. Set logon method to "Ask for password (NTLM)" or your chosen method, matching the CAP.
  4. Optionally check "Bypass RD Gateway server for local addresses" so office-LAN connections go direct.
  5. Save it all as an .rdp file (gatewayhostname:s: + gatewayusagemethod:i:2) and distribute — see our .rdp file guide for the exact lines.

Verify and harden

Test from outside the network with a non-admin user account: connect to an allowed server (should work), then try a server outside the RAP scope (should be denied — proving the policy, not just connectivity). Check the gateway's event logs for the connection entries. Hardening extras: enforce NLA end-to-end, put the gateway behind MFA if your identity setup supports it, keep the server patched (it's internet-facing), and monitor the logs for brute-force patterns against the 443 endpoint.

Gateway failures and how to fix them

Gateway setups fail in predictable ways. Diagnose in this order — certificate, network, policy, authentication, transport:

  • Certificate warnings. The name on the certificate must exactly match the DNS name clients type. A mismatch — or an expired cert — produces warnings users should never click through. Rebind the correct certificate in RD Gateway Manager and set that renewal reminder.
  • Nothing reaches the gateway. Confirm TCP 443 is open on the perimeter firewall and that the client's network allows outbound 443 to your host. Test from a second network (a phone hotspot works) to separate server problems from client-network problems.
  • "Denied by policy" errors. This is CAP/RAP doing its job — or misconfigured. Check the gateway's event logs (Event Viewer → Applications and Services Logs → Microsoft → Windows → TerminalServices-Gateway → Operational), which record each authorization decision. Most denials trace to a RAP scope that doesn't include the target server, or a user who isn't in the CAP group.
  • Authentication fails for everyone. Check the gateway's clock: Kerberos and NTLM break when the server's time drifts from the domain controllers. Time sync is the unglamorous fix behind many "suddenly nobody can log in" incidents.
  • Sessions connect but feel sluggish. The UDP transport (port 3391) may be blocked, forcing everything over TCP. Open it on the firewall and compare — the difference is usually obvious.

One more: the "bypass gateway for local addresses" client option confuses office users whose laptops roam between LAN and home. If on-site staff report intermittent failures, check whether their client is trying the gateway from inside the network instead of connecting directly.

Ready for your own RDP server?

Full admin access, dedicated IP, 24/7 support and a 3-day money-back guarantee on every plan.

Shared Servers$6/mo
Dedicated Server$165/mo
Get Started

3-day money-back guarantee · Full admin RDP · Dedicated IP · 24/7 support

rdp gateway server setup: FAQ

It's a Windows Server role (RD Gateway) that tunnels RDP sessions inside HTTPS on port 443. Clients connect to the gateway, which authenticates them, checks authorization policies, and proxies the session to internal RDP servers — so no internal server needs direct internet exposure.

Yes. The gateway presents a TLS certificate for its public DNS name, and clients must trust it. Use a public CA certificate for internet-facing gateways; an internal PKI certificate works only if every client trusts your internal root.

CAP (Connection Authorization Policy) controls who may connect through the gateway — typically members of an AD group. RAP (Resource Authorization Policy) controls which internal servers they're allowed to reach. Together they define who can go where.

Inbound from the internet: TCP 443 (HTTPS tunnel), plus UDP 3391 optionally for better session performance. Internally the gateway needs RDP (3389) to backend hosts and AD ports to domain controllers. Backend servers need no public ports at all.

Yes — that's its main appeal. Users connect with the built-in Remote Desktop client over HTTPS, with no VPN software to install or maintain. The gateway becomes your single hardened entry point instead of a VPN concentrator.

In Remote Desktop Connection: Advanced tab → Settings → 'Use these RD Gateway server settings' → enter the gateway DNS name. Save the connection as an .rdp file (gatewayhostname and gatewayusagemethod lines) to distribute identical settings to the team.