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.

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:

  • Encrypt your online traffic, protect your web browsing history from ISP spying.
  • Unblock region-restricted content (Netflix, Hulu, etc), if your country isn’t supported by the streaming services, or you are traveling abroad.
  • Bypass online censorship and access websites that are blocked in your country or area, such as Google, YouTube, Facebook.
  • Prevent ISP from injecting ads on the web pages you browse.
  • Encrypt your web traffic when using public Wi-Fi, such as in airport lounge, coffee shop, or hotel. Prevent hackers in the same Wi-Fi network from intercepting your Internet traffic and stealing your email address, passwords, and credit card numbers.
  • Hide your IP and identity when you are downloading files with BitTorrent client.
  • Gamers can use a VPN to find the best route to reduce gaming lag.
  • Many online booking services like Kayak are known to offer different prices to different countries. When you are booking flights or hotels online, you can use VPN to switch your IP address in order to find the best deal.
  • Sometimes a web resource isn’t blocked in your area, but you still can’t access it. That’s because there is a cache layer in-between, and the cache is outdated. You can use a VPN to bypass the cache.

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

  • Full-disk encryption is deployed on all ProtonVPN servers.
  • All client apps are open-source.
  • Tor over VPN. You can route all your traffic through the Tor network and access Onion sites.
  • Supports Bitcoin payment.
  • Supports secure IKEv2/IPSec and OpenVPN protocols. The weak PPTP and L2TP/IPSec protocols are disabled.
  • DNS leak protection and IPv6 leak protection.
  • Graphical VPN client available for Android, iOS, Mac OS X, and Windows.
  • Multiple Logins. You can use ProtonVPN to browse anonymously on multiple devices at the same time.
  • ProtonVPN has over 1076 servers in 54 different countries, allowing you to switch servers at all times and as often as you like.
  • No logging policy. ProtonVPN doesn’t collect, log, or store any browsing activity, data, or IP addresses.
  • Torrenting is supported.
  • VPN kill switch. If the VPN connection drops, the computer defaults back to the original public IP. A VPN kill switch cuts your connection to the internet altogether when your VPN connection fails, so your web traffic is never exposed to hackers and snoopers.
  • And many more.

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

protonvpn init

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

ProtonVPN OpenVPN IKEv2 username

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.

protonvpn initialization

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

protonvpn disable IPv6-

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.

protonvpn-cli choose a country

Next, choose a server in that country.

protonvpn-cli choose a server to connect to

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.

protonvpn-cli TCP UDP

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

ProtonVPN connection was successfully added to Network Manager

IPv6, DNS, and WebRTC Leak Test

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

  • Your computer has got a new IP address, so the Internet can’t see your original public IP address.
  • No IPv6 address in the test result, which means your IPv6 address is also hidden from the Internet.
  • No IP address in the WebRTC detection section.
  • No IP address in the DNS address section.

protonvpn DNS Leak WebRTC Leak Test

 

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.

protonvpn speed test

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

If you don’t want ProtonVPN to auto-start, run the following command.

sudo systemctl disable 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.

Rate this tutorial
[Total: 11 Average: 5]

20 Responses to “How To Install and Use ProtonVPN on Desktop Linux

  • Is there a way to include the VPN in the Linux Network Settings? (Mint)

    • Xiao Guoan (Admin)
      3 years ago

      You can install the ProtonVPN Linux beta client from the official repository to integrate it with Network Manager.

      However, it’s a beta. Once the VPN connection is stopped, the VPN setting in Network Manager will disappear.

  • Is it possible for ProtonVPN to start on system startup? I have Ubuntu Mate 20.04.1

    • Xiao Guoan (Admin)
      3 years ago

      Yes, it can. I just added auto-start instructions at the end of this article.

  • LucindaKerry
    3 years ago

    Linuxmint Ulyana screw-up: Accidently entered my Protonvpn password instead of the openvpn credentials. How do I undo/remove the code “sudo protonvpn init”
    (as my “account has been fully initialized” but with wrong credentials).

    Yikes! and Thanks, Lucinda

  • I received the following message when I added the lines to /etc/sysctl.conf and ran sudo sysctl -p:

    “cannot stat proc/sys/net/ipv6/conf/tun0/disable_ipv6: no such file or directory”

    Little help (please)?

    • Xiao Guoan (Admin)
      3 years ago

      Check if your system has the tun0 network interface.

      ip addr

      If your system doesn’t have this interface, then you should remove the following line in /etc/sysctl.conf file.

      net.ipv6.conf.tun0.disable_ipv6 = 1
  • I can’t paste or enter the Open VPN password once I add the username. Seems to be an error. Any suggestions? Literally doesn’t let me add any text.

    • Xiao Guoan (Admin)
      3 years ago

      It can take the password but won’t echo out your password.

  • i am using lubuntu 20.04
    i installed it following the instructions here, including those for having it running on system startup. right after installation it worked great. since after first reboot it’s leaking WebRTC requests.
    is there any way to fix this?

    • Xiao Guoan (Admin)
      3 years ago

      Is your ISP’s IP address displayed on the ipleak.net site?

  • I’m using the DoH (DNS over HTTPS) cloudflare option in Firefox browser on Linux. On ipleak.net I get the proton IP address, and in the DNS section I get the nearest cloudflare server address. No leaks as far as I can see, testing it on various systems and it seems to add the extra layer of protection of encrypted DoH for DNS requests that I would expect, without compromising anything else.

    But just testing it this point, wondering if there could be a problem with using the DoH cloudflare option in FF that you know of with protonvpn. Is it redundant to use DoH with protonvpn/openvpn, can I trust a third party DoH with these requests, etc.

    • Xiao Guoan (Admin)
      3 years ago

      When you use a VPN, your DNS queries are encrypted in the VPN tunnel, so DNS over HTTPS is not necessary.

  • Thank you very much! Outstanding tutorial <3

  • annesanvo
    2 years ago

    This is one of the most detailed, easy to understand and follow tutorials I’ve ever seen. I’ve been struggling with the idiots at Protonvpn’s support. Unfortunately I prepaid for an Annual plan. It installs easily on Win 10 but is an absolute nightmare on Linux.
    I was fortunate to stumble onto your site after weeks of frustration. Thank you so much.

  • Now after you’ve done all of this, put your laptop to sleep or suspend back in and see if your vpn connects. Most likely it will not regardless if you are using cli or gui. Proton says this is an IPV6 issue that is rectified by disconnecting prior to rebooting or closing the laptop lid. This is not true. In short, ProtonVPN especially with the gui is not ready for Linux.

  • Great instructions, it’s working so far. Can you please answer, is there any way to run ProtonVPN as a service so that it connects to a specific country all the time?

  • Geert W
    2 weeks ago

    Ja klop het blijkt inderdaald achtergehaald, maar volgens mij klopt het nog steeds. Als jij een sign up doet bij ProtonVPN kun je in het eerste scherm (helemaal links beneden in de hoek) keuze maken voor een “free subscription”. Dan nog flink meet een 10 minuuten temp email valideeren en je bent klaar 😉

Leave a Comment

  • Comments with links are moderated by admin before published.
  • Your email address will not be published.
  • Use <pre> ... </pre> HTML tag to quote the output from your terminal/console.
  • Please use the community (https://community.linuxbabe.com) for questions unrelated to this article.
  • I don't have time to answer every question. Making a donation would incentivize me to spend more time answering questions.

The maximum upload file size: 2 MB. You can upload: image. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop file here