blog/proton-vpn-linux-guide.html

332 lines
16 KiB
HTML
Raw Permalink Normal View History

2024-06-10 21:30:20 +00:00
<!DOCTYPE html>
<html lang="en-IN">
<head>
<title>Proton VPN Linux Guide How to install, configure, use and auto-connect? | Aiquiral's Blog</title>
<meta name="description" content="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.">
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta charset="utf-8">
<link rel="icon" type="image/x-icon" href=/assets/logo/favicon.svg />
<link rel="stylesheet" href=/assets/css/style.css />
</head>
<body>
<div class="head">
<div class="line-top"></div>
<nav>
<ul class='nav-bar'>
<li class='logo'><a href=/index.html><img src=/assets/logo/favicon.svg /></a></li>
<input type='checkbox' id='check' />
<span class="menu">
<li><a href="https://blog.aiquiral.me">Home</a></li>
<li><a href="https://portfolio.aiquiral.me">Portfolio</a></li>
<li><a href="https://aiquiral.me/contact">Contact</a></li>
<li><a href="https://aiquiral.me/about">About</a></li>
<label for="check" class="close-menu">X</label>
</span>
<label for="check" class="open-menu"></label>
</ul>
<noscript>
<img src="https://a.aiquiral.me/ingress/3a4a78d5-5d52-4f8e-9272-925d46af3166/pixel.gif">
</noscript>
<script defer src="https://a.aiquiral.me/ingress/3a4a78d5-5d52-4f8e-9272-925d46af3166/script.js"></script>
</nav>
</div>
<div class="blog-post">
<h1 class="post-heading">Proton VPN Linux Guide How to install, configure, use and auto-connect?</h1>
<p class="post-date">19 May 2023 | Linux Guide, Privacy</p>
<img src="/assets/posts/2023-05-19-proton-vpn-linux-guide/proton.svg" class="featured" alt="Proton VPN - Linux Guide - Install, Configure, Use & Auto-Connect" title="Proton VPN Linux Guide How to install, configure, use and auto-connect?"/>
<h2 id="content">Content</h2>
<ol start="0">
<li><a href="#introduction">Introduction</a></li>
<li><a href="#installing-the-official-linux-cli">Installing</a>
<ul>
<li><a href="#debian">Debian</a></li>
<li><a href="#fedora-35">Fedora 35+</a></li>
<li><a href="#arch">Arch</a></li>
</ul>
</li>
<li>
<p><a href="#configuring-and-using">Configuring and using</a></p>
<ol type="a">
<li><a href="#login-and-basic-configuration">Login and basic configuration</a></li>
<li><a href="#advanced-configuration">Advanced configuration</a></li>
<li><a href="#connecting-to-the-vpn-servers">Connecting to the VPN servers</a></li>
</ol>
</li>
<li><a href="#setting-up-auto-connect-at-boot">Setting up auto-connect on boot</a></li>
<li><a href="#other-options">Other options</a></li>
<li><a href="#references">References</a></li>
</ol>
<h2 id="introduction">Introduction</h2>
<p>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.</p>
<p>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.</p>
<h2 id="installing-the-official-linux-cli">Installing the official Linux CLI</h2>
<h3 id="debian">Debian</h3>
<p>Get the Proton VPN repository setup DEB package:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>wget https://repo.protonvpn.com/debian/dists/stable/main/binary-all/protonvpn-stable-release_1.0.3_all.deb
</code></pre></div></div>
<p>Install the Proton VPN repository:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo apt-get install ./protonvpn-stable-release_1.0.3_all.deb
</code></pre></div></div>
<p>Update the apt-get package list:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo apt-get update
</code></pre></div></div>
<p>Install the Proton VPN Linux CLI:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo apt-get install protonvpn-cli
</code></pre></div></div>
<h3 id="fedora-35">Fedora 35+</h3>
<p>Get the Proton VPN repository setup RPM package:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>wget https://protonvpn.com/download/protonvpn-stable-release-1.0.1-1.noarch.rpm
</code></pre></div></div>
<p>Install the Proton VPN repository:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo dnf install ./protonvpn-stable-release-1.0.1-1.noarch.rpm
</code></pre></div></div>
<p>Update the dnf package list:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo dnf update
</code></pre></div></div>
<p>Install the Proton VPN Linux CLI:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo dnf install protonvpn-cli
</code></pre></div></div>
<p>Install required dependencies for the alternative routing feature:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo dnf install python3-pip
pip3 install --user 'dnspython&gt;=1.16.0
</code></pre></div></div>
<h3 id="arch">Arch</h3>
<p>Update your local repository:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pamac update --force-refresh
</code></pre></div></div>
<p>Verify that Proton VPN is now in your local repository:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pamac search --aur protonvpn-cli
</code></pre></div></div>
<p>Build and install Proton VPN:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>pamac build protonvpn-cli
</code></pre></div></div>
<p class="important-note"><strong>Note</strong> - Visit the Proton VPNs <a href="https://protonvpn.com/support/linux-vpn-tool/">official documentation page</a> if you get any errors or need detailed instructions.</p>
<h2 id="configuring-and-using-the-cli-tool">Configuring and using the CLI tool</h2>
<p><img src="/assets/posts/2023-05-19-proton-vpn-linux-guide/protonvpn-cli_-help.avif" alt="Terminal screenshot with the command &quot;protonvpn-cli --help&quot;." title="Proton VPN CLI with --help argument" /></p>
<h3 id="login-and-basic-configuration">Login and basic configuration</h3>
<p>To log in, use this command and follow the on-screen instructions:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>protonvpn-cli login
</code></pre></div></div>
<p>Turn on VPN Accelerator:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>protonvpn-cli config --vpn-accelerator enable
</code></pre></div></div>
<p>Turn on NetShield to block ads and malware:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>protonvpn-cli ns --ads-malware
</code></pre></div></div>
<p>Change default connection protocol to TCP:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>protonvpn-cli config -p tcp
</code></pre></div></div>
<h3 id="advanced-configuration">Advanced configuration</h3>
<p>Change DNS configuration:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>protonvpn-cli config --dns custom --ip 9.9.9.9
</code></pre></div></div>
<p>You can add upto 3 IPs, or leave it at automatic by using this command:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>protonvpn-cli config --dns automatic
</code></pre></div></div>
<p>Turn on alternative routing to circumvent censorship:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>protonvpn-cli config --alt-routing enable
</code></pre></div></div>
<p>Turn on the Kill Switch:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>protonvpn-cli ks --on
</code></pre></div></div>
<p>or</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>protonvpn-cli ks --permanent
</code></pre></div></div>
<p>For more configuration options, use:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>protonvpn-cli --help
</code></pre></div></div>
<p>and</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>protonvpn-cli config --help
</code></pre></div></div>
<h3 id="connecting-to-the-vpn-servers">Connecting to the VPN servers</h3>
<p>To manually select the country and the server to connect to, use the following command and follow the on-screen instructions:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>protonvpn-cli c
</code></pre></div></div>
<p>To connect to the fastest Proton VPN server for your location, for example, enter:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>protonvpn-cli c -f
</code></pre></div></div>
<p>To connect to the fastest Tor server, enter:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>protonvpn-cli c --tor
</code></pre></div></div>
<p>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:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>protonvpn-cli c --cc DE -p TCP
</code></pre></div></div>
<h2 id="setting-up-auto-connect-at-boot">Setting up auto-connect at boot</h2>
<p>The following method is tested on Debian 11 with Xfce, Fedora 38 Workstation with Gnome and Manjaro 22.1.1 with KDE.</p>
<p>Go to the autostart folder in your home directory which contains all your application shortcuts that start immediately after login:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>cd ~/.config/autostart
</code></pre></div></div>
<p>Create a new file:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>nano pvpn.desktop
</code></pre></div></div>
<p>Paste the following:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>[Desktop Entry]
Exec=protonvpn-cli c -f
Name=ProtonVPN Autoconnect
Comment=Autoconnect to the fastest server
Type=Application
Icon=protonvpn-logo
</code></pre></div></div>
<p>Change the “Exec” value according to your needs. For example, use</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>protonvpn-cli c --cc DE -p TCP
</code></pre></div></div>
<p>to connect to the fastest server in Germany using the TCP protocol. Save the file by hitting Ctrl + X, then Y, and then Enter.</p>
<p>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.</p>
<p>If due to some reason you are not automatically connected, change the “Exec” value to:</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>Exec=bash -c "sleep 10 &amp;&amp; protonvpn-cli c -f"
</code></pre></div></div>
<p>This will delay the command execution by ten seconds.</p>
<h2 id="other-options">Other options</h2>
<p>There are other options:</p>
<ul>
<li>Installing <a href="https://www.wireguard.com/install/">Wireguard</a>, generating a <a href="https://protonvpn.com/support/wireguard-configurations/">config file</a> and using that.</li>
<li>Using OpenVPN <a href="https://protonvpn.com/support/linux-openvpn/">config files</a> to connect to the VPN.</li>
<li>Setting up the VPN on <a href="https://protonvpn.com/support/installing-protonvpn-on-a-router/">your router</a>.</li>
</ul>
<h2 id="references">References</h2>
<ul>
<li><a href="https://github.com/ProtonVPN/linux-cli">https://github.com/ProtonVPN/linux-cli</a></li>
<li><a href="https://protonvpn.com/support/">https://protonvpn.com/support/</a></li>
</ul>
</div>
<div class="comments">
<hr>
<h2>Comments</h2>
<script>
var remark_config = {
host: 'https://comments.aiquiral.me',
site_id: 'blog',
}
</script>
<script>!function(e,n){for(var o=0;o<e.length;o++){var r=n.createElement("script"),c=".js",d=n.head||n.body;"noModule"in r?(r.type="module",c=".mjs"):r.async=!0,r.defer=!0,r.src=remark_config.host+"/web/"+e[o]+c,d.appendChild(r)}}(remark_config.components||["embed"],document);</script>
<div id="remark42"></div>
</div>
<div class="comments">
<h2>Recent Posts</h2>
<div class="all-posts-table"><div class="allposts-post">
<a href="/bypass-cgnat">
<img src="/assets/posts/2023-10-07-bypass-cgnat/bypass-cgnat.avif" class="latest" />
<h3 style="color: #25252d;">How to Bypass CGNAT - Exposing your home server to the internet with TLS/SSL pass through</h3>
<p>07 October 2023 | Linux Guide, Privacy, Self-hosting</p>
<p>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...</p>
<p style="color: #2ea3f2;">Read More</p>
</a>
</div><div class="allposts-post">
<a href="/remap-keyboard-keys-using-evremap">
<img src="/assets/posts/2023-05-21-remap-keyboard-keys-using-evremap/evremap.avif" class="latest" />
<h3 style="color: #25252d;">Remap keyboard keys using evremap</h3>
<p>21 May 2023 | Linux Guide</p>
<p>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...</p>
<p style="color: #2ea3f2;">Read More</p>
</a>
</div><div class="allposts-post">
<a href="/proton-vpn-linux-guide">
<img src="/assets/posts/2023-05-19-proton-vpn-linux-guide/proton.svg" class="latest" />
<h3 style="color: #25252d;">Proton VPN Linux Guide How to install, configure, use and auto-connect?</h3>
<p>19 May 2023 | Linux Guide, Privacy</p>
<p>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...</p>
<p style="color: #2ea3f2;">Read More</p>
</a>
</div></div>
</div>
<div class="foot"><p style="text-align: center;"><a href="https://soundcloud.com/aiquiral">Music</a> <a href="https://git.aiquiral.me/aiquiral">Other Projects</a> <img src=/assets/logo/inline-logo.svg style="position:relative;bottom:-3px" width=28 height=32></img> <a href="https://aiquiral.me/privacy-policy.html">Privacy Policy</a> <a href="https://aiquiral.me/about.html">About</a></p></div>
<div class="line-bottom"></div>
</body>
</html>