PPTP VPN on Debian 13 and Ubuntu 26.04: Set Up WireGuard Instead
PPTP's authentication is broken, so this guide explains the risk and sets up a WireGuard VPN server on Debian 13 and Ubuntu 26.04 instead.
If you are looking for a way to run a PPTP (PPP) VPN server with pptpd on Debian or Ubuntu, the short answer is: the package still exists, but you should not deploy it. PPTP's authentication has been broken for more than a decade, and even Microsoft, which created the protocol, advises against using it. This guide explains the problem briefly and then sets up the modern equivalent, a WireGuard VPN server that routes your devices' traffic through your VPS, on Debian 13 and Ubuntu 26.04. The same steps work on Debian 12 and Ubuntu 24.04.
Why PPTP is no longer an option
- The authentication is broken. PPTP VPNs normally authenticate with MS-CHAP v2. Microsoft's Security Advisory 2743314, published in August 2012, states that exploit code exists for known cryptographic weaknesses in MS-CHAP v2 and that an attacker who intercepts the handshake can obtain the user's credentials. Microsoft did not issue a fix, because the weakness is in the protocol itself.
- Its own vendor advises against it. Microsoft's Remote Access documentation says it does not recommend PPTP "due to its lack of security features", and beginning with Windows Server 2025 a new Routing and Remote Access setup no longer accepts PPTP or L2TP connections unless an administrator re-enables them.
- Clients are disappearing. Current phone and desktop operating systems increasingly ship without a built-in PPTP client, and PPTP's use of the GRE protocol alongside TCP port 1723 fails behind many routers and carrier networks.
The pptpd package is still in the Debian 13 archive, so older tutorials that install it will appear to work. What you get is a tunnel whose login credentials can be recovered by anyone able to record the connection. For a VPN you run yourself, WireGuard is the practical replacement: it is part of the Linux kernel, has official clients for Windows, macOS, Android and iOS, and is configured with one short file per side.
What you need for WireGuard
- A server running Debian 13 or Ubuntu 26.04 with a public IPv4 address (the examples use
203.0.113.10) and a user withsudorights. - The ability to open one UDP port. The examples use 51820, the customary WireGuard port.
- A private network range for the tunnel that you do not use elsewhere. The examples use
10.8.0.0/24: the server is10.8.0.1, the first client10.8.0.2.
Step 1: Install WireGuard
The wireguard package installs the wg and wg-quick tools. iptables is used for the NAT rule and is not present on every minimal image:
sudo apt update
sudo apt install wireguard iptables
Step 2: Generate the server keys
WireGuard identifies each side by a key pair instead of a user name and password. Create the server's pair with restrictive permissions:
sudo sh -c 'umask 077; wg genkey | tee /etc/wireguard/server.key | wg pubkey > /etc/wireguard/server.pub'
Display both; you need the private key for the server configuration and the public key for every client:
sudo cat /etc/wireguard/server.key
sudo cat /etc/wireguard/server.pub
Step 3: Enable IP forwarding
The server has to pass packets between the tunnel and the internet. Enable forwarding permanently and load the setting:
echo 'net.ipv4.ip_forward = 1' | sudo tee /etc/sysctl.d/70-wireguard-routing.conf
sudo sysctl --system
Step 4: Create the server configuration
Find the name of the network interface that carries the server's internet traffic:
ip route show default
The name follows the word dev, for example eth0, ens3 or enp1s0. Then create the configuration file:
sudo nano /etc/wireguard/wg0.conf
Insert the following. Replace SERVER_PRIVATE_KEY with the contents of server.key and every eth0 with your interface name. The [Peer] block is completed in the next step.
[Interface]
Address = 10.8.0.1/24
ListenPort = 51820
PrivateKey = SERVER_PRIVATE_KEY
PostUp = iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
PostUp = iptables -I FORWARD -i %i -j ACCEPT
PostUp = iptables -I FORWARD -o %i -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
PreDown = iptables -t nat -D POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
PreDown = iptables -D FORWARD -i %i -j ACCEPT
PreDown = iptables -D FORWARD -o %i -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
[Peer]
# laptop
PublicKey = CLIENT_PUBLIC_KEY
AllowedIPs = 10.8.0.2/32
wg-quick runs the PostUp commands after bringing the interface up and the PreDown commands before taking it down, replacing %i with the interface name. The first rule hides the VPN clients behind the server's public address; the other two allow forwarded traffic even when the firewall's default forward policy is to drop it. The file contains a private key, so restrict it:
sudo chmod 600 /etc/wireguard/wg0.conf
Step 5: Create the client configuration
Each device gets its own key pair and its own address. The official WireGuard apps can generate a key pair when you create an empty tunnel and show you the public key. On a Linux client, install wireguard and generate the pair there:
umask 077
wg genkey | tee client.key | wg pubkey > client.pub
The client configuration looks like this. On Linux save it as /etc/wireguard/wg0.conf; in the apps, paste it into the tunnel editor or import it as a file.
[Interface]
PrivateKey = CLIENT_PRIVATE_KEY
Address = 10.8.0.2/24
DNS = 9.9.9.9
[Peer]
PublicKey = SERVER_PUBLIC_KEY
Endpoint = 203.0.113.10:51820
AllowedIPs = 0.0.0.0/0
PersistentKeepalive = 25
AllowedIPs = 0.0.0.0/0sends all IPv4 traffic through the tunnel. To reach only the server and other VPN clients, use10.8.0.0/24instead.DNSsets the resolver used while the tunnel is up; without it, lookups keep going to the local network's resolver, which then sees every name you visit. Use a resolver you trust. On a Linux client this line requires aresolvconfimplementation; ifwg-quickreports thatresolvconfis missing, install one or remove the line.PersistentKeepalive = 25keeps the connection alive through NAT routers.
Now put the client's public key into the [Peer] block of the server's wg0.conf in place of CLIENT_PUBLIC_KEY. Private keys never leave the machine they were generated on.
Step 6: Open the port and start the tunnel
If UFW is active on the server, allow the WireGuard port. Also allow UDP 51820 in any firewall or security group your provider puts in front of the server:
sudo ufw allow 51820/udp
Start the interface now and at every boot:
sudo systemctl enable --now wg-quick@wg0
On a Linux client, bring the tunnel up with sudo wg-quick up wg0 and down with sudo wg-quick down wg0. In the apps, switch the tunnel on.
Step 7: Verify
On the server, show the interface and its peers:
sudo wg show
Once the client has connected, its peer entry shows a latest handshake time and transfer counters. From the client, ping the server's tunnel address:
ping -c 3 10.8.0.1
Then open any "what is my IP" page on the client; it should report 203.0.113.10, the server's address.
Add more devices
Give each additional device its own key pair and the next free address, and append one block per device to the server's wg0.conf:
[Peer]
# phone
PublicKey = SECOND_CLIENT_PUBLIC_KEY
AllowedIPs = 10.8.0.3/32
Apply the change without interrupting existing tunnels:
sudo systemctl reload wg-quick@wg0
A reload adds and removes peers. Changes to Address or the PostUp lines need sudo systemctl restart wg-quick@wg0. To revoke a device, delete its [Peer] block and reload.
Troubleshooting
- No handshake appears in
wg show: the UDP port is blocked somewhere between client and server, theEndpointis wrong, or a public key was pasted on the wrong side. WireGuard stays silent towards packets it cannot authenticate, so a wrong key looks exactly like a blocked port. - Handshake works but there is no internet access: check
sysctl net.ipv4.ip_forward(it must be 1) and that the interface name in theMASQUERADErule matches the output ofip route show default. - Sites load by IP address but not by name: the
DNSline is missing or points to a resolver the client cannot reach. - Some traffic bypasses the tunnel: the example routes IPv4 only. A client that also has IPv6 connectivity keeps using it directly. Either give the tunnel IPv6 addresses and add
::/0toAllowedIPs, or disable IPv6 on the client while connected.
Frequently asked questions
PPTP is only for streaming or bypassing a filter. Does the weakness matter?
The tunnel carries everything your device sends, including logins and session cookies for other services, and the VPN password itself can be recovered from a recorded handshake. Since WireGuard is no harder to set up, there is no situation where choosing PPTP for a new installation makes sense.
Can I connect with the VPN client built into Windows, Android or iOS?
Not to WireGuard. It uses its own protocol, so each device needs the WireGuard app, which is free and available from the WireGuard installation page and the official app stores. If you must serve devices that can only use a built-in client, look at IKEv2 or SSTP rather than PPTP.
Does WireGuard work over TCP or on port 443?
WireGuard uses UDP only. You can choose any UDP port with ListenPort, including 443, but it cannot use TCP. On networks that block all UDP you need a different VPN protocol.
How do I get the configuration onto a phone?
The mobile apps can import a configuration file or scan a QR code. On a Linux machine with the qrencode package, qrencode -t ansiutf8 < client.conf prints the code in the terminal. Treat the file and the code like a password: both contain the client's private key.