Linux, Web Hosting, and Everything Else in Between
Linux, Web Hosting, and Everything Else in Between

How to set up a VPN on Linux

vpn for linux users

In this tutorial, we’re going to show you how to set up a VPN on Linux and why you’d need one.

From our previous articles, you already know what a VPN is, if it’s necessary on Linux, and even how to set up OpenVPN on Ubuntu. In this article, we’re going to show you how to set up a VPN on Ubuntu from a specific VPN provider with their own VPN client, not setting up OpenVPN yourself.

Step 1: Choose a provider

Y0u have lots of choices out there for VPN providers. You can do your own research and choose what provider suits you the best. We recommend using Surfshark, and for this tutorial, we’ll be using their Linux VPN client for Ubuntu.

Step 2: Download and install their VPN client

Go to the download page linked in step 1 and download the client. As of writing, the latest Surfshark Linux VPN client is 1.0.0-2.

Navigate to the /opt directory and download the .deb file:

cd /opt

Next, install the file you just downloaded:

sudo dpkg -i surfshark-release_1.0.0-2_amd64.deb

Update your repos:

sudo apt-get update

And finally install the app with:

sudo apt-get install surfshark-vpn

Step 3: How to use it on Ubuntu

To start using the Surfshark VPN client, open up Terminal on your Ubuntu and run:

sudo surfshark-vpn

And then follow the prompts by the app. You’ll need to enter your login details, location choice, etc. Feel free to close your terminal now and continue using your Ubuntu with a VPN. It will run in the background.

You can do other stuff with the Surfshark VPN client via the CLI (Terminal). To get a list of all the available commands, run:

sudo surfshark-vpn help


surfshark-vpn attack - quick connects to nearest server	 

surfshark-vpn multi - connects to a MultiHop server	 

surfshark-vpn down - kills already running vpn client	 

surfshark-vpn status - show status	 

surfshark-vpn forget - logouts from the app	 

surfshark-vpn version - shows version

As you can see, it’s pretty easy to use. The fact that you can use it via the CLI makes it super useful for scripts and automation.

Do you need a VPN on Linux?

Even though, in general, Linux may be safer than Windows and macOS, you’d still need a VPN for several reasons, some of which are:

Accessing geo-locked content

Some content online is locked to a certain country or location. This is super handy if you’re outside the US or UK, a lot of online streaming services limit their services to those countries.

Accessing blocked websites

Some websites block visitors from certain countries. This is an easy fix if you’re using a VPN.

Accessing public Wi-Fi

Using public WiFis unprotected isn’t recommended in any case, no matter what OS you’re using.

Being more secure and private

If you want to be more secure online and keep your data private, you should use a VPN, no matter the OS.

So, as you can see, all the benefits of a VPN for Windows or macOS work for Linux too. A lot of Linux users have a VPN and use it on a daily basis.

Do you use a VPN on Linux? What VPN provider do you use? Leave a comment below.

Leave a comment

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

One thought on “How to set up a VPN on Linux”