How to Set Up a VPN on Linux Ubuntu (and Which One to Pick)

How to Set Up a VPN on Linux Ubuntu (and Which One to Pick)

Setting up a VPN on Linux Ubuntu is easier than most people expect, but picking the right provider is where people get stuck. A lot of VPN companies treat Linux as an afterthought. You pay for a subscription, go to download the app, and find a half-finished command-line tool or a pile of config files. I've done that more than once, so this guide covers both parts: which VPNs work well on Ubuntu, and how to get one running in about ten minutes.

Why I Started Using a VPN on Ubuntu (and Why You Might Want One Too)

I switched my work laptop to Ubuntu years ago and spent most of that time without a VPN. That changed when I started working from hotels and coworking spaces where the Wi-Fi had no password, or one taped to the wall.

When I traveled to Turkey last year, a few sites I used for work wouldn't load on the local network. My VPN fixed that within a minute. When I tested this in Dubai, the bigger issue was calling. WhatsApp and Telegram voice calls didn't work reliably on the hotel connection, and having a VPN ready on both my laptop and phone saved me some frustration. Check local laws before you travel, because VPN rules vary by country.

Even at home, a VPN keeps your ISP from logging every domain you visit and lets you reach your usual streaming libraries when you're abroad. On Linux, it also gives you one consistent privacy setup instead of a patchwork of browser extensions.

What to Look for in a Linux VPN Before You Pay a Cent

Before you compare prices, check these things:

  • A native Ubuntu app. Ideally a .deb package or an official apt repository. A graphical interface is a bonus. A command-line client is fine if it's well maintained.
  • WireGuard support. It's faster and lighter than OpenVPN, and it's built into the Linux kernel. If you're curious why that matters, here's a breakdown of [INTERNAL_LINK:/en/what-is-wireguard/].
  • A kill switch. If the VPN drops, your traffic should stop instead of falling back to your normal connection.
  • DNS and IPv6 leak protection. On Linux these leaks are more common than you'd expect, especially on manual setups.
  • Downloadable config files. If the app ever breaks after an Ubuntu upgrade, you want a manual fallback.
  • A clear no-logs policy, preferably one that's been independently audited.

The Best VPNs for Ubuntu Compared: Features, Pricing, and Real Value

Here's how the main options compare for Ubuntu users. Prices are rough figures for long-term plans and change often, so check the current deals before you buy.

| VPN | Ubuntu App | WireGuard | Kill Switch | Approx. Price (long-term plan) |
|---|---|---|---|---|
| NordVPN | CLI + newer GUI | Yes (NordLynx) | Yes | ~$3–5/mo |
| Surfshark | GUI | Yes | Yes | ~$2–3/mo |
| Proton VPN | GUI | Yes | Yes | ~$4–5/mo (free tier available) |
| Mullvad | GUI | Yes | Yes | Flat ~€5/mo |
| ExpressVPN | CLI | Lightway (own protocol) | Yes | ~$5–7/mo |
| Private Internet Access | GUI | Yes | Yes | ~$2–3/mo |

Quick notes on each

Surfshark is the best value if you have a lot of devices, since it doesn't cap simultaneous connections. The Linux GUI is simple and does the job.

Proton VPN has one of the most polished Linux apps I've used, and its free tier is one of the few free options worth trying. Its apps are open source too.

Mullvad is the choice if privacy matters most to you. You don't need an email to sign up, and there's one flat price with no "75% off" games.

NordVPN is fast and full of features, but it was command-line only on Linux for a long time. If you like terminals, that's a plus.

ExpressVPN is reliable and easy to use, but you pay more for it, and the Linux experience still lags behind its Windows and Mac apps.

For a broader comparison across all platforms, see our roundup of the [INTERNAL_LINK:/en/best-vpn/].

How to Set Up a VPN on Linux Ubuntu Using the Official App

Most providers follow the same basic steps:

  1. Download the .deb file from your provider's website, or follow their instructions to add their apt repository.

  2. Install it by opening a terminal in your Downloads folder:

    sudo apt install ./provider-name.deb
    

    If the provider uses a repository, it'll look more like sudo apt update && sudo apt install provider-name.

  3. Log in. GUI apps show a login window. CLI apps usually use something like providername login.

  4. Turn on the kill switch in settings before you connect for the first time. Don't skip this.

  5. Pick WireGuard (or the provider's version of it) as your protocol.

  6. Connect to the nearest server first so you have a baseline.

In my experience, the most common problem is a missing dependency on newer Ubuntu releases. Running sudo apt -f install usually fixes it.

Setting It Up Manually with OpenVPN or WireGuard (No App Required)

If your provider doesn't have a Linux app, or you'd rather not install one, Ubuntu can handle VPN connections on its own.

WireGuard (recommended)

  1. Install the tools:
    sudo apt install wireguard
    
  2. Download a WireGuard config file from your provider's dashboard.
  3. The easiest option is to import it into NetworkManager so it shows up in your system menu:
    sudo nmcli connection import type wireguard file ~/Downloads/wg0.conf
    
  4. You can also place it at /etc/wireguard/wg0.conf and run sudo wg-quick up wg0. If you see a DNS error, install openresolv and try again.

OpenVPN

  1. Install the NetworkManager plugin:
    sudo apt install network-manager-openvpn-gnome
    
  2. Go to Settings → Network → VPN → + and choose Import from file.
  3. Select your .ovpn file, enter your VPN username and password (these are often different from your account login), and save.
  4. Toggle it on from the top-right system menu.

The tradeoff with manual setups is that you usually don't get a kill switch. You'd need to build one yourself with ufw rules, which is doable but fiddly.

Testing Your Connection: Leak Checks, Speed, and Kill Switch

Don't assume the VPN is working just because it says "connected." Check these three things.

IP and DNS leaks: Run curl ifconfig.me in the terminal and confirm it shows the VPN server's IP. Then visit ipleak.net or dnsleaktest.com in your browser. If your ISP's name appears anywhere, you have a DNS leak. Also check for IPv6 leaks and WebRTC leaks, which ipleak.net will flag.

Speed: Install speedtest-cli (sudo apt install speedtest-cli) and run it once with the VPN off and once with it on. On WireGuard with a nearby server, I usually lose 10–20% at most.

Kill switch: While connected, start a large download or play a video, then disconnect the VPN through the app or kill its process. Your traffic should stop entirely. If the download keeps going on your regular connection, the kill switch isn't working.

My Pick for Most Ubuntu Users and Who Should Choose Something Else

For most Ubuntu users, I'd go with Proton VPN or Surfshark. Proton's Linux app is the most polished, and you can try the free tier before paying. Surfshark is cheaper and covers every device in your house.

Choose something else if:

  • You care most about anonymity: go with Mullvad.
  • You live in the terminal and want strong speeds: NordVPN's CLI is very good.
  • You want the simplest setup and don't mind paying more: ExpressVPN.

Whichever you pick, use WireGuard, enable the kill switch, and run a leak test after setup. Those three steps matter more than the brand name.

Frequently Asked Questions

Do all VPN providers support Ubuntu?

No, and this catches a lot of people off guard. Plenty of big-name VPNs offer only a bare-bones command-line client for Linux, or no app at all, which leaves you configuring OpenVPN or WireGuard files by hand. Before you subscribe, check whether the provider has a native Ubuntu app (ideally with a GUI), a kill switch, and DNS leak protection built in. Those three things matter more than a long server list.

Is a free VPN good enough for Ubuntu?

For a quick test, maybe. For everyday use, I wouldn't rely on one. Free VPNs usually cap your data, limit you to a handful of crowded servers, and often skip Linux support entirely. Some also log and sell your browsing data, which defeats the purpose. A paid plan on a long-term subscription often works out to just a few dollars a month, and you get WireGuard speeds, more locations, and a real privacy policy.

Will a VPN on Ubuntu slow down WhatsApp, Telegram, or TikTok?

A good one shouldn't slow them down in any way you'd notice. With WireGuard and a nearby server, I barely see a difference when messaging on WhatsApp Web or Telegram Desktop, or scrolling TikTok in the browser. If things feel sluggish, try switching protocols or picking a closer server. Some providers also offer split tunneling on Linux, so you can send only certain apps through the VPN and keep the rest on your regular connection.


Your laptop isn't the only device using public Wi-Fi. Your phone handles most of your WhatsApp, Telegram, and TikTok use, and it needs protection too. Download Free 7-Day Trial of our VPN on iPhone and iPad or Android and protect your mobile traffic in under a minute.

← Back to all VPN guides

Try Unblock Master VPN

Fast, secure VPN for UAE, Turkey & MENA. Free 7-day trial.