How to install OpenVPN on Linux and import a free .ovpn file

Linux gives you two common ways to use an OpenVPN profile: import it into NetworkManager for desktop use, or run it directly from the terminal with OpenVPN/OpenVPN 3. This guide covers both approaches for downloaded .ovpn profiles from live public servers.

Choose the Linux method

Use NetworkManager if you want a graphical toggle in GNOME, KDE or another desktop environment. Use terminal commands if you manage servers, minimal systems or want to inspect OpenVPN logs directly. In both cases, download a fresh profile from a recently checked row first.

DesktopInstall NetworkManager OpenVPN plugin and import the file.
TerminalRun openvpn --config file.ovpn with sudo.
VerifyCheck public IP and DNS after connection.
Linux OpenVPN setup: GUI or terminal Network Settings Import from file VPN On $ sudo apt install openvpn $ sudo openvpn --config publicvpn.ovpn Initialization Sequence Completed Linux can connect through desktop UI or terminal

Step 1: Download a live .ovpn profile

  1. Open the live VPN catalog and choose a server with measured speed greater than zero.
  2. Prefer a nearby country for lower latency, or sort by speed if throughput matters more.
  3. Click Download and save the file somewhere easy to find, for example ~/Downloads/publicvpn.ovpn.
  4. Do not reuse old public profiles forever. Public endpoints change often, so download a fresh file when a connection fails.

Option A: Ubuntu/Debian desktop with NetworkManager

sudo apt update sudo apt install openvpn network-manager-openvpn network-manager-openvpn-gnome
  1. Open Settings and go to Network.
  2. Find the VPN section and choose add/import from file.
  3. Select the downloaded .ovpn file.
  4. Save the profile and switch the VPN toggle on.

Option B: terminal with OpenVPN

sudo apt update sudo apt install openvpn sudo openvpn --config ~/Downloads/publicvpn.ovpn

Keep the terminal open while testing. A successful connection usually ends with an initialization completed message. Stop the VPN with Ctrl+C.

Option C: nmcli import

On systems using NetworkManager, the command-line import can be more reliable than clicking through desktop dialogs.

sudo nmcli connection import type openvpn file ~/Downloads/publicvpn.ovpn nmcli connection show nmcli connection up "imported-profile-name"

Verify the Linux connection

curl ifconfig.me ip route resolvectl status

Confirm that your public IP changed and that default routes/DNS look reasonable. If DNS breaks, disconnect and try another profile.

Troubleshooting Linux OpenVPN

  • NetworkManager says the file is invalid: try the terminal method first. Some public profiles use directives that GUI importers handle differently.
  • Permission denied: run OpenVPN with sudo or import through NetworkManager, which manages privileged routes for you.
  • No traffic after connect: check ip route and try another server. Public profiles may expire or go offline quickly.
  • DNS does not change: disconnect, reconnect, or set DNS manually for that VPN profile if your desktop environment supports it.
  • Authentication prompt appears: choose another server unless the downloaded profile clearly includes required credentials.

Public VPN endpoints are third-party servers. Use them for temporary, low-risk tasks and testing; do not send private account credentials or sensitive work through unknown infrastructure.

Sources used for this guide

This page is original guidance written for PublicVPNList users, based on official OpenVPN and Ubuntu documentation.

Related VPN guides