OpenVPN is an open-source VPN system that creates an encrypted tunnel between your device and a VPN server using SSL/TLS for authentication and key exchange and the OpenSSL library for encryption. It runs over UDP or TCP, usually on port 1194, and is widely used because its code is public, it works on almost every platform, and it can be configured for remote access or site-to-site links.
Key takeaways
- OpenVPN is both an open-source protocol and software, built on SSL/TLS and OpenSSL, first released in 2001.
- It runs over UDP for speed or TCP for reliability, usually on port 1194, and TCP port 443 can blend in with HTTPS traffic.
- Choose OpenVPN when you need a proven, auditable tunnel; choose WireGuard when you want a simpler, faster setup.
Almost every VPN app you have used offers OpenVPN as an option, often without explaining what it is. It is the open-source protocol that made modern VPNs practical: a tunnel built on the same SSL/TLS technology that protects websites, with code anyone can inspect.
What is OpenVPN?
OpenVPN is an open-source VPN system that creates a secure, encrypted tunnel between two networks or between a device and a server. It uses SSL/TLS for authentication and key exchange, and the OpenSSL library for encryption.
The name covers three related things. First, the OpenVPN protocol, a custom security protocol that uses SSL/TLS for key exchange. Second, the open-source OpenVPN software, a daemon that runs on Windows, macOS, Linux, routers and mobile devices. Third, OpenVPN Inc., the company that supports the open-source project and sells commercial products built on it.
OpenVPN was written by James Yonan and first released on 13 May 2001, under the GNU General Public License version 2. That open history is a large part of its reputation: the code is public, it has been reviewed for more than two decades, and no single vendor controls it.
It creates secure point-to-point or site-to-site connections in routed or bridged configurations, and remote-access connections for workers connecting to an office network. It can traverse network address translators (NATs) and firewalls, which is one reason it spread so widely.
How does OpenVPN work?
OpenVPN works by building an encrypted tunnel in four steps: authenticate the two ends, agree on encryption keys over a TLS control channel, carry traffic through an encrypted data channel, and route that traffic out through the VPN server.
1. Authentication
Each side proves who it is before any traffic flows. OpenVPN supports pre-shared secret keys, certificate-based authentication, and username and password authentication, often combined with a public key infrastructure.
In a business setup, the server issues a certificate to every client, signed by a certificate authority the business controls. That makes it easy to revoke one laptop without changing everyone else.
2. Tunnel setup and key exchange
Once identities are verified, OpenVPN sets up the tunnel. In TLS mode it multiplexes a control channel and a data channel over the same UDP or TCP transport. The control channel handles the TLS session, authentication and key exchange, while the data channel carries the protected packets.
The official OpenVPN 2.6 documentation describes this split clearly: the control channel exchanges cipher and authentication keys, and tunnel data passes through the data channel. Modern deployments negotiate the data-channel cipher, with AES-256-GCM and AES-128-GCM as defaults in OpenVPN 2.6.
3. Encapsulation and encryption
OpenVPN wraps each packet in extra layers that add routing information and apply encryption. It uses the OpenSSL library extensively, so it can use the ciphers available in OpenSSL, and it supports perfect forward secrecy, which regenerates keys at set intervals so a later key leak does not expose earlier sessions.
It also supports HMAC packet authentication, an extra check that a packet really came from the expected peer before the server spends time decrypting it.
4. Data transmission
Encrypted traffic travels through the tunnel to the VPN server, where it is decrypted and sent on to its destination. Because the destination sees the server address, your real address stays hidden from the sites and services you visit.
OpenVPN UDP vs TCP: which should you use?
Use UDP in most cases, because it is faster and OpenVPN is designed to work best over UDP. Use TCP only when UDP is blocked or unreliable, for example on a restrictive hotel, school or corporate network.
| OpenVPN UDP | OpenVPN TCP | |
|---|---|---|
| Speed | Faster, less overhead | Slower, extra checks and retransmissions |
| Reliability | No built-in retransmission | Retransmits lost packets |
| Default port | UDP 1194 | Often TCP 443 |
| Best for | Streaming, calls, gaming, everyday browsing | Restrictive networks, unstable connections |
| Drawback | May be blocked by some firewalls | TCP inside TCP can stall on lossy links |
The reason UDP wins is subtle but real. Putting a reliable protocol (TCP) inside another reliable tunnel (TCP) means two layers both try to fix lost packets, which can cause delays. UDP avoids that double work, and OpenVPN handles reliability itself where it needs to.
TCP still has a useful trick: running OpenVPN over TCP port 443 makes the traffic look like ordinary HTTPS, so it passes through networks that block VPN traffic on other ports. If your VPN will not connect on UDP, switching to TCP 443 is the first thing to try.
What are TUN and TAP modes?
TUN mode routes IP traffic through a virtual layer-3 interface, while TAP mode bridges Ethernet traffic through a virtual layer-2 interface. Most people should use TUN; TAP is for special cases such as bridging a remote device onto a local network.
In routing (TUN) mode, each client gets an address on a different subnet, and traffic is routed between the client and the server. In bridging (TAP) mode, the remote device behaves as if it were plugged into the same local network, carrying any Ethernet traffic.
OpenVPN is designed to work with the TUN/TAP virtual networking interface available on most platforms. For a home user or a remote worker, TUN is simpler, faster and easier to secure. TAP is mainly useful when an application needs broadcast traffic or a device must appear on the same subnet as the office.
Is OpenVPN safe and secure?
Yes, OpenVPN is considered safe when it uses modern ciphers, strong authentication and up-to-date software. Its open-source code, TLS-based key exchange and support for AES-256-GCM and perfect forward secrecy give it a strong security foundation.
That safety is not automatic. Security depends on configuration: a server still using an old cipher, a weak pre-shared key, or an unpatched OpenVPN version is a real risk. The OpenVPN manual itself notes that the software supports both encrypted and non-encrypted tunnels, so an administrator must choose the secure options.
The other half of the answer is trust. A VPN only moves your trust from your internet provider to the VPN operator. OpenVPN encrypts the tunnel, but the server operator can still see where your traffic goes after it leaves the server. Choose a provider with a clear no-logs policy and independent audits, and check your connection with our free what-is-my-IP tool to confirm your address actually changes.
OpenVPN vs WireGuard vs IKEv2: what is the difference?
OpenVPN is the most configurable and most widely supported of the three. WireGuard is newer, simpler and usually faster. IKEv2 is built into many operating systems and reconnects quickly when you switch networks.
| OpenVPN | WireGuard | IKEv2/IPsec | |
|---|---|---|---|
| Released | 2001 | 2020 (in Linux kernel) | 2005 (IKEv2) |
| Code size | Large, many options | Small, about 4,000 lines | Large, complex |
| Speed | Good, slower than WireGuard | Usually fastest | Good |
| Configurability | Very high | Low, opinionated | Moderate |
| Firewall evasion | Strong, TCP 443 option | Weaker, fixed UDP port | Can be blocked |
| Best for | Complex business VPNs | Fast consumer VPNs | Mobile devices |
WireGuard's small codebase is easier to audit, and its modern cryptography is fast on phones and laptops. OpenVPN's advantage is flexibility: it runs on almost anything, supports many authentication methods, and can be tuned for unusual networks. Many VPN apps now offer both, and let you switch per network. NordVPN's OpenVPN explainer makes the same point: the protocol's strength is its configurability.
For a small business, the choice is practical rather than ideological. If you need site-to-site links, per-client certificates and fine-grained routing, OpenVPN is the safer pick. If you need a fast tunnel for a handful of remote workers, WireGuard may be simpler to run.
What is OpenVPN used for?
OpenVPN is used for remote access to office networks, site-to-site links between offices, and consumer VPN services that protect traffic on public Wi-Fi. It is also used on routers, firewalls and embedded devices.
- Remote work: staff connect to the office network from home or on the road, reaching internal files and systems as if they were on site.
- Site-to-site: two offices link their networks so systems in each location can talk securely over the internet.
- Consumer VPNs: most paid VPN services offer OpenVPN as a protocol option inside their apps, alongside WireGuard and IKEv2.
- Public Wi-Fi protection: traffic is encrypted between your device and the VPN server, so a snooper on the same hotspot cannot read it.
- Routers and firewalls: many routers, including DD-WRT builds, include an OpenVPN server, so every device at home can use the tunnel without separate apps.
OpenVPN does not make you anonymous on its own. It hides your traffic from the local network and your internet provider, but the VPN server, the websites you log into, and browser fingerprinting can still identify you. For stronger privacy, combine it with a trustworthy provider, a WebRTC leak test to check for leaks, and good browser habits.
How do you set up OpenVPN?
Setting up OpenVPN means installing the software, creating certificates or keys, writing a configuration file, and connecting a client. The exact steps depend on whether you run your own server or use a commercial VPN.
- Use a commercial VPN app if you only want privacy on public Wi-Fi. Pick OpenVPN in the protocol settings, usually UDP first, and TCP 443 if UDP is blocked.
- Run your own server if you need remote access to a home or office network. Use the official OpenVPN documentation and a current guide for your platform, and keep the server patched.
- Use certificates, not a shared static key, for anything with more than one user. Certificates let you revoke a single device without rebuilding the whole setup.
- Open UDP port 1194 on the server firewall, or TCP 443 if you choose that route, and forward it from your router if the server sits behind NAT.
- Test after connecting. Check that your public address changes, run a DNS leak check, and confirm internal resources are reachable before you rely on the tunnel.
Common mistakes include using an old cipher, forgetting to push DNS settings to clients, and leaving the server on a default port with a weak password. The official OpenVPN manual is the reference to check when a setting is unclear.
The bottom line
OpenVPN is the proven, open-source workhorse of VPN protocols. It is not the newest or the fastest, but its TLS-based design, broad platform support and deep configurability make it a sound choice for businesses and for anyone who values auditable code.
Start with UDP on port 1194, switch to TCP 443 on restrictive networks, and keep both client and server updated. You can confirm your tunnel is actually working with the free what-is-my-IP tool before you trust it on public Wi-Fi.
Frequently asked questions
What is OpenVPN in simple terms?
OpenVPN is open-source software that creates a private, encrypted tunnel for your internet traffic. Your device connects to a VPN server, traffic inside the tunnel is encrypted, and websites see the server address instead of yours.
Is OpenVPN safe?
Yes, when it is configured with modern settings. It uses SSL/TLS for authentication and key exchange and OpenSSL ciphers such as AES-256-GCM, and it supports perfect forward secrecy. Safety still depends on the server operator and the configuration, so weak ciphers or a shaky provider can undo the protection.
What port does OpenVPN use?
OpenVPN uses UDP port 1194 by default, which is the official IANA-assigned port for OpenVPN. Administrators often run it on TCP port 443 instead, because that traffic looks like ordinary HTTPS and is less likely to be blocked.
Is OpenVPN a VPN service or a protocol?
It is both, and the distinction matters. OpenVPN is the open-source protocol and the software that implements it. Many commercial VPN services use the OpenVPN protocol inside their own apps, and OpenVPN Inc. also sells commercial products built on it.
What is the difference between OpenVPN and WireGuard?
OpenVPN is older, larger and far more configurable, with decades of deployment and auditing behind it. WireGuard is newer, much smaller in code, and usually faster to connect. OpenVPN suits complex enterprise setups; WireGuard suits simple, fast consumer VPNs.
Does OpenVPN slow down my internet?
It adds some overhead because traffic is encrypted and routed through a server, so speeds usually drop a little. UDP is normally faster than TCP for OpenVPN, and a nearby server with AES-GCM encryption keeps the loss small on most connections.
Can I run my own OpenVPN server?
Yes. You can run OpenVPN on a home server, a virtual private server or a business gateway, and connect clients with configuration files and certificates. Running your own server gives you control, but you are then responsible for updates, certificates and keeping logs off the server.
Is OpenVPN free?
The open-source OpenVPN software is free under the GNU General Public License version 2. Commercial VPN services that use OpenVPN charge their own subscription, and OpenVPN Inc. sells paid products such as Access Server and CloudConnexa for businesses.
Sources
The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.
Checked against the official OpenVPN manual, the OpenVPN project documentation and vendor explainers from NordVPN and Surfshark.
How we write and fact-check →