
Windows Server has a built-in VPN server: the Remote Access role with Routing and Remote Access Service (RRAS). It lets Windows, macOS and mobile devices connect securely to your server or office network without third-party software. This guide shows how to install and configure RRAS on Windows Server 2019, 2022 or 2025 (including a single-network-card VPS), which VPN protocol to choose, how to set user permissions and firewall ports, and how to connect a client.
Quick answerInstall the role with
Install-WindowsFeature RemoteAccess, DirectAccess-VPN, Routing -IncludeManagementTools
then open rrasmgmt.msc, choose Configure and Enable Routing and Remote Access → Custom configuration → VPN access + NAT, set an IP address pool, allow dial-in for your users, open TCP 443 (SSTP) or UDP 500/4500 (IKEv2), and connect from Windows under Settings → Network & Internet → VPN.
Choose a VPN protocol
| Protocol | Ports | Notes |
|---|---|---|
| SSTP | TCP 443 | Works through almost any firewall because it looks like HTTPS. Needs a TLS certificate. Best for Windows clients. |
| IKEv2 | UDP 500 and 4500 | Fast, reconnects automatically when the network changes; good for laptops and phones. Needs a certificate. |
| L2TP/IPsec | UDP 500, 4500, 1701 | Older; Microsoft has announced it will be deprecated in future Windows Server versions. |
| PPTP | TCP 1723 | Insecure and also being deprecated. Don't use it. |
Use SSTP if your clients are Windows and you want the fewest firewall problems, or IKEv2 for mixed devices.
Step 1: Install the Remote Access role
In Server Manager → Add Roles and Features, select Remote Access, then on the Role Services page tick DirectAccess and VPN (RAS) and Routing. Or in PowerShell as administrator:
Install-WindowsFeature RemoteAccess, DirectAccess-VPN, Routing -IncludeManagementTools
No restart is usually required.
Step 2: Configure RRAS
- Open Routing and Remote Access (
rrasmgmt.msc). - Right-click the server name → Configure and Enable Routing and Remote Access.
- Choose Custom configuration. (The "Remote access (dial-up or VPN)" option expects two network cards; custom works on a single-NIC VPS.)
- Tick VPN access and NAT, finish the wizard and click Start service.
- Right-click the server → Properties → IPv4, select Static address pool and add a private range that doesn't clash with your clients' home networks, for example
10.99.0.10–10.99.0.50. - Under IPv4 → NAT, add your public network interface and select Public interface connected to the Internet with Enable NAT on this interface, so VPN clients can reach the internet through the server.
Step 3: Install a certificate (for SSTP or IKEv2)
Clients only trust the VPN if its certificate matches the server name they connect to and comes from a trusted authority.
- Point a DNS name (for example
vpn.example.com) at the server. - Get a certificate for that name from a public CA (Let's Encrypt works with a tool such as win-acme) and install it in the Local Computer → Personal store.
- In RRAS server Properties → Security → SSL Certificate Binding, select the certificate, then restart the RRAS service.
A self-signed certificate works only if you install it as trusted on every client, which is fine for a quick test but awkward in practice.
Step 4: Allow users to connect
For local accounts, open Computer Management → Local Users and Groups → Users, open the user, and on the Dial-in tab select Allow access. In an Active Directory domain, set the same option in the user's properties, or better, create a Network Policy Server (NPS) policy that allows a VPN security group.
Use strong passwords: the VPN is reachable from the internet.
Step 5: Open the firewall ports
The role adds Windows Firewall rules automatically. Make sure your provider's firewall or security group also allows the protocol you chose:
- SSTP: TCP 443
- IKEv2: UDP 500 and UDP 4500
If IIS also runs on port 443 on the same server, SSTP and the website will conflict; use IKEv2 or a separate server.
Step 6: Connect a Windows client
- On Windows 10/11, open Settings → Network & Internet → VPN → Add VPN.
- VPN provider: Windows (built-in). Server name:
vpn.example.com. VPN type: SSTP or IKEv2. Sign-in: user name and password. - Save and click Connect.
- Check the connection in the RRAS console under Remote Access Clients, and on the client with
ipconfig(you should see an address from your pool).
Best practices
- Use SSTP or IKEv2 only; disable PPTP and L2TP ports in Ports → Properties.
- Restrict VPN access to a dedicated security group, and add MFA with NPS extensions if you use Microsoft Entra ID.
- Keep the server patched and monitor the RRAS and Security event logs for failed logins.
- For a simpler, very fast alternative, consider WireGuard for Windows, which runs on Windows Server as well.
Frequently asked questions
Does Windows Server have a built-in VPN server?
Yes. The Remote Access role with RRAS provides SSTP, IKEv2, L2TP and PPTP VPN connections.
Which VPN protocol should I use on Windows Server?
SSTP for Windows clients behind strict firewalls, IKEv2 for mobile and mixed devices. Avoid PPTP.
Can I run a VPN server on a Windows VPS with one network card?
Yes. Choose Custom configuration with VPN access and NAT in the RRAS wizard.
Why does my VPN connect but I can't reach the internet?
NAT isn't enabled on the public interface in RRAS, or the client's IP pool overlaps with its local network.


