OpenVPN vs WireGuard: Which Should You Run on a VPS
OpenVPN vs WireGuard comes down to where you run it and what your network blocks. For most people on a VPS, run WireGuard: it is faster, simpler to configure, and built into the Linux kernel since version 5.6. Pick OpenVPN when you need TCP port 443 to get through a strict network, username/password or LDAP/RADIUS logins, or your VPS cannot load the WireGuard module.
On this page
This guide has no affiliate links in the comparison. VPS prices are read daily from the providers; protocol facts come from the official docs we read on Nov 19, 2026.
If you have not bought the server yet, this decision belongs in your new VPS setup checklist. A VPN is one of the first things people put on a fresh box. Whichever protocol you choose, it needs one firewall rule before it works; that part is covered in our UFW firewall guide.

WireGuard vs OpenVPN at a glance
- Where it runsIn the Linux kernel (since 5.6)
- TransportUDP only; examples use port 51820
- CryptoFixed: Curve25519, ChaCha20, Poly1305, BLAKE2s
- CodebaseUnder 4,000 lines for the Linux version
- LoginsKey pairs
- Best forPersonal VPN, speed, simple setup
What each one is
WireGuard is a modern VPN protocol built into the Linux kernel. Its own site calls it a “fast, modern, secure VPN tunnel”. It is deliberately small: the WireGuard paper says it “can be simply implemented for Linux in less than 4,000 lines of code”. It has one transport (UDP) and a fixed set of modern cryptography. Kernels older than 5.6 need a separate package, which the WireGuard install page lists; every current Ubuntu release already has it.
OpenVPN is the older, more flexible option. Its first private release was in 2001 and its first public release in 2002, per openvpn.net. It runs as a userspace program that reads from a TUN device. It can carry its tunnel over UDP or TCP, on any port you choose. That flexibility — TCP 443, OpenSSL cipher choice, and a mature login ecosystem — is why it is still common in companies.
WireGuard vs OpenVPN: speed
WireGuard is usually the faster of the two, and the reason is design rather than a magic setting. It runs in the kernel, so a packet stays in kernel space. Classic OpenVPN runs in userspace and moves each packet through a TUN device, which adds a copy and a context switch per packet. We have not run our own throughput tests, so we publish no speed numbers here. Third-party figures vary a lot with CPU, network and build.
OpenVPN has narrowed the gap. Since version 2.6, it supports Data Channel Offload (DCO), a kernel module that “processes VPN traffic directly in the operating system instead of passing it back and forth through a separate application” (OpenVPN). OpenVPN’s DCO tutorial installs it as a separate module (openvpn-dco-dkms on Ubuntu and Debian). DCO is newer and optional; WireGuard gets the kernel path by default.
Where speed matters most is weak hardware: phone batteries, and a small VPS carrying many tunnels.
Edge · high weightWireGuardIt is in-kernel by default; OpenVPN needs the optional DCO module to get the same path.
WireGuard vs OpenVPN: security
Both protocols are considered secure. WireGuard’s case is its small codebase and fixed cryptography. Its homepage contrasts it with “behemoths like *Swan/IPsec or OpenVPN/OpenSSL, in which auditing the gigantic codebases is an overwhelming task”. It uses Curve25519 for key exchange, ChaCha20 and Poly1305 for encryption, and BLAKE2s for hashing (protocol page). There are no old cipher options to misconfigure. The protocol has also been formally verified with tools such as Tamarin and CryptoVerif.
WireGuard’s security case is a codebase one person can review. Source: wireguard.com, captured Nov 20, 2026.
OpenVPN’s case is age: more than two decades in production, with the TLS and OpenSSL tooling that companies already know. Its strength and weakness are the same thing. Ciphers are negotiable, so a good configuration is secure and a careless one can leave a weak option enabled. That is an administrator risk more than a protocol flaw.
Edge · medium weightTieWireGuard wins on codebase size and formal verification; OpenVPN wins on track record. Security comes down to how you configure either one.
Will your VPS run WireGuard?
This is the question most VPN guides skip, and for VPS users it often decides the answer. Kernel WireGuard needs the kernel module, and not every VPS can load one.
- KVM and other full-virtualisation VPS — the normal case — run your own kernel. On Ubuntu 24.04,
modprobe wireguardjust works. (New to the terms? See what a VPS is.) - OpenVZ and LXC container VPS share the host’s kernel. Proxmox’s container docs say containers “use the kernel of the host system that they run on”. You cannot load your own module; WireGuard only works in kernel mode if the host already provides it.
A container VPS runs on the host’s kernel, so it can only use WireGuard if the host provides the module. Source: pve.proxmox.com, captured Nov 20, 2026.
Check what you have before you commit. On a fresh Ubuntu server, run:
sudo modprobe wireguard
ls -l /dev/net/tun
If modprobe fails, kernel WireGuard is out. The fallback is a userspace version: wireguard-go from the WireGuard project, or Cloudflare’s boringtun. The wireguard-go page says you “should instead use the kernel module, which is faster”, so expect lower speed.
TUN access on a container is switched on by the host, not by you. Source: wiki.openvz.org, captured Nov 19, 2026.
Edge · low weightOpenVPNIt needs only TUN, never a kernel module, so on a container VPS it runs as designed while WireGuard drops to a slower userspace version.
Ports and firewall rules
The transport is where the two protocols really diverge, and it decides what you open in the firewall.
WireGuard sends everything over UDP; its known limitations page says it “explicitly does not support tunneling over TCP”. It has no fixed port: you set ListenPort, and the official examples use 51820. UDP suits a tunnel, but a strict network (a hotel, an office, a national filter) can block it outright.
WireGuard is UDP only; TCP 443 needs OpenVPN or an extra wrapper. Source: wireguard.com, captured Nov 20, 2026.
OpenVPN gives you a choice. Ubuntu’s OpenVPN guide says it “can be configured to use either UDP or TCP” and that “port 1194 is the official one”. Many people run it on TCP 443 instead, the HTTPS port, which a network cannot block without breaking the web.
Open only the port your tunnel uses. For WireGuard on 51820:
sudo ufw allow 51820/udp
For OpenVPN, open 1194/udp, or 443/tcp if you set it up on TCP 443 to get through a strict network:
sudo ufw allow 1194/udp
The full walkthrough of allowing and checking rules is in the UFW firewall guide.
Edge · medium weightOpenVPNUDP-only means WireGuard is blocked in places where OpenVPN over TCP 443 still gets through.
How to set up each on Ubuntu 24.04
This is a versus page, not a full install guide. These are the minimal paths, checked against the official docs. You need to be on the server first; if you have not logged in yet, see how to SSH into a VPS.
WireGuard: install the tools, generate a key pair, write /etc/wireguard/wg0.conf with your keys and peers, then bring the interface up.
sudo apt update
sudo apt install wireguard
umask 077
wg genkey | tee privatekey | wg pubkey > publickey
sudo wg-quick up wg0
The key commands are the ones on the WireGuard quickstart; the config file format is in the wg-quick(8) manual.
WireGuard needs one key pair per machine, made with two commands. Source: wireguard.com/quickstart, captured Nov 19, 2026.
OpenVPN: install it with easy-rsa, build a certificate authority and the server certificate, write /etc/openvpn/server.conf, then start the service.
sudo apt update
sudo apt install openvpn easy-rsa
sudo systemctl enable --now openvpn@server
The openvpn@server unit reads /etc/openvpn/server.conf. Ubuntu’s OpenVPN guide walks through the certificate steps and the sample config; it explains that OpenVPN “uses templated systemd jobs, openvpn@CONFIGFILENAME”.
OpenVPN on Ubuntu starts with a certificate authority (easy-rsa) and uses port 1194 by default. Source: ubuntu.com/server/docs, captured Nov 19, 2026.
Edge · low weightWireGuardA key pair and one config file are less to get wrong than OpenVPN’s certificate authority and cipher options.
What it costs to run on a VPS
A VPN runs 24/7, and for a busy tunnel the traffic allowance matters more than CPU. Here are three cheap plans we read daily, with their monthly traffic:
| Provider | Plan | Specs | You pay | Monthly traffic |
|---|---|---|---|---|
| Hetzner | CPX02 | 1 vCPU / 1 GB RAM / 20 GB | $6.59/mo | 20 TB in Germany and Finland, 0.5 TB in Singapore |
| RackNerd | 2.5 GB KVM VPS (yearly special) | 2 vCPU / 2.5 GB RAM / 30 GB | $2.33/mobilled yearly | 6 TB |
| Vultr | Regular 1GB | 1 vCPU / 1 GB RAM / 25 GB | $5.00/mo | 1 TB |
Hetzner’s 20 TB in its European locations is the standout for a VPN you leave running. RackNerd’s yearly plan is a cheap way in if you pay a year up front, and Vultr’s 1 TB shows the small end. Even 1 TB is a lot for one person, but a family streaming through the tunnel will notice the difference. Prices are checked Dec 4, 2026; traffic allowances come from the same provider pages, and Hetzner’s split by location was read on Nov 19, 2026. To see every plan at your RAM size by real monthly cost, compare VPS prices.
WireGuard vs OpenVPN: who should pick which
Pick WireGuard if you run a personal or family VPN on a KVM VPS and your phones and laptops use normal networks. It is the faster, lighter tunnel with the simpler setup. It is the default answer for a new self-hosted VPN, and what most readers of this guide should choose.
Pick OpenVPN if a strict network blocks UDP and you need TCP 443. It is also the answer when you need username/password or LDAP/RADIUS logins, or your container VPS cannot load the WireGuard module. And if your company already runs OpenVPN, adding one more server to it is simpler than starting over.
The honest middle ground: run WireGuard by default, and keep OpenVPN on TCP 443 on the same box for the one network that blocks UDP. The two run side by side on different ports.
Edge (high): WireGuard. For the self-hosted reader this guide is written for, speed, simplicity and the kernel module win out; OpenVPN is the tool for specific constraints, not the default.
Key takeaways
- OpenVPN vs WireGuard: run WireGuard for most people. It is faster, simpler, and in the Linux kernel since 5.6.
- Pick OpenVPN when you need TCP 443 through a strict network, username/password or LDAP/RADIUS logins, or a container VPS that cannot load the WireGuard module.
- Check before you choose:
sudo modprobe wireguardandls -l /dev/net/tun. Without the module, usewireguard-goorboringtun; without TUN, ask your host to enable it. - WireGuard is UDP-only (examples use 51820); OpenVPN adds TCP 443. Open only the port you use in UFW.
- OpenVPN 2.6 can move traffic into the kernel with DCO, which narrows the speed gap.
Questions
Is WireGuard faster than OpenVPN?
Usually, yes. WireGuard runs in the kernel, while classic OpenVPN runs in userspace and copies each packet through a TUN device. OpenVPN 2.6 with Data Channel Offload (DCO) moves its traffic into the kernel too, which narrows the gap. We have not run our own speed tests.
Is OpenVPN obsolete?
No. It is still the right tool when you need TCP 443 to get through a strict network, username/password or LDAP/RADIUS logins, or a container VPS that cannot load the WireGuard module. It is also still developing: version 2.6 added kernel offload (DCO).
Is WireGuard actually secure?
Yes. It uses fixed modern cryptography (Curve25519, ChaCha20, Poly1305, BLAKE2s) and a small codebase, and the protocol has been formally verified. OpenVPN is also considered secure; its main risk is a careless cipher configuration.
Can I run WireGuard on any VPS?
Not every one. KVM and other full-virtualisation VPS can load the kernel module. OpenVZ and LXC containers share the host kernel and often cannot. Without the module, use wireguard-go or boringtun; both still need /dev/net/tun, which your host must enable on a container.
Which port should I open for WireGuard or OpenVPN?
WireGuard: the UDP port you set as ListenPort (51820 in the official examples). OpenVPN: 1194/udp by default, or 443/tcp if you run it on TCP 443. In UFW that is sudo ufw allow 51820/udp, sudo ufw allow 1194/udp or sudo ufw allow 443/tcp.
How we checked: We compared the two protocols for one reader: someone running their own VPN on a VPS. Protocol facts come from the WireGuard site, quickstart, protocol page and paper, openvpn.net and its DCO tutorial, and Ubuntu’s OpenVPN guide. Container facts come from the Proxmox and OpenVZ wikis. All were read on Nov 19, 2026. We did not run speed tests, so this page has no throughput numbers. Plan prices and traffic come from our daily price data; see our methodology.