To install and set up OpenVPN Connect (OpenVPN 3 Linux Client) on Ubuntu, follow these steps:

1.Install Prerequisites:Prerequisite: Root or sudo access.

  1. Open your terminal (Ctrl+Alt+T).
  2. Ensure your package index is updated and install required HTTPS dependencies:

Bash

sudo apt update && sudo apt install -y curl gnupg apt-transport-https ca-certificates

2.Add Official OpenVPN Repository Key:

  1. Create the keyrings directory:

Bash

sudo mkdir -p /etc/apt/keyrings
  1. Download and import the OpenVPN GPG repository signing key:

Bash

curl -fsSL https://packages.openvpn.net/packages-repo.gpg | sudo gpg --dearmor -o /etc/apt/keyrings/openvpn-repo.gpg

3.Add OpenVPN 3 Repository:

  1. Add the official OpenVPN 3 repository targeting your installed Ubuntu release:

Bash

echo "deb [signed-by=/etc/apt/keyrings/openvpn-repo.gpg] https://packages.openvpn.net/openvpn3/ubuntu $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/openvpn3.list

4.Install OpenVPN 3 Client:

  1. Refresh package lists to include the new repository:

Bash

sudo apt update
  1. Install the openvpn3 package:

Bash

sudo apt install -y openvpn3

5.Import Profile and Connect:

  1. Import your downloaded .ovpn configuration file:

Bash

openvpn3 config-import --config /path/to/your/client.ovpn --name "MyVPN"
  1. Start the VPN connection:

Bash

openvpn3 session-start --config "MyVPN"
  1. Enter your VPN username and password if prompted.
  2. Check active sessions at any time using openvpn3 sessions-list or disconnect using openvpn3 session-manage --config "MyVPN" --disconnect.

Alternative 1: Desktop GUI Integration (NetworkManager)

If you are using Ubuntu Desktop and prefer controlling the VPN via the top-right system settings menu:

Bash

sudo apt update && sudo apt install -y network-manager-openvpn-gnome

After installation, go to Settings > Network > VPN, click +, select Import from file…, and upload your .ovpn profile.

Alternative 2: Standard OpenVPN CLI Daemon

If you only need the legacy standalone daemon without the v3 client suite:

Bash

sudo apt update && sudo apt install -y openvpn
sudo openvpn --config /path/to/your/client.ovpn
TOP