How to Use an .ovpn File on Linux — NetworkManager and Terminal Setup

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.
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

Safety note

Linux safety checks before running an .ovpn file

Before running a public profile with elevated privileges, inspect the remote, proto, port, script-related directives and DNS options. Prefer NetworkManager for desktop testing when you want easier disconnect behavior, or run OpenVPN in a terminal when you need logs. After disconnecting, check routes and DNS with ip route and resolvectl status.

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 sudo dnf install openvpn NetworkManager-openvpn NetworkManager-openvpn-gnome sudo pacman -S openvpn networkmanager-openvpn
  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 nmcli connection show

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.
  • AUTH_FAILED: do not enter private credentials into an unknown public profile; choose a fresh row.
  • TLS Error: the endpoint may be stale, blocked or using a mismatched protocol.
  • 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.
  • No DNS after connect: disconnect, reconnect, or set DNS manually for that VPN profile if your desktop environment supports it.
  • No traffic after disconnect: check that the default route and resolver returned to the normal network.
  • GUI import fails: use nmcli connection import type openvpn file ~/Downloads/publicvpn.ovpn or terminal OpenVPN to see clearer errors.
  • 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