How to manually configure OpenVPN for Proton VPN in Linux
OpenVPN is a battle-tested, open-source VPN protocol used by our Linux VPN app and Linux CLI.
It’s also possible to manually configure OpenVPN on Linux using third-party clients. In this guide, we’ll show you how to configure OpenVPN on any Linux distribution using the command line or NetworkManager (for those who prefer a GUI).
- Preparing for OpenVPN
- How to manually configure OpenVPN CLI
- How to use OpenVPN with NetworkManager
- How to check for DNS leaks
In addition to OpenVPN, you can manually configure WireGuard on Linux.
An advantage of manually configuring OpenVPN or WireGuard on Linux is that our OpenVPN and WireGuard configuration files support port forwarding. However, our all-new Linux app supports port forwarding and also includes a kill switch.
Preparing for OpenVPN
Before we start, you’ll need two things:
1. An OpenVPN configuration file
Sign in to account.protonvpn.com, go to Downloads → OpenVPN configuration files, and download an OpenVPN configuration file for Linux.
Learn how to download an OpenVPN configuration file from Proton VPN
2. Your OpenVPN username and password
While still signed in to account.protonvpn.com, go to Account → OpenVPN / IKEv2 username to view your OpenVPN username and password. Note that these are not your regular Proton Account username and password.
Learn how to access your Proton VPN OpenVPN username and password
How to use OpenVPN with NetworkManager
This is the recommended way to manually configure OpenVPN if your distribution supports NetworkManager(new window).
This guide was created using Ubuntu 22.04, but the instructions are very similar on any system that supports NetworkManager. If your desktop environment uses NetworkManager, there’s a good chance that it already supports OpenVPN. If it doesn’t, you can easily install OpenVPN support in NetworkManager:
On Debian and Ubuntu-based distributions, enter:
sudo apt-get install network-manager-openvpn-gnome
On Fedora, enter:
sudo dnf -y install NetworkManager-openvpn NetworkManager-openvpn-gnome
On Arch, enter:
sudo pacman -S networkmanager-openvpn
Log out of your Linux session, then log in again for the changes to take effect.
Once NetworkManager supports OpenVPN, you can configure it. To do this:
1. Go to Settings → Network → VPN → +.
![Open NetworkManager](https://res.cloudinary.com/dbulfrlrz/images/w_1024,h_464,c_scale/f_auto,q_auto/v1721663617/wp-vpn/ovpn-linux-nm-1/ovpn-linux-nm-1.png?_i=AA)
2. Select Import from file… and use your default file manager to Open the OpenVPN configuration file you downloaded earlier.
![Import from file...](https://res.cloudinary.com/dbulfrlrz/images/w_552,h_399,c_scale/f_auto,q_auto/v1721663621/wp-vpn/ovpn-linux-nm-2/ovpn-linux-nm-2.png?_i=AA)
3. Go to Authentication and enter your OpenVPN Username and Password into the relevant fields. Click Add when you’re done
![Enter your OpenVPN Username and Password](https://res.cloudinary.com/dbulfrlrz/images/w_632,h_652,c_scale/f_auto,q_auto/v1721663625/wp-vpn/ovpn-linux-nm-3/ovpn-linux-nm-3.png?_i=AA)
4. Back at Settings → Network → VPN, toggle the switch next to the OpenVPN connection you just set up to on. You can configure as many connections as you like.
![Toggle the VPN connection on](https://res.cloudinary.com/dbulfrlrz/images/w_1024,h_464,c_scale/f_auto,q_auto/v1721663630/wp-vpn/ovpn-linux-nm-4/ovpn-linux-nm-4.png?_i=AA)
You’re now connected to Proton VPN. To verify this, visit ip.me(new window). Since this is a manual connection, you should also check DNS leaks.
To disconnect from Proton VPN, simply toggle the switch off.
How to manually configure OpenVPN CLI
This method is more complicated than using NetworkManager, and is only recommended for very specific use cases. Note also that newer distributions (including the latest version of Ubuntu) don’t support openresolv, and so the following method won’t work with them. We’ll update this guide soon, but in the meantime, the NetworkManager method described above will work on most distros.
OpenVPN and the other packages discussed here should be available for almost all Linux distributions. In this guide, we’ll show you how to set up OpenVPN on Debian and Ubuntu-based systems, Fedora, and Arch (including Manjaro).
1. Install OpenVPN
Open a terminal window and:
On Debian and Ubuntu-based distributions, enter:
sudo apt install openvpn
On Fedora, enter:
sudo dnf install openvpn
On Arch, enter:
sudo pacman -S openvpn
![Install OpenVPN](https://res.cloudinary.com/dbulfrlrz/images/w_786,h_533,c_scale/f_auto,q_auto/v1721663608/wp-vpn/ovpn-linux-1/ovpn-linux-1.png?_i=AA)
2. Install openresolv
You need openresolv (an open-source implementation of resolvconf(new window)) to properly configure DNS and prevent DNS leaks.
Learn more about DNS and DNS leaks
On Debian and Ubuntu-based distributions, enter:
sudo apt install openresolv
On Fedora, enter:
sudo dnf install openresolv
On Arch, enter:
sudo pacman -S openresolv
![Install openresolv](https://res.cloudinary.com/dbulfrlrz/images/w_957,h_677,c_scale/f_auto,q_auto/v1721663773/wp-vpn/ovpn-linux-6/ovpn-linux-6.png?_i=AA)
3. Download the following DNS update script
Again, this is needed to ensure that DNS is configured correctly. Wget is pre-installed on most Linux distros. Run:
sudo wget "https://raw.githubusercontent.com/ProtonVPN/scripts/master/update-resolv-conf.sh" -O "/etc/openvpn/update-resolv-conf"
Followed by:
sudo chmod +x "/etc/openvpn/update-resolv-conf"
![Download our DNS update script](https://res.cloudinary.com/dbulfrlrz/images/w_939,h_425,c_scale/f_auto,q_auto/v1721663612/wp-vpn/ovpn-linux-3/ovpn-linux-3.png?_i=AA)
4. Change the directory to where you downloaded your OpenVPN configuration file
Enter
cd <path>
For example:
cd ~/Downloads
5. Connect to a VPN server using OpenVPN
Run:
sudo openvpn <config.ovpn>
Where <config.ovpn> is the name of the OpenVPN configuration file you downloaded earlier.
For example:
sudo openvpn node-ch-02.protonvpn.net.udp.ovpn
Enter your OpenVPN username and password when prompted.
![Run OpenVPN](https://res.cloudinary.com/dbulfrlrz/images/w_786,h_695,c_scale/f_auto,q_auto/v1721663767/wp-vpn/ovpn-linux-5/ovpn-linux-5.png?_i=AA)
You should see a message saying Initialization Sequence Completed. This means you’re successfully connected to Proton VPN. You can verify this by visiting ip.me(new window). Since this is a manual connection, you should also check for DNS leaks.
![Visit ip.me](https://res.cloudinary.com/dbulfrlrz/images/w_975,h_532,c_scale/f_auto,q_auto/v1721663601/wp-vpn/dns-leak-3/dns-leak-3.png?_i=AA)
To disconnect from the VPN server, simply close the terminal window.
How to check for DNS leaks
After visiting ip.me, go to www.dnsleaktest.com(new window) and run the Standard test.
When the test is complete, look at the first three sets of numbers of the returned IP addresses. These should all match the first three sets of numbers of your IP address, as shown on ip.me.
If they don’t, then you have a DNS leak.