5 Ways to Install OpenVPN on Ubuntu 14.04, 16.04, 18.04
24,472 Total views across this article’s versions; includes the historical baseline where available.
This guide records installation approaches originally discussed for Ubuntu 14.04, 16.04 and 18.04. Those releases are outside standard maintenance; any remaining security coverage depends on the release, package and applicable extended-support entitlement. Check Ubuntu’s release lifecycle before using a historical system.
The examples below have been corrected against documentation. They have not been rerun as Ubuntu installations during this review. The 2.4.7 source examples are explicitly historical, not a recommendation to deploy that old release.
For a new installation, use a supported Ubuntu release and the current instructions for the product you need. Community Edition 2.x, OpenVPN 3 Linux and Access Server are distinct choices. In particular, the original Method 3 downloaded Access Server, not a Community Edition client. It is now identified accordingly.
For this site’s six advanced VPN/DNS use cases, continue with the Ubuntu 24.04 implementation walkthrough. It uses Community 2.6 with dedicated systemd instances and explicit version/capability checks. The release comparison explains how that reference differs from current upstream 2.7. The five historical methods below retain their original scope.
Commands assume a shell on the target Ubuntu host and an account permitted to use sudo. Reading this article or installing a package does not by itself configure a working VPN.
Contents
- Free vs. Paid Editions
- Pre-Installation Decisions
- Repositories and Packages
- Easy-RSA
- Installation Walkthroughs
- Post-Installation Configuration
Free vs. Paid Editions
OpenVPN Community Edition is open-source software providing both client and server functionality. Its daemon is command-line driven, but graphical frontends and management tools also exist. Access Server is a separate commercial server product with web administration and integrated user-management features. Their histories should not be reduced to an unverified claim that a 2017 rebranding created the commercial product.
Unless otherwise stated here, OpenVPN 2.x means Community Edition. OpenVPN 3 Linux is a separate client platform.
OpenVPN Access Server
Access Server packages a VPN server with web administration and authentication/user-management integrations. It is not the client package needed merely to connect to somebody else’s VPN. Its licensing is product-specific; personal use alone is not a general license exemption. Consult the Access Server installation documentation if you actually intend to operate that product.
Pre-Installation Decisions
Decide whether you need a client connection, a Community Edition server or Access Server. Choose a supported operating system, package source, architecture and compatible client profile. Most readers connecting to an existing service need a client and credentials/profile supplied by its administrator.
Methods 1 and 2 install the Community Edition package, which contains client and server capabilities. Installing Easy-RSA does not turn a client-only binary into a server. Method 3 is a historical Access Server detour; Method 4 builds Community Edition; Method 5 installs the separate OpenVPN 3 Linux client.
Encryption Libraries
The OpenVPN 2.4 build system selects OpenSSL or mbed TLS as its backend at build time. The released 2.4.0 checks require mbed TLS 2.x for that backend; older PolarSSL support already existed in the 2.3 family. It was not introduced only in 2.4 or 2.3.3.
A binary package has already made that build choice. Installing another library afterward does not change it. Package dependencies also distinguish a shared library from command-line utilities. 2.4.0 build configuration; 2.3 changes.
Linux Distro Packages
Use packages built for the actual distribution release and CPU architecture. A .deb extension alone does not establish Ubuntu compatibility. Community Edition repositories and Access Server downloads are separate product channels. For a supported system, use the Community Edition repository instructions or the appropriate distribution package.
Which Version of OpenVPN Should I Install?
Choose a maintained package compatible with your server and profile. The original “latest 2.4.7” and experimental OpenVPN 3 descriptions were time-specific and no longer apply.
OpenVPN 2.x remains the Community Edition client/server project. OpenVPN 3 is a production client library used by OpenVPN Connect; OpenVPN 3 Linux supplies a separate Linux client with packaged builds. It is not the replacement version number for a Community Edition server. OpenVPN 3 Linux.
The original author tested an installation on Ubuntu 16.04. That historical observation is not verification of every method, architecture or newer release. The usual workflow is install, import/configure a trusted client profile, test connectivity/routing/DNS, then configure automatic startup if required. A reboot is not inherently necessary.
Repositories and Packages
Repositories and Packages are explained below. You may also skip this info and go directly to the code.
Repositories
Ubuntu’s archive has four components: Main, Restricted, Universe and Multiverse. They distinguish support and licensing categories within the Ubuntu archive. Universe is not a collection of PPAs, and Main is not an assurance that every package is bug-free or independently security-certified. Ubuntu package management.
Personal Package Archives
A Personal Package Archive is a separate repository published through Launchpad. It is not the Universe component of Ubuntu’s archive. Adding a PPA or another third-party repository changes which publishers you trust to supply packages; verify its ownership, supported release and signing instructions.
A Brief Word on Git
I recommend against using Git to install OpenVPN simply because it results in more work. First, you must be more diligent in verifying you are downloading the correct version. And secondly, if you clone the repository you will likely end up with a large number of files you don’t need. The other methods described above are more straightforward. I love Git. It’s great for software development environments. However, it’s usually not the ideal choice when sharing installation files with consumers. Naturally, it all depends on the situation, but I would argue that is certainly the case with OpenVPN with its myriad of old, stable, and experimental versions.
Easy-RSA
Easy-RSA is a tool for creating and managing a public-key infrastructure: certificate authorities, certificate requests, signed certificates and revocation lists. Each private key should remain with its intended owner; a public key or certificate can be shared.
An ordinary VPN client receiving a ready-to-use profile and credentials generally does not need Easy-RSA installed. Some deployments generate a client key and request locally and send the request to an administrator for signing. CA operation is not inherently a task that must run on the VPN server itself. Easy-RSA project.
Should I Install Easy-RSA?
Install Easy-RSA if you intend to manage a PKI with that tool. OpenVPN can use certificates issued by other tooling or an existing CA. Omitting Easy-RSA does not force username/password-only authentication, and installing it does not configure a server automatically.
Easy-RSA 2 vs 3
Easy-RSA 2 and 3 are release generations, not Windows-versus-Linux editions. Easy-RSA 3 uses platform-neutral POSIX shell and supports Unix-like systems and Windows with the supplied environment. Use a maintained release compatible with its OpenSSL dependency. Easy-RSA platform documentation.
Installing Easy-RSA 3
The installation of Easy-RSA is explained in the Walkthrough scenarios below.
Installation Walkthroughs
The methods below explain the product and packaging differences. Old repository lines and download names are preserved in the original version; they should not be treated as current supported endpoints. A package installation, a source build and an operational VPN connection are separate steps.
Method 1: Official Package Installer
Ubuntu’s package manager resolves the dependencies declared by a package and records the installed version. Updating package lists makes new package metadata available; automatic installation and notifications depend on the system’s update configuration.
The distribution’s supported package may retain an older upstream version with selected security fixes. That is normal distribution maintenance, not proof that it is secretly another upstream release.
Method 1 Installation (OpenVPN Client Only)
On a supported Ubuntu installation with suitable repositories enabled:
sudo apt update
sudo apt install openvpn
The openvpn package includes Community Edition client and server functionality. This command installs software; a trusted client profile is still required.
Method 1: OpenVPN and Optional Easy-RSA
If you also need the distribution’s Easy-RSA package:
sudo apt update
sudo apt install openvpn easy-rsa
This adds PKI-management tooling. It does not create a CA, configure a VPN server or guarantee the newest upstream version.
Result (Method 1)
Inspect both the program and full package revision:
openvpn --version
dpkg-query -W openvpn
apt-cache policy openvpn
The original Ubuntu 16.04 observation reported upstream version 2.3.10. Its age alone does not identify which distribution fixes were installed. Check the complete package revision, applicable security notices and support coverage. The former en dash in –version was invalid command syntax; use two ASCII hyphens.
Configuration
After the installation process completes, jump ahead to OpenVPN Client Configuration.
Method 2: OpenVPN Repository Package
The OpenVPN project publishes its own package repositories. Follow the current release/architecture-specific instructions and verify the repository signing key. This is an APT package-signing key, not a VPN certificate-authority certificate.
Modern instructions scope a key to the repository using signed-by and use HTTPS. The former apt-key add instructions granted broader trust and should not be copied as a current setup recipe. Official Community Edition repository instructions.
Choose the repository channel deliberately. The project’s stable channel follows stable releases; it does not mean “stay on 2.6.” Its branch-specific channels select a family, but the repository documentation allows prereleases there as well. Inspect the actual APT candidate before changing repositories. The Ubuntu 24.04 advanced walkthrough uses the distribution’s 2.6 package path, not an automatic switch to the upstream stable channel. Repository channel definitions.
Ubuntu 14.04.x
The original used the trusty repository. Ubuntu 14.04 is a historical target; do not infer current project package availability from that old line. Use a supported release and its matching repository instructions.
Ubuntu 16.04.x
The original used the xenial repository. That old repository entry is not a current support promise for Ubuntu 16.04. Check the supplier’s supported-release list and the host’s actual maintenance coverage.
Ubuntu 18.04.x
The original used the bionic repository. Do not substitute another Ubuntu codename to force an unsupported binary onto 18.04. Select a supported operating system/package combination using the current project instructions.
Method 2 Installation (OpenVPN Client Only)
After configuring a repository that explicitly supports the target system:
sudo apt update
apt-cache policy openvpn
sudo apt install openvpn
Check the selected origin/version before proceeding.
Method 2: Optional Easy-RSA
Install Easy-RSA separately if you need PKI tooling. Its package may come from the Ubuntu archive rather than the OpenVPN repository. Both client and server capabilities are already in the Community Edition openvpn package.
Result (Method 2)
The original sample reported OpenVPN 2.4.7 with OpenSSL 1.0.2g. That records an application version and the runtime library’s upstream identifier. It does not demonstrate that Ubuntu installed a complete newer OpenSSL release under a false name.
Canonical backports particular fixes while retaining a stable package series. Evaluate the full package revision and notices; do not equate it with every feature of a later upstream release. Ubuntu security updates. The two related Ubuntu versioning articles discuss this distinction.
Configuration
Jump ahead to OpenVPN Client Configuration.
Method 3: Access Server Download (Different Product)
The original openvpn-as-...deb downloads are Access Server installers. They are not an alternative way to install a Community Edition client, and their version numbers are not Community Edition version numbers.
For a client connection, use Method 1, Method 2 or the supported OpenVPN 3 Linux client. For an Access Server deployment, follow its separate Ubuntu installation guide. The historical filenames remain in the preserved original.
Downloading the Installer (.deb)
Choose the correct product, supported Ubuntu release and package architecture from its official source. Verify package authenticity using the publisher’s instructions before installation. wget --content-disposition can use a server-supplied filename; that does not verify the file or make an Access Server package a client package.
Ubuntu 14.04 32-Bit
The original Ubuntu 14.04 i386 link named Access Server. It is retained in the original for historical reference, not offered here as a supported client installer.
Ubuntu 14.04 64-Bit
The original Ubuntu 14.04 64-bit link also named Access Server. Use the publisher’s actual architecture and release filename; do not infer one from the old amd_64 spelling.
Ubuntu 16.04 32-Bit
The original Ubuntu 16.04 i386 link named Access Server. Package availability and support must be checked for that product; neither follows from the operating system being able to run 32-bit programs.
Ubuntu 16.04 64-Bit
The original Ubuntu 16.04 64-bit link named Access Server. Its version string should not be equated with the Community Edition daemon’s version.
Ubuntu 18.04 64-Bit
The original Ubuntu 18.04 64-bit link named Access Server. The broader claim that Ubuntu 18.04 had no 32-bit variants was too sweeping: installer images, flavors, architectures and continued i386 package support are different questions. Use the architecture supported by the chosen product. Lubuntu’s official 18.04 release archive provides a concrete i386 counterexample.
Run the .deb Installer
For an already authenticated, compatible local .deb file, the syntax is:
# Replace PACKAGE.deb with the actual local filename.
sudo dpkg -i ./PACKAGE.deb
dpkg installs the local package but does not fetch missing dependencies. On Ubuntu releases whose APT supports local .deb installation, this alternative can resolve dependencies from configured repositories:
sudo apt install ./PACKAGE.deb
The ./ identifies a local file. Do not assume this local-file behavior is available in Ubuntu 14.04’s older APT. The original dpkg examples omitted the required install option. dpkg manual; APT manual.
Configuration
Access Server has its own server setup and administration workflow. Do not jump from installing an Access Server package into Community Edition client configuration as if they were the same installation.
Method 4: Build OpenVPN 2.x from Source Code
Building from source gives control over build options and installation location, but also makes you responsible for tracking fixes and maintaining the installation. Use a named, authenticated release and its own build instructions.
The examples below retain 2.4.7 solely to explain the original 2019 procedure. They are not current deployment instructions. Fetch its archive and detached signature through the official release listing, verify the signing key through the publisher’s documented channel, and verify the signature before extracting. A matching filename or an untrusted checksum alone does not establish authenticity.
Work as an ordinary user while downloading and compiling; privilege is needed only for the installation step. Do not enter a root shell for the entire build. Tagged 2.4.7 installation notes.
Step 1: Decompression and Unpacking
ZIP, gzip and xz use lossless compression for these source archives. None intentionally discards source-code data. ZIP combines archiving and compression; gzip and xz usually compress a single stream, so a tar archive groups the files first.
Tar is the archive format/tool, not inherently a compression algorithm. GNU tar can invoke a decompressor during extraction, so separate manual decompression is unnecessary. Relative size, speed and memory use depend on content and settings; xz is not universally faster or larger. gzip manual; xz manual; tar manual.
Use an archive actually supplied for the chosen release. Different downloads are equivalent only when the publisher packages the same source tree in each.
Option 1: Download the zip File
If the publisher supplies an authenticated ZIP source archive for the chosen release, extract its actual filename with unzip. The former floating latest download plus hard-coded openvpn-2.4.7 directory could become inconsistent. Do not assume every current release offers a ZIP archive.
unzip -v
# Replace SOURCE.zip with the verified archive filename.
unzip SOURCE.zip
Inspect the resulting directory name rather than assuming it.
Option 2: Download the GZIP File
For the verified historical 2.4.7 gzip-compressed tar archive:
tar -tzf openvpn-2.4.7.tar.gz
tar -xzf openvpn-2.4.7.tar.gz
The first command lists its contents; the second extracts them. A current release will have a different versioned filename.
Option 3: Download the XZ File
On Ubuntu the xz command is supplied by xz-utils, not a package named simply xz. For the verified historical archive:
xz --version
tar -tJf openvpn-2.4.7.tar.xz
tar -xJf openvpn-2.4.7.tar.xz
These commands name the .tar.xz file and use xz decompression. The original extraction command incorrectly named the .tar.gz archive.
Step 2: Build and Install
A source build first needs a compiler/build tools, development headers for the chosen cryptographic backend and dependencies for the selected optional features. Follow the selected release’s INSTALL, configure --help and dependency checks; a bare three-command sequence is not a complete prerequisite list.
For the original 2.4.7 release tarball, the basic historical build sequence was:
cd openvpn-2.4.7
./configure --prefix=/usr/local
make
make check
sudo make install
Inspect failures before installation. This does not establish a successful Ubuntu build in the present review. /usr/local installation is separate from the distribution package manager; record the installed files and service integration so you can maintain or remove it. Git checkouts may need additional build-generation tools; these commands assume a release tarball.
Step 3: Installing Easy-RSA [Optional]
Easy-RSA is optional PKI tooling, independent of whether OpenVPN itself came from packages or source. Its scripts do not need to be compiled merely because OpenVPN was compiled. Use a maintained Easy-RSA release and its documented installation process; version 3 is not Linux-only. Easy-RSA documentation.
Step 4: Client Configuration
Jump ahead to OpenVPN Client Configuration.
Method 5: OpenVPN 3 Linux Packages
OpenVPN 3 Linux is a client platform using the OpenVPN 3 core library. It connects to compatible OpenVPN servers but does not implement a server. Its privilege separation allows ordinary users to manage authorized sessions while a limited privileged service handles network configuration; this does not mean no component ever needs elevated privileges. Project architecture.
Installing OpenVPN 3
The original commands installed a repository package; they did not build OpenVPN 3 from source. Use the current OpenVPN 3 Linux installation instructions for an explicitly supported release and architecture, including repository-specific signing-key configuration.
apt-transport-https historically supplied HTTPS support to APT; installing it does not fix a wget build that lacks HTTPS. The old repository setup used apt-key, so it is preserved as history rather than repeated as current instructions.
Ubuntu 14.04 [Not Supported]
Do not infer OpenVPN 3 compatibility merely from D-Bus being present. D-Bus existed in Ubuntu before 15.04; library, compiler, service-manager and packaging requirements also matter. Ubuntu 14.04 is not a current supported target in the project’s published package list. Canonical’s 2014 D-Bus notice lists packages for Ubuntu 12.04 and 14.04.
Ubuntu 16.04 32-Bit
Architecture support must come from the project’s package list or a verified build, not speculation that a 32-bit system should work because it has D-Bus. The old Ubuntu 16.04 32-bit suggestion was not tested and is not a supported installation recipe here.
Ubuntu 16.04 64-Bit
The former openvpn3-xenial.list command was for a historical Ubuntu 16.04 repository. Consult the current supported-platform list rather than assuming it remains available or maintained.
Ubuntu 18.04 (64-Bit)
The former openvpn3-bionic.list command was for a historical Ubuntu 18.04 repository. Use a supported release/architecture pair; do not substitute a newer codename into an older installation.
Update apt Cache and Run Installer
After following the project’s repository setup for a supported system:
sudo apt update
apt-cache policy openvpn3
sudo apt install openvpn3
This installs a package, not a source build. Availability depends on the correctly configured repository and platform.
OpenVPN 3 Client Configuration
Import and start a trusted profile using the OpenVPN 3 Linux getting-started documentation. Its session/configuration tools differ from the Community Edition daemon. OpenVPN 3 Linux supports routed TUN profiles; TAP/bridged profiles are not supported.
OpenVPN Client Configuration (All Versions)
OpenVPN is a double-edged sword in some respects. It has a variety of configuration options for both client and server connections. As a result, it’s highly preferable to have a good understanding of the server configuration you wish to connect to. If you will be connecting to a third-party VPN server, the server operator should inform you which protocols are acceptable for their service. Likewise, when connecting to a corporate network, someone should inform you ahead of time of its parameters. Normally, a third-party (of any type) will provide a client configuration template to guide you in setting up your OpenVPN client to connect to their server(s).
Default Client Configuration File
The upstream sample/sample-config-files/client.conf is a sample, not a universal ready-to-use default. Its remote endpoint and certificate/key paths must match the actual deployment. Prefer the server administrator’s trusted profile, verify server identity, protect private credentials and check routing/DNS after connecting.
The sample remains available in the upstream client/server configuration documentation. A successful package installation or a connection log alone does not prove every intended route and DNS request uses the tunnel.
Footnotes
- PolarSSL backend support existed in the OpenVPN 2.3 family; 2.3.3 changed TLS negotiation and dependency requirements, not the first existence of that backend.
- In the tagged 2.4.0 build system, selecting mbed TLS requires an appropriate 2.x library already available to the compiler/linker. Configure selects a backend; it is not an installer that replaces OpenSSL globally.