« Go Back

Linux VPN Installation Print

  • VPN, Linux, Ubuntu, VPN Configuration
  • 38

How do I install the VPN client on Linux?

A full tutorial can be found here

 

Installation for Debian and Ubuntu

 

Follow these steps in order to install OpenVPN 3 Client on Linux for Debian and Ubuntu:

 

Open the Terminal by pressing ctrl + alt + T

 

Type the following command into the Terminal: sudo apt install apt-transport-https. This is done to ensure that your apt supports the https transport. Enter the root password as prompted

 

Type the following command into the Terminal: sudo wget https://swupdate.openvpn.net/repos/openvpn-repo-pkg-key.pub. This will install the OpenVPN repository key used by the OpenVPN 3 Linux packages

 

Type the following command into the Terminal: sudo apt-key add openvpn-repo-pkg-key.pub

 

Type the following command into the Terminal: sudo wget -O /etc/apt/sources.list.d/openvpn3.list https://swupdate.openvpn.net/community/openvpn3/repos/openvpn3-$DISTRO.list. This will install the proper repository. Replace $DISTRO with the release name depending on your Debian/Ubuntu distribution (the table of release names for each distribution can be found below). In this case, focal is chosen since Ubuntu 20.04 is used

 

Type the following command into the Terminal: sudo apt update

 

Type the following command into the Terminal: sudo apt install openvpn3. This will finally install the OpenVPN 3 package

Distribution Release Release name ($DISTRO)
Debian 9 stretch
Debian 10 buster
Ubuntu 16.04 xenial
Ubuntu 18.04 bionic
Ubuntu 19.10 eoan
Ubuntu 20.04 focal

 

Installation for Fedora, Red Hat Enterprise Linux, CentOS, or Scientific Linux

 

Packages for these distributions are provided via a Fedora Copr repository. Supported versions:

Distribution Release versions
Fedora 30, 31, 32
Red Hat Enterprise Linux / CentOS 7, 8

 

In order to install the OpenVPN 3 Client for Fedora, Red Hat Enterprise Linux, CentOS, or Scientific Linux, follow the steps below:

 

Open Terminal by typing terminal into the search bar

 

If you are running Red Hat Enterprise Linux or its clones, you need to install the Fedora EPEL repository first. Here is the list of commands for each version:
(The original article on Fedora EPEL can be found here)

RHEL/CentOS 6: sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm

RHEL/CentOS 7: sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

On RHEL 7 it is recommended to also enable the optional, extras, and HA repositories since EPEL packages may depend on packages from these repositories: sudo subscription-manager repos --enable "rhel-*-optional-rpms" --enable "rhel-*-extras-rpms" --enable "rhel-ha-for-rhel-*-server-rpms"

RHEL/CentOS 8: sudo yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-8.noarch.rpm

On RHEL 8 it is required to also enable the codeready-builder-for-rhel-8-${ARCH}-rpms repository since EPEL packages may depend on packages from it: sudo ARCH=$( /bin/arch ) followed by sudo subscription-manager repos --enable "codeready-builder-for-rhel-8-${ARCH}-rpms"

On CentOS 8 it is recommended to also enable the PowerTools repository since EPEL packages may depend on packages from it: sudo dnf config-manager --set-enabled PowerTools

You need to install the yum copr module first by running the following command: sudo yum install yum-plugin-coprNote: Fedora releases usually have the yum/dnf copr module preinstalled.

With the Copr module available, it is time to enable the OpenVPN 3 Copr repository by running the following command: sudo yum copr enable dsommers/openvpn3

Finally, the OpenVPN 3 Linux client can be installed by running the following command: sudo yum install openvpn3-client

 

Using .ovpn Profile

Please note that by this point you should have downloaded a .ovpn profile to your machine.

 

Mandatory Commands

     In order to start a one-shot configuration profile, type the following command into the Terminal: openvpn3 session-start --config ${MY_CONFIGURATION_FILE}. Important: a "one-shot configuration profile" means that the configuration file is parsed, loaded, and deleted from the configuration manager as soon as the VPN session has been attempted started. No configuration file is available for re-use after this approach. This is achieved by giving the configuration file to the openvpn3 session-start command directly.

     In order to import a configuration file for re-use and start a VPN session, type the following command into the Terminal: openvpn3 config-import --config ${MY_CONFIGURATION_FILE}Note: using this approach, an imported configuration file can be used several times, and access to the configuration file itself is not needed to start VPN tunnels. By default, configuration profiles imported are only available to the user who imported the configuration file. But OpenVPN 3 Linux also provides an Access Control List feature via openvpn3 config-acl to grant access to specific or all users on the system. Important: this loads the configuration profile and stores it in memory-only. That means, if the system is rebooted, the configuration profile is not preserved. If the –persistent argument is added to the command line above, the configuration profile will be saved to disk in a directory only accessible by the OpenVPN user. Whenever the Configuration Manager is started, configuration files imported with –persistent will be automatically loaded as well.

     In order to start a new VPN session from an imported configuration profile, run the following command: openvpn3 session-start --config ${CONFIGURATION_PROFILE_NAME}Note: When a configuration profile is available via openvpn3 configs-list, it can easily be started via openvpn3 session-start using the configuration profile name (typically the filename used during the import)

 

Optional Commands

     To list all available configuration profiles, run this command: openvpn3 configs-listImportant: a configuration file typically contains generic options to be able to connect to a specific server, regardless of the device itself. OpenVPN 3 Linux also supports setting more host-specific settings on a configuration profile as well. This is handled via the `openvpn3 config-manage` interface. Any settings here will also be preserved across boots if the configuration profile was imported with the --persistent argument.

     Note that it is possible to use the D-Bus path to the configuration profile: openvpn3 session-start --config-path /net/openvpn/v3/configuration/...Note: in either of these cases is it necessary to have access to the configuration profile on disk. As long as configuration profiles are available via openvpn3 configs-list, all needed to start a VPN session should be present.

 


Was this answer helpful?