Categories
Linux

How To Install and Use ProtonVPN on Desktop Linux

ProtonVPN is a VPN service provider based in Switzerland. In this article, I’m going to show you how to use ProtonVPN on desktop Linux, including Debian, Ubuntu, Linux Mint, Elementary OS, Fedora, CentOS, Arch Linux, and OpenSUSE.

Note: If you are a power user, you may want to run your own VPN server.

How To Install and Use ProtonVPN on Desktop Linux

Why You Need to Use VPN on Your Computer and Mobile Devices

For those who don’t know, VPN stands for Virtual Private Network, which sets up a secure, encrypted “tunnel” between your device and the VPN server. Common use cases of VPN include:

Please be aware that using VPN is not a silver bullet solution to protect your online privacy and security. For those who are paranoid, you should use the Tor Browser on Tails Linux. However, I think most folks don’t need to go to that extra length and it’s not convenient for daily use.

ProtonVPN Features

Go to ProtonVPN official website and sign up for a free account.

How to Install ProtonVPN on Desktop Linux

ProtonVPN supports IKEv2/IPSec and OpenVPN protocols. We will use OpenVPN on desktop Linux, since it’s very secure and easy to set up.

After signing up, we need to install the ProtonVPN for Linux client.

Debian/Ubuntu/Linux/Mint

sudo apt install -y openvpn dialog python3-pip python3-setuptools

sudo pip3 install protonvpn-cli

Fedora/CentOS/RHEL

sudo dnf install -y openvpn dialog python3-pip python3-setuptools

sudo pip3 install protonvpn-cli

Arch Linux/Manjaro

sudo pacman -S openvpn dialog python-pip python-setuptools

sudo pip3 install protonvpn-cli

OpenSUSE

sudo zypper in -y openvpn dialog python3-pip python3-setuptools

sudo pip3 install protonvpn-cli

How to Use ProtonVPN Client on Linux

Log into your ProtonVPN account with the following command.

sudo protonvpn init

How To Install and Use ProtonVPN on Desktop Linux

You can find the VPN username and password at https://account.protonvpn.com/account.

How To Install and Use ProtonVPN on Desktop Linux

Then you need to choose your ProtonVPN plan and choose UDP or TCP as the transport layer protocol. I recommend using UDP first, if there’s a problem in establishing VPN connection, then try the TCP protocol.

How To Install and Use ProtonVPN on Desktop Linux

Note that the ProtonVPN Linux client doesn’t support IPv6. It’s recommended to disable IPv6 on your Linux device to prevent IPv6 address leak. Edit the /etc/sysctl.conf with a command-line text editor like Nano.

sudo nano /etc/sysctl.conf

Add the following lines at the bottom of this file. (In Nano text editor, you can press Ctrl+W, then Ctrl+V to jump to the bottom of a file.)

net.ipv6.conf.all.disable_ipv6 = 1 
net.ipv6.conf.default.disable_ipv6 = 1 
net.ipv6.conf.lo.disable_ipv6 = 1 
net.ipv6.conf.tun0.disable_ipv6 = 1

How To Install and Use ProtonVPN on Desktop Linux

Save and close the file. (To save a file in Nano text editor, press Ctrl+O, then press Enter to confirm. To exit, press Ctrl+X.)

Then apply the changes.

sudo sysctl -p

Now you can establish VPN conenction to ProtonVPN server.

sudo protonvpn connect

It will ask you to choose a country. Free users have 3 countries to choose from.

How To Install and Use ProtonVPN on Desktop Linux

Next, choose a server in that country.

How To Install and Use ProtonVPN on Desktop Linux

And choose TCP or UDP as the transport layer protocol. I recommend using UDP first, if there’s a problem in establishing VPN connection, then try the TCP protocol.

How To Install and Use ProtonVPN on Desktop Linux

After a few seconds, the VPN connection should be established.

How To Install and Use ProtonVPN on Desktop Linux

IPv6, DNS, and WebRTC Leak Test

Now go to ipleak.net. If everything is working correctly, you should see

How To Install and Use ProtonVPN on Desktop Linux

If your ISP’s DNS server shows up on the test results, then you have a DNS leak, which means your ISP’s DNS server is translating domain names to IP addresses for you. Although your connection is encrypted by VPN, your ISP knows which websites you are visiting.

Speed Test

ProtonVPN is pretty fast even with a free tier account. My computer can play 4K videos on YouTube at 67522 Kbps, which translates to 65 Mbit/s. You can see the YouTube connection speed by right-clicking the video and select Stats for nerds.

How To Install and Use ProtonVPN on Desktop Linux

How to Disconnect ProtonVPN

sudo protonvpn disconnect

ProtonVPN Auto-Start

You may want ProtonVPN to automatically start at system boot time. This can be achieved by creating a systemd service unit. Use the Nano command-line text editor to create the file.

sudo nano /etc/systemd/system/protonvpn.service

Add the following lines to this file.

[Unit]
  Description=ProtonVPN Command-Line Client
  After=network-online.target

[Service]
  Type=forking
  ExecStart=protonvpn c -f
  ExecStop=protonvpn disconnect 
  Restart=always
  RestartSec=2

[Install]
  WantedBy=multi-user.target

Save and close the file. (To save a file in Nano text editor, press Ctrl+O, then press Enter to confirm. To exit, press Ctrl+X.)

Since this systemd service runs as root, you need to switch to the root user account with

sudo su -

And initialize a user configuration file.

protonvpn init

Enter your ProtonVPN username and password, choose your ProtonVPN plan, and default protocol just like before. Once that’s done, you can disconnect the current VPN connection.

sudo protonvpn disconnect

Now try to start ProtonVPN with systemd.

sudo systemctl start protonvpn

And enable auto-start at boot time with:

sudo systemctl enable protonvpn

Go to ipleak.net.and check if it works. If there’s a problem, you can run the following command to check the log and debug the problem.

sudo journalctl -eu protonvpn

Conclusion

I hope this post helped you use ProtonVPN on Linux. If you have problems when using ProtonVPN, please don’t hesitate to put your question in the comments section below. As always, if you found this post useful, then subscribe to our free newsletter.

Leave a Reply

Your email address will not be published. Required fields are marked *