ListenPort = 51820 and one [Peer] per client, install it as a service with wireguard /installtunnelservice C:\WireGuard\wg0.conf, and allow UDP 51820 in Windows Firewall. Clients then reach the server at 10.8.0.1, for example for Remote Desktop. Microsoft’s built-in alternative is RRAS with IKEv2.
Before you start
- A VPN (virtual private network) creates an encrypted tunnel between your computer and the server. Services you only allow from the tunnel, such as Remote Desktop, are then invisible to the internet.
- This guide builds a private access VPN: clients reach the server itself through the tunnel. Routing all of a client’s internet traffic through Windows needs NAT and routing, which WireGuard for Windows does not document; for that, use RRAS or a WireGuard server on Linux.
- Keep your current Remote Desktop rules unchanged until the tunnel works, and keep the VNC console ready.
How to install WireGuard on Windows Server
1
Download WireGuard for Windows
On the server, download the installer from the official WireGuard install page (Download Windows Installer). It supports Windows 10, 11 and Server 2016, 2019, 2022 and 2025.
2
Run the installer
The installer picks the right version for your architecture, checks signatures and installs WireGuard into
C:\Program Files\WireGuard.3
Open an admin PowerShell in the WireGuard folder
How to create the keys
Each side needs a private key (kept secret) and the matching public key (shared with the other side). Run this on the server, then repeat it on each client (or on the server for the client, if you hand the client its config):=. Never send a private key over chat or email.
How to write the server config
CreateC:\WireGuard\wg0.conf (the file name, here wg0, becomes the tunnel name):
[Peer] block per client, each with its own /32 address (10.8.0.3/32, 10.8.0.4/32 …). AllowedIPs on the server is the tunnel address that client is allowed to use.
How to start the tunnel as a service
1
Install the tunnel service
WireGuardTunnel$wg0 that starts with Windows.2
Allow WireGuard through the firewall
3
Check it is running
Running and wg show should list listening port: 51820 and your peer.wireguard.exe /uninstalltunnelservice wg0.
How to set up the client
Install WireGuard on your computer (Windows, macOS, Linux, iOS or Android, all from wireguard.com/install) and import this config:AllowedIPs = 10.8.0.1/32 sends only traffic for the server through the tunnel; the rest of your internet traffic is unchanged. PersistentKeepalive = 25 keeps the tunnel open through home routers (WireGuard’s docs call 25 seconds a sensible interval). Activate the tunnel in the client app.
How to use RDP over the VPN
1
Connect through the tunnel
With the tunnel active, open Remote Desktop to
10.8.0.1 instead of the public IP.2
Limit RDP to the VPN
When that works, allow Remote Desktop only from the VPN subnet:
How to check it worked
- On the client, the WireGuard app shows a recent latest handshake and growing transfer counters.
- On the server,
wg.exe show wg0lists the client with alatest handshakea few seconds or minutes ago. - From the client,
Test-NetConnection 10.8.0.1 -Port 3389showsTcpTestSucceeded : True.
What about RRAS (Microsoft’s built-in VPN)?
Windows Server includes Routing and Remote Access (RRAS), which can act as a VPN server for Windows clients without extra software. Install it with:Frequently asked questions
Is WireGuard free on Windows Server?
WireGuard for Windows is free, open-source software from the WireGuard project. Check its licence terms on wireguard.com if you need them for your organisation.Can I change the WireGuard port?
Yes. Set any free UDP port inListenPort, use the same port in each client’s Endpoint, and change the firewall rule to match.
How do I add another client later?
Generate keys for the new client, add a[Peer] block with the next free address (for example 10.8.0.3/32) to wg0.conf, then reinstall the service: /uninstalltunnelservice wg0 followed by /installtunnelservice C:\WireGuard\wg0.conf.
Where does WireGuard store the config after installing the service?
The WireGuard manager stores configs inC:\Program Files\WireGuard\Data\Configurations, encrypted as .conf.dpapi files. Keep your own copy of wg0.conf in a safe place, because it contains the server’s private key.
Related guides
VPS and dedicated server guides
Every guide in this section.
Protect RDP from brute force
All the ways to lock down RDP.
WireGuard VPN on Linux
A full-tunnel VPN server.
Open a port in Windows Firewall
Inbound TCP and UDP rules.
Windows Server security checklist
Every hardening step.
Checked against the official WireGuard install page, WireGuard for Windows enterprise docs, the wg(8) and wg-quick(8) manuals, and Microsoft Learn: Install Remote Access as a VPN server on 4 November 2026. Key generation and config syntax were tested with wireguard-tools on Ubuntu 24.04; the Windows steps were not tested on a live Windows server.
Need Extra Help?
If you encounter any issues, our support team is ready to assist:- Live Chat: Quick assistance via our website.
- Support Ticket: Open a Ticket
- Discord: Join our Community
- Email: support@freakhosting.com
Last Updated: November 2026