FreeVPNNet

How to set up OpenVPN on Linux

OpenVPN works on almost every network. You import a profile file (.ovpn) and sign in with the username and password from your configuration page.

Last reviewed

What you need

  • An active OpenVPN configuration from this site
  • The profile file (.ovpn)
  • Your username and password (shown on the configuration page)

App

OpenVPN (command line or NetworkManager)

Where each detail goes

Account details and the matching fields in the app
On your configuration pageIn the app or settings
Profile file (.ovpn)Import Profile → Upload file (server and port are inside)
UsernameUsername
PasswordPassword (tick "Save password" if you want)
Server / Port / TransportAlready in the profile — no need to type them

Steps

  1. Install OpenVPN: sudo apt install openvpn (or sudo dnf install openvpn). For the desktop network menu install network-manager-openvpn-gnome instead.

    Illustration of step 1: Install OpenVPN: sudo apt install openvpn (or sudo dnf install openvpn). For the desktop network menu install network-manager-openvpn-gnome instead.
    Illustration — your app may look slightly different.
  2. Download the .ovpn profile from your configuration page.

    Illustration of step 2: Download the .ovpn profile from your configuration page.
    Illustration — your app may look slightly different.
  3. Connect from a terminal: sudo openvpn --config ~/Downloads/<file>.ovpn

    Illustration of step 3: Connect from a terminal: sudo openvpn --config ~/Downloads/&lt;file&gt;.ovpn
    Illustration — your app may look slightly different.
  4. Enter your username and password when asked. Wait for "Initialization Sequence Completed".

    Illustration of step 4: Enter your username and password when asked. Wait for &quot;Initialization Sequence Completed&quot;.
    Illustration — your app may look slightly different.

Check that it works

OpenVPN Connect shows "Connected" with a timer. Search the web for "what is my IP"; the location should match your server country.

Disconnect

Press Ctrl+C in the terminal.

Tips

  • With NetworkManager: Settings → Network → VPN → + → Import from file, then fill in the username and password.

Troubleshooting

AUTH_FAILED

The username or password is wrong, or the configuration has expired or was revoked. Copy both again from your configuration page (use the copy buttons to avoid typos).

Stuck on "Connecting…"

The network may block UDP. Try another Wi-Fi or mobile data, or use a V2Ray or SSH configuration, which run on port 443.

Profile won't import

Make sure you downloaded the file itself (ending in .ovpn), not the page. Download it again from your configuration page.