Proton VPN Linux Guide – How to install, configure, use and auto-connect?

19 May 2023 | Linux Guide, Privacy

Proton VPN - Linux Guide - Install, Configure, Use & Auto-Connect

Content

  1. Introduction
  2. Installing
  3. Configuring and using

    1. Login and basic configuration
    2. Advanced configuration
    3. Connecting to the VPN servers
  4. Setting up auto-connect on boot
  5. Other options
  6. References

Introduction

It is widely known that the Proton team does not focus on Linux users as much as they focus on Windows and macOS users. The official Proton VPN Linux client lacks a lot of features, like changing the connection protocol, quickly connecting to the fastest server of a specific country, enabling their VPN Accelerator etc.

However, we can achieve a lot using their official CLI client. And yes, that is what we are going to use. No third-party applications.

Installing the official Linux CLI

Debian

Get the Proton VPN repository setup DEB package:

wget https://repo.protonvpn.com/debian/dists/stable/main/binary-all/protonvpn-stable-release_1.0.3_all.deb

Install the Proton VPN repository:

sudo apt-get install ./protonvpn-stable-release_1.0.3_all.deb

Update the apt-get package list:

sudo apt-get update

Install the Proton VPN Linux CLI:

sudo apt-get install protonvpn-cli

Fedora 35+

Get the Proton VPN repository setup RPM package:

wget https://protonvpn.com/download/protonvpn-stable-release-1.0.1-1.noarch.rpm

Install the Proton VPN repository:

sudo dnf install ./protonvpn-stable-release-1.0.1-1.noarch.rpm

Update the dnf package list:

sudo dnf update

Install the Proton VPN Linux CLI:

sudo dnf install protonvpn-cli

Install required dependencies for the alternative routing feature:

sudo dnf install python3-pip
pip3 install --user 'dnspython>=1.16.0

Arch

Update your local repository:

pamac update --force-refresh

Verify that Proton VPN is now in your local repository:

pamac search --aur protonvpn-cli

Build and install Proton VPN:

pamac build protonvpn-cli

Note - Visit the Proton VPN’s official documentation page if you get any errors or need detailed instructions.

Configuring and using the CLI tool

Terminal screenshot with the command "protonvpn-cli --help".

Login and basic configuration

To log in, use this command and follow the on-screen instructions:

protonvpn-cli login

Turn on VPN Accelerator:

protonvpn-cli config --vpn-accelerator enable

Turn on NetShield to block ads and malware:

protonvpn-cli ns --ads-malware

Change default connection protocol to TCP:

protonvpn-cli config -p tcp

Advanced configuration

Change DNS configuration:

protonvpn-cli config --dns custom --ip 9.9.9.9

You can add upto 3 IPs, or leave it at automatic by using this command:

protonvpn-cli config --dns automatic

Turn on alternative routing to circumvent censorship:

protonvpn-cli config --alt-routing enable

Turn on the Kill Switch:

protonvpn-cli ks --on

or

protonvpn-cli ks --permanent

For more configuration options, use:

protonvpn-cli --help

and

protonvpn-cli config --help

Connecting to the VPN servers

To manually select the country and the server to connect to, use the following command and follow the on-screen instructions:

protonvpn-cli c

To connect to the fastest Proton VPN server for your location, for example, enter:

protonvpn-cli c -f

To connect to the fastest Tor server, enter:

protonvpn-cli c --tor

To connect to the fastest server in a specific country, a country code can be used. For example, the following command connects to the fastest server in Germany using TCP:

protonvpn-cli c --cc DE -p TCP

Setting up auto-connect at boot

The following method is tested on Debian 11 with Xfce, Fedora 38 Workstation with Gnome and Manjaro 22.1.1 with KDE.

Go to the autostart folder in your home directory which contains all your application shortcuts that start immediately after login:

cd ~/.config/autostart

Create a new file:

nano pvpn.desktop

Paste the following:

[Desktop Entry]
Exec=protonvpn-cli c -f
Name=ProtonVPN Autoconnect
Comment=Autoconnect to the fastest server
Type=Application
Icon=protonvpn-logo

Change the “Exec” value according to your needs. For example, use

protonvpn-cli c --cc DE -p TCP

to connect to the fastest server in Germany using the TCP protocol. Save the file by hitting Ctrl + X, then Y, and then Enter.

Test this by logging out and then logging back in. Or just restart the whole system. If everything went perfectly, you should be automatically connected to the VPN when you log in.

If due to some reason you are not automatically connected, change the “Exec” value to:

Exec=bash -c "sleep 10 && protonvpn-cli c -f"

This will delay the command execution by ten seconds.

Other options

There are other options:

References


Comments

Recent Posts

How to Bypass CGNAT - Exposing your home server to the internet with TLS/SSL pass through

07 October 2023 | Linux Guide, Privacy, Self-hosting

You've set up a home server, and are hosting some services like Vaultwarden, or Jellyfin, or perhaps Nextcloud. But now, you want to share it...

Read More

Remap keyboard keys using evremap

21 May 2023 | Linux Guide

Sometimes a key on your keyboard stops working, and you may not have the time or motivation to fix it or get it fixed. Or...

Read More

Proton VPN Linux Guide – How to install, configure, use and auto-connect?

19 May 2023 | Linux Guide, Privacy

The official Proton VPN Linux client lacks a lot of features, like changing the connection protocol, quickly connecting to the fastest server of a specific...

Read More

MusicOther ProjectsPrivacy PolicyAbout