What is OpenVPN, and how does it work?

OpenVPN is a free, open-source protocol that builds the encrypted tunnel behind a huge number of VPN apps. This guide explains what it actually does, whether it costs anything, how the tunnel itself works under the hood, and how it stacks up against newer options like WireGuard.

Illustration representing the OpenVPN protocol and its encrypted tunnel

Understanding the basics of OpenVPN

Before getting into how the tunnel works, it helps to clear up what OpenVPN actually is — and what it isn't.

What does OpenVPN do?

Like any VPN protocol, OpenVPN creates a secure, encrypted connection between your device and a VPN server. That connection acts as a private tunnel: your internet provider, the Wi-Fi network you're connected to, and anyone else sitting between you and that server see only encrypted traffic, not what you're actually doing online. You can check what your own connection currently exposes with our IP leak test.

Is OpenVPN free?

The protocol itself is free and open-source, released under an open license anyone can inspect, modify, or run. There's also an official free Community Edition available directly from OpenVPN Inc. that you can download and set up yourself.

The catch is that running it yourself means configuring your own server — generating TLS certificates, setting up firewall rules, keeping the software patched. That's a genuine technical project, not a five-minute task. Most people instead use OpenVPN through one of two easier paths: a commercial VPN provider that has already configured OpenVPN servers as part of its app (our Surfshark review covers one example, and our best VPNs guide compares several more), or OpenVPN Inc.'s own paid Access Server product, aimed at organizations that want a managed setup without running the open-source version from scratch.

What's the difference between a VPN and OpenVPN?

A VPN is the general concept — a private, secure tunnel between your device and a server. OpenVPN is one specific protocol used to build that tunnel. Think of a VPN as a locked house, and OpenVPN as one particular kind of lock you could put on the door. Other locks exist too — WireGuard and IKEv2 are the two you'll run into most often — and most VPN apps let you pick which one to use.

How OpenVPN actually works

Two things happen every time you connect: your device and the server verify each other and agree on a shared secret, and then your actual data gets encrypted using that secret.

The handshake: proving both sides are who they say they are

OpenVPN uses TLS — the same underlying technology that secures HTTPS websites — to handle this first step. Your device and the VPN server exchange certificates to confirm each other's identity, then agree on a shared encryption key without ever sending that key across the network in a form anyone could intercept and reuse.

Encryption: protecting the data itself

Once that handshake is done, every bit of data traveling through the tunnel gets encrypted using a symmetric cipher — commonly AES-256-GCM today, a fast, well-tested standard also used to secure online banking and government systems. Anyone intercepting the traffic sees only unreadable, encrypted noise.

UDP vs. TCP: the two ways OpenVPN can run

OpenVPN can operate over either of two underlying transport methods, and the choice affects real-world performance. UDP is faster and the default choice for most everyday use, since it doesn't wait to confirm every single packet arrived before sending the next one. TCP is slower but more reliable on networks that block or interfere with UDP traffic, and — as covered below — it has a specific trick for getting past restrictive firewalls. Our VPN speed comparison tool shows exactly how much overhead either mode adds on your own connection.

Is OpenVPN secure?

Yes, and its age is actually part of why. OpenVPN has been open-source and publicly available since 2001, meaning two decades of independent security researchers have had the opportunity to inspect its code for flaws — far more scrutiny than most closed-source software ever receives.

Worth knowing: security depends on configuration, not just the protocol name. An OpenVPN connection set up with outdated ciphers is meaningfully weaker than one using current standards like AES-256-GCM — this is one reason using an established VPN provider's default settings is often safer than a manual, from-scratch setup.

OpenVPN vs. other protocols

OpenVPN isn't the only option, and it isn't automatically the best one for every situation — here's how it actually compares to the two alternatives you're most likely to see in a VPN app's settings.

OpenVPN vs. WireGuard

Our full WireGuard vs. OpenVPN comparison goes deeper into the protocol-level differences — the short version is below.

OpenVPN's advantages

  • Two decades of independent security review
  • Highly configurable for specific network conditions
  • Better at disguising itself on restrictive networks

WireGuard's advantages

  • Noticeably faster in most real-world tests
  • A much smaller codebase, easier to fully audit
  • Simpler, more modern cryptography by design

OpenVPN vs. IKEv2

IKEv2 is built directly into Windows, iOS, and most modern operating systems, so it doesn't need a separate app the way OpenVPN does. It's also noticeably better at reconnecting automatically when you switch between Wi-Fi and mobile data — useful for a phone that moves between networks constantly. OpenVPN's advantage is closer to what's covered above: a longer audit history and more configuration flexibility, plus that same firewall-resistance trick IKEv2 doesn't have.

Getting past restrictive networks

One place OpenVPN genuinely stands out: when it's configured to run over TCP on port 443 — the same port ordinary HTTPS web traffic uses — its traffic pattern can be very hard to tell apart from someone simply browsing a secure website. That makes it one of the more resilient protocol choices on networks or in countries that actively try to detect and block VPN traffic.

How to start using OpenVPN

Three realistic paths, depending on how much setup you want to do yourself:

Is OpenVPN a VPN, or is it something else?

It's a protocol, not a VPN service you'd sign up for directly. A VPN is the broader idea — a private, encrypted tunnel between your device and a server. OpenVPN is one specific, open-source method used to build that tunnel. Most consumer VPN apps let you choose OpenVPN as one of several protocol options inside their software.

Is OpenVPN safe enough for online banking?

Yes. When configured with a strong modern cipher (AES-256-GCM is the current standard), OpenVPN is considered one of the most thoroughly vetted VPN protocols in existence, partly because 20-plus years of being open-source means its code has been reviewed by far more independent security researchers than a typical closed-source alternative.

Does OpenVPN slow down my internet connection?

Somewhat, yes — all VPN protocols add some overhead from encryption and the extra routing hop. OpenVPN tends to be a little slower than newer protocols like WireGuard because it runs in user space rather than directly in the operating system's kernel. For most everyday browsing and streaming, the difference is small enough not to notice; for very high-bandwidth uses, a newer protocol may feel snappier.

Can I use OpenVPN on my phone?

Yes, through a dedicated app — either the official OpenVPN Connect app, or a commercial VPN provider's own app that includes OpenVPN as a selectable protocol. Unlike IKEv2, OpenVPN isn't built into iOS or Android by default, so it always needs a separate app installed.

Why do some networks or countries block OpenVPN, and how does it get around that?

Restrictive networks sometimes try to detect and block VPN traffic by its pattern. OpenVPN has a genuine advantage here: when it runs over TCP on port 443 — the same port ordinary HTTPS web traffic uses — its traffic can be much harder to distinguish from someone simply browsing a secure website, making it one of the more resilient protocols in heavily restricted network environments.

Is OpenVPN better than WireGuard?

It depends what you're optimizing for. WireGuard is newer, faster, and has a much smaller codebase that's easier to audit completely. OpenVPN has a longer independent security track record, is more configurable, and is generally better at disguising itself on restrictive networks. Neither is simply "better" across the board — the comparison further down this page covers the actual trade-offs.