The Short Answer
For a tunnel between servers or for a small team, WireGuard is usually the simpler and faster choice. OpenVPN fits when clients sit on networks that block UDP, when you need user names and passwords or central certificate management, or when a policy names specific ciphers.
Side by Side
| WireGuard | OpenVPN | |
|---|---|---|
| Runs in | Linux kernel | User space |
| Transport | UDP only | UDP or TCP |
| Ciphers | One fixed set | Configurable |
| Identity | A key per peer | Certificates |
| Speed | High, low CPU | Lower; better with DCO |
| Setup | Short config files | More files, more options |
| Roaming | Seamless | Reconnects |
| Usual port | 51820/udp | 1194/udp |
Where the Code Runs
WireGuard has been part of the Linux kernel since version 5.6, so current distributions have nothing to compile; you install the wireguard-tools package for the wg and wg-quick commands. Its code base is a few thousand lines, small enough to review in full. OpenVPN is a regular program that moves each packet between the kernel and user space, which costs CPU time at high speeds. Since version 2.6, OpenVPN can hand the encryption of data packets to a kernel module, called data channel offload (DCO). Version 2.6 used the separately built ovpn-dco module; since Linux 6.16 the kernel includes its own module, named ovpn, which needs OpenVPN 2.7 or later. Where the module is available and the configuration supports it, DCO narrows the gap.
Transport and Restrictive Networks
WireGuard uses UDP only. That is the better transport for a tunnel, but some hotel, office, and public networks let nothing through except web traffic. OpenVPN can run over TCP port 443, where it often gets through such networks. TCP carried inside a TCP tunnel performs poorly when packets are lost, so use OpenVPN over UDP wherever UDP works. The two transports are compared in TCP vs UDP.
Cryptography
WireGuard uses one fixed set of algorithms, including Curve25519 for key exchange and ChaCha20-Poly1305 for encryption. There is nothing to choose and nothing to misconfigure; if the set ever has to change, the protocol gets a new version. OpenVPN uses the OpenSSL library and lets you choose, today typically AES-256-GCM or ChaCha20-Poly1305. The flexibility helps with rules that require specific algorithms, and hurts when old options are left enabled.
Authenticating Users
- WireGuard: each peer is a public key listed in the server's configuration, with a tunnel address assigned to it in advance. There are no user names, passwords, or expiry dates; removing access means removing the key.
- OpenVPN: clients use certificates from your own certificate authority, optionally combined with a user name and password that a plugin or script checks against LDAP, RADIUS, or a one-time code. A revocation list withdraws access. This suits organizations with many users.
Roaming Between Networks
WireGuard does not keep a session in the usual sense. When a laptop or a mobile device changes networks, its next authenticated packet updates its address on the server, and the tunnel carries on without a visible reconnect. OpenVPN usually has to notice the change and reconnect, which can take several seconds. Both have client apps for the common desktop and mobile platforms.
Seeing Each One on a Server
sudo wg show
sudo ss -ulnp
wg show lists each WireGuard interface, its peers, the time of their latest handshake, and the data transferred. ss -ulnp shows the open UDP ports: the WireGuard port, and the openvpn process on its port. For OpenVPN over TCP, use ss -tlnp. Open the chosen port in the firewall; see UFW allow port.
Which One to Choose
- Choose WireGuard for site-to-site tunnels, for a private network between servers in different locations, and for a small team that connects to them.
- Choose OpenVPN when clients are on networks that block UDP, when you need password or certificate-based user management, or when a policy prescribes the ciphers.
For tunnel addresses, pick a private range that does not overlap with the networks your clients sit on; see private IP address ranges. To set up the first option, follow how to set up a WireGuard VPN server.