Technology

How to Set Up OpenVPN on Linux (Step-by-Step Guide)

If you’ve accessed the OpenVPN Access Server interface and your device is detected as Linux, you’re in the right place. This guide walks you through setting up OpenVPN on a Linux system using both GUI (with NetworkManager) and CLI (terminal-based) methods.

2 min read 5,239 views

Prerequisites

  • A Linux system (Ubuntu/Debian preferred)
  • Access to your OpenVPN Access Server portal
  • Administrator privileges (sudo access)


Step 1: Visit the OpenVPN Access Server Page

Open your web browser (Firefox, Chrome, etc.) and navigate to your organization’s OpenVPN Access Server URL

https://vpn.myVPNName.in:555/?src=connect


Log In (If Required)

You may be prompted to log in using your credentials. If you’ve forgotten them, click “Change Password” (if available) or contact your VPN administrator.


Step 2: Download Your OpenVPN Profile

  1. Scroll to the Available Connection Profiles section
  2. Click on “Yourself (user-locked profile)”.
  3. This will download a .ovpn file (e.g., client.ovpn) to your default downloads folder (~/Downloads).


Step 3: Install OpenVPN on Linux

sudo apt update

sudo apt install openvpn


Step 4: (Optional): Install NetworkManager Plugin for GUI

If you prefer using a GUI to manage VPN connections, install the NetworkManager plugin:


sudo apt install network-manager-openvpn


Step 5: Import the Profile Using NetworkManager (GUI Method)

  1. Open your system’s Network Settings.
  2. Go to the VPN section.
  3. Choose Import from file.
  4. Select the .ovpn file you downloaded earlier.
  5. Enter your VPN username and password (same as the Access Server login).
  6. Save and Connect to the VPN.


Step 6: Connect Using Terminal (CLI Method)

Prefer command-line? Here’s how:

  1. Navigate to your downloads folder: cd ~/Downloads
  2.  Run the OpenVPN client: sudo openvpn --config client.ovpn
  3. Enter your VPN credentials when prompted.


Step 7: Verify VPN Connection

To check if your VPN is connected and your IP has changed, run:

curl ifconfig.me

You should see a new IP address reflecting your VPN’s network.


Step 8: Check File Permissions (If Needed)

If OpenVPN fails to read the file, ensure correct permissions:

ls -l ~/Downloads/client.ovpn

If necessary, update the file permissions:

chmod 644 ~/Downloads/client.ovpn


Step 9:Additional Cleanup (Optional)

Free up space by removing unused kernel packages:


Share this article: