Since 2016 · 50,000+ customers · ★ 5.0 on Google Live chatWhatsAppTelegramOpen a ticket
Get started
Windows Server

How to Set Up a VPN Server on Windows Server (RRAS, SSTP and IKEv2)

How to set up a VPN server on Windows Server guide by 99RDP

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

ProtocolPortsNotes
SSTPTCP 443Works through almost any firewall because it looks like HTTPS. Needs a TLS certificate. Best for Windows clients.
IKEv2UDP 500 and 4500Fast, reconnects automatically when the network changes; good for laptops and phones. Needs a certificate.
L2TP/IPsecUDP 500, 4500, 1701Older; Microsoft has announced it will be deprecated in future Windows Server versions.
PPTPTCP 1723Insecure 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.

Diagram of a Windows Server VPN with RRAS: clients connect with SSTP over 443 and reach the internal network
RRAS VPN on Windows Server

Step 2: Configure RRAS

  1. Open Routing and Remote Access (rrasmgmt.msc).
  2. Right-click the server name → Configure and Enable Routing and Remote Access.
  3. Choose Custom configuration. (The "Remote access (dial-up or VPN)" option expects two network cards; custom works on a single-NIC VPS.)
  4. Tick VPN access and NAT, finish the wizard and click Start service.
  5. 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.
  6. 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.
Steps to set up a VPN on Windows Server: install Remote Access, configure RRAS, bind a certificate, allow users, connect
Setting it up

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.

Comparison of VPN protocols on Windows Server RRAS: SSTP, IKEv2 and L2TP/IPsec
Which VPN protocol?

Step 6: Connect a Windows client

  1. On Windows 10/11, open Settings → Network & Internet → VPN → Add VPN.
  2. VPN provider: Windows (built-in). Server name: vpn.example.com. VPN type: SSTP or IKEv2. Sign-in: user name and password.
  3. Save and click Connect.
  4. 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.

Minakshi, Server Administrator L1 at 99RDP
Written byMinakshiServer Administrator L1, 99RDP. Part of the team that runs our servers and answers support.
Keep reading

More Windows Server guides

All Windows Server guides

Need a server for this?

✓ Setup in minutes✓ Full admin access✓ 7-day refund on new services