Why exposing RDP directly is risky
Remote Desktop Protocol listens on port 3389 by default, and that port is one of the most scanned on the entire internet. The moment a Windows server with an open RDP port appears online, automated bots start guessing credentials against it — dictionary attacks, credential-stuffing with leaked password lists, and exploit probes for unpatched flaws. It does not matter that your server is new or obscure; scanners find it within hours, sometimes minutes.
A VPN changes the geometry of that fight. Instead of your RDP port answering knocks from every stranger on the internet, it only answers traffic arriving through your private tunnel. The scanners still exist, but they can no longer see your door, let alone knock on it. That is the core idea behind every secure-RDP-with-VPN setup: make the public internet unable to reach your RDP port in the first place.
What a VPN actually adds to an RDP session
A VPN gives you two separate protections, and it helps to keep them distinct. First, encryption in transit: everything between your device and the VPN endpoint travels inside the tunnel, so anyone on your local network, your ISP, or the path in between sees only opaque tunnel traffic — not your keystrokes, screen updates, or file transfers. RDP negotiates its own encryption too, so you end up with two layers rather than one.
Second, and more important, access control. A firewall rule that says "only the VPN's IP range may reach port 3389" turns every internet-wide scan into a dead end. Brute-force bots cannot guess a password against a port that never answers them. In practice, this second benefit does more for your security than the extra encryption, because credential guessing — not cryptanalysis — is how most RDP servers actually fall.
Three ways to combine RDP with a VPN
There is no single "correct" topology; pick the one that matches who needs access and what you are willing to maintain. All three end at the same place: the RDP port reachable only through the tunnel.
| Approach | How it works | Best for | Watch out for |
|---|---|---|---|
| VPN client + firewall whitelist | You connect to a VPN first, then open RDP. The server firewall allows port 3389 only from the VPN's IP range. | Individuals and small teams; simplest to set up | Your VPN exit IP must be stable, or whitelist a whole range |
| VPN server on the RDP host | VPN software runs on the Windows server itself. Clients dial into the VPN, then RDP to the server's private address. | Full control with no third-party VPN service | More software on the server to patch and secure |
| Dedicated VPN gateway | A separate gateway (appliance or VM) terminates VPN connections; the RDP server sits on the private network behind it. | Offices with existing network gear | Extra hardware or VM cost and complexity |
Option A: VPN client + firewall whitelist
This is the setup most solo buyers should start with, because it requires zero changes to how the RDP server itself is built — you only tighten its firewall. You subscribe to a VPN service that offers a dedicated (static) IP, or you run a small self-hosted VPN where you control the addressing. Then you edit the inbound Remote Desktop firewall rule on the server so its scope allows only that IP or range.
From then on, your workflow is: connect the VPN, then connect RDP as usual. Everything else — your strong password, Network Level Authentication, Windows updates — stays exactly as it should be. The beauty of this approach is reversibility: if the VPN ever causes trouble, you can temporarily widen the firewall scope from the hosting provider's console instead of being locked out of your own server.
Option B: running the VPN server on the RDP host
In this topology the Windows server itself terminates VPN connections. Your device dials into the server's VPN, receives a private address like 10.8.0.2, and then you open your RDP client against the server's private address (10.8.0.1, for example) rather than its public IP. The public firewall can then block port 3389 entirely, because RDP never needs to be reachable from the outside.
The trade-off is maintenance. You are now running VPN software on the same box you are trying to protect, which means keeping that software patched, choosing strong VPN credentials or certificates, and making sure the VPN service itself is not misconfigured into a wider hole than the one you closed. For a single server this is very manageable; for a fleet, a dedicated gateway (Option C) centralizes the work. Either way, the firewall rule that matters is the same: no VPN, no RDP.
Step-by-step: lock RDP behind your VPN
Follow these steps in order. They assume Option A (VPN client + whitelist), which suits most rented RDP servers, including plans with full administrator access.
- Get your VPN working first. Connect the VPN client on your own device and confirm your visible IP address changes. If the tunnel itself is flaky, fix that before touching the server.
- Note the IP or range to whitelist. With a dedicated-IP VPN, write down that single IP. With a self-hosted VPN, note the client subnet (for example, 10.8.0.0/24). This is what the firewall will allow.
- Open Windows Defender Firewall with Advanced Security on the RDP server (search for wf.msc), and go to Inbound Rules.
- Find the Remote Desktop rules (there are usually two: TCP and UDP) and open the Scope tab on each.
- Replace the remote scope. Under "Remote IP addresses", switch from "Any IP address" to "These IP addresses" and add your VPN IP or range. Apply to both the TCP and UDP rules.
- Test through the tunnel. With the VPN connected, open your RDP client and log in normally. If it works, the allowed path is correct.
- Test from outside the tunnel. Disconnect the VPN and try RDP again — the connection should now fail. This negative test is the whole point: it proves the public door is closed.
- Layer the basics on top. Enable Network Level Authentication, use a long unique password, and keep Windows updated. The VPN is your moat; these are the walls behind it.
Latency and performance: what to expect
Adding a VPN hop adds latency — there is no way around the physics — but for interactive desktop use it is usually a non-issue. The encryption itself costs a few milliseconds on modern hardware; what actually matters is geography. If your RDP server sits in one region and your VPN endpoint in another, your traffic takes a detour. Keep the VPN endpoint close to the server (same country, ideally same region) and the extra latency stays in the single-digit milliseconds, invisible during normal use.
If you notice lag after enabling the VPN, check two things before blaming encryption: the ping time to the VPN endpoint itself, and whether your VPN client is routing all traffic through the tunnel or just the RDP traffic. Split tunneling — sending only RDP through the VPN — can keep everything else on the fast direct path, though full-tunnel is simpler to reason about for security.
Mistakes that undo your VPN protection
- Leaving a second, unrestricted RDP rule active. Windows ships with separate TCP and UDP Remote Desktop rules; scope both, or the one you forgot is the one attackers find.
- Using the VPN only sometimes. If you occasionally connect directly "for speed", the public port is still answering scanners 24/7. Make the tunnel the only path, every time.
- Forgetting service accounts and automation. Backup jobs, monitoring agents, or scripts that RDP in from outside the VPN will break — plan their access before you tighten the scope.
- Whitelisting a rotating IP. Consumer VPN exit IPs change often. If RDP mysteriously stops working every few days, your whitelist is probably pointing at yesterday's address.
- Treating the VPN as the whole strategy. A leaked VPN config plus a weak Windows password still loses the server. Keep NLA, strong credentials, and patching in place.
- Never running the negative test. If you have not confirmed from outside the tunnel that port 3389 refuses connections, you have not actually verified the lockdown — you have only assumed it.
Bottom line: a VPN does not make RDP "unhackable" — nothing does. What it does is remove your server from the internet-wide guessing game entirely, which eliminates the most common way RDP servers are compromised. Pair it with the rest of our RDP security best practices and you have a setup most attackers will simply walk past.
Ready for your own RDP server?
Full admin access, dedicated IP, 24/7 support and a 3-day money-back guarantee on every plan. Pay by credit/debit card, bank transfer, Bitcoin or altcoins.
3-day money-back guarantee · Instant setup · 30+ server locations · 99% uptime SLA
Secure RDP with VPN: FAQ
Yes. A VPN wraps all traffic between your device and the VPN endpoint in its own encrypted tunnel, so your RDP session gains a second layer of encryption on top of the encryption RDP negotiates itself. Anyone observing the network between you and the VPN sees only tunnel traffic, not your keystrokes or screen content.
Yes. A VPN hides your RDP port from the internet and encrypts the path, but if someone gets inside the tunnel — or steals your VPN credentials — the Windows password is the next wall. Use long, unique passwords, and consider adding two-factor authentication on top.
Slightly, but usually not noticeably. Encryption and the extra hop add a small amount of latency, typically a few milliseconds on a decent connection. Pick a VPN endpoint geographically close to your RDP server, since distance affects latency far more than encryption overhead does.
Both approaches work. A VPN client on your own device plus a firewall whitelist on the server is simpler and needs no server-side changes. A VPN server on the RDP host gives you a private internal address to connect to, which suits teams, but it adds software you must keep patched and secured.
You can, with one caveat: most consumer VPN apps assign a shared, rotating exit IP, which makes firewall whitelisting unreliable. For an RDP lockdown you want a stable IP or a known range — either a VPN plan with a dedicated IP, or a small self-hosted VPN where you control the addressing.
No. A VPN is one strong layer, not a complete strategy. Combine it with Network Level Authentication, account lockout policies, prompt patching, and unique credentials. Defense in depth means no single failure — a leaked VPN config, a weak password, or an unpatched flaw — hands an attacker the server.
