How to Set Up PrivateVPN on Ubuntu? (6 Setup Methods)

We are reader supported and may earn a commission when you buy through links on our site. Learn more.

You can set up PrivateVPN on Ubuntu via the Linux Network Manager or the OpenVPN client configuration. Alternatively, you have the PrivateVPN AnyConnect and WireGuard setups for Ubuntu.

Ubuntu users who only want browser-side protection can install the PrivateVPN proxy in their Chrome or Firefox browsers.

Most of these setups require running specific command lines in your Ubuntu terminal.

Don’t worry! I’ll show you the exact steps to set up PrivateVPN for Ubuntu, teach you how to disconnect from the VPN under each method, and share terminal commands to uninstall the VPN package.

How to Set Up PrivateVPN on Ubuntu via Network Manager?

Setting up PrivateVPN via the Ubuntu Network Manager entails installing a PrivateVPN server certificate into the Linux distro.

You can connect via OpenVPN, L2TP protocols, or OpenConnect using this method.

OpenVPN (UDP & TCP) Method

OpenVPN is the more reliable PrivateVPN protocol for using the Network Manager. Follow the steps below to get it done right:

  1. Get a PrivateVPN account. Grab these one-time PrivateVPN deals before they expire.
privatevpn pricing
Image for illustration only. Design, deals, and details may differ. Click on the image for current info.
  1. Download a preferred PrivateVPN OpenVPN configuration file. You can access the list of UDP (faster) and TCP (better stability) servers below.
    1. UDP: https://intercom.help/privatevpn/en/articles/6349164-openvpn-configuration-files-udp-1194
    2. TCP: https://intercom.help/privatevpn/en/articles/6419539-openvpn-configuration-files-tcp-443
  2. I’ll download the Australia – Melbourne UDP server configuration for this demo. You can choose a nearby server (for low gaming ping or online security) or a foreign server (to unblock content).
download australia melbourne udp server configuration
  1. Launch your Ubuntu terminal. You can get this through the apps, searching for the terminal, or holding Ctrl + Alt + T keys on your keyboard.
  2. Run the command line below to install the OpenVPN network manager.
    1. Even if you’ve installed the network manager, I recommend rerunning the command to ensure you use the latest version.
				
					sudo apt-get install network-manager-openvpn network-manager-openvpn-gnome resolvconf
				
			
running sudo apt install network manager openvnp for ubuntu
  1. Input your password, if requested, then click Enter. Note that the cursor won’t move while you’re entering your password.
enter password in ubuntu
  1. Once successfully installed, click the Ubuntu system status tray. It’s in the upper right corner of your screen.
selecting the ubuntu system status tray
  1. Click VPN Off > VPN Settings.
  2. Alternatively, if you’ve never set up any other VPN, click Wired Connected > Wired Settings.
locating ubuntu wired settings
  1. Click the “+” sign in front of “VPN.”
vpn plus sign on ubuntu
  1. Click “Import from file.”
selecting import from file in ubuntu
  1. Open the folder where you downloaded the server configuration from Step 3. That’s “Downloads,” in my case.
selecting privatevpn configuration file iin downloads folder
  1. Select the server file, then click “Open.”
  2. Optional: Change the network name to anything you want. I’ll use “AU Server” to quickly identify it later.
adding au server in ubuntu
  1. Enter your PrivateVPN account username and password in the pop-up screen. Click “Add.”
  2. Click the greyed-out icon to connect to the server.
enable au server vpn in ubuntu
  1. Test for leaks to ensure you’re getting the server IP address.
privatevpn ip leak test results in australia victoria server
  1. You can now browse the web securely, connect to gaming peers across PrivateVPN’s 63 server locations, and download torrents without alerting your ISP!
unblocking 9now with privatevpn on australia server
I unblocked the Australian-exclusive 9Now over the PrivateVPN Australia server

L2TP Method

The PrivateVPN-Ubuntu L2TP Network Manager setup might offer slightly faster speeds than its OpenVPN counterpart. However, you’re trading reliable encryption.

So, don’t use this method for sensitive tasks like accessing banking platforms over public Wi-Fi or downloading torrents.

That said, here are the steps:

  1. You’ll need a PrivateVPN account. Use these discounts to save on your first subscription.
privatevpn pricing
Image for illustration only. Design, deals, and details may differ. Click on the image for current info.
  1. Launch your Ubuntu terminal.
  2. Run the command below to install the L2TP network manager.
				
					sudo apt-get install network-manager-l2tp network-manager-l2tp-gnome
				
			
running sudo apt install l2tp network manager code in ubuntu
  1. Enter your Ubuntu admin password and press Enter if prompted.
  2. Press Y. Then, press Enter to continue.
entering ubuntu admin password
  1. Once downloaded, access the PrivateVPN server list here.
  2. Copy a server address to the IP address you want. I’ll copy the Belgium server address for this guide.
copying belgium server address in privatevpn
  1. Click the Ubuntu systems tray, then click Wired Connected > Wired Settings.
locating ubuntu wired settings
  1. Click the “+” sign in front of “VPN.”
selecting + icon beside vpn in ubuntu
  1. Click “Layer 2 Tunneling Protocol (L2TP).”
selecting layer 2 tunneling protocol in ubuntu
  1. Give the connection any name you please. I named mine “Belgium PrivateVPN Server.”
belgium privatevpn server as server name
  1. Fill in the remainder of the details below:
    1. Gateway – The server address you copied in Step 7.
    2. Username – Your PrivateVPN account email address.
    3. Password – Your PrivateVPN account password.
adding server details in ubuntu
  1. Next, click “IPsec Settings.”
  2. Check “Enable IPsec tunnel to L2TP host.”
setting up l2tp ipsec options in ubuntu
  1. Enter “privatvpn” in the “Pre-shared key” field. Please note that this is “PrivateVPN” without the “e” and in all lowercase letters.
  2. Click “OK.”
  3. Click “Add.”
locating add server button in ubuntu
  1. Toggle the created L2TP connection name (from Step 11) to connect to the VPN server.
enable belgium privatevpn server vpn in ubuntu
  1. Test for leaks. If successful, you should get an IP address from the connected server.
privatevpn ip leak test results in belgium brussels server
  1. Watch Netflix US abroad, unblock BBC iPlayer outside the UK, download P2P files faster without ISP internet throttling, and enjoy your PrivateVPN-assigned IP address for anything else on Ubuntu!
streaming ab3 with privatevpn on belgium server
I unblocked the Belgium-exclusive AB3 in HD over PrivateVPN's Belgium server

AnyConnect Method

AnyConnect is built on the open-source OpenConnect, allowing you to create a private VPN with preferred server libraries. It often uses UDP, which makes it faster than OpenVPN TCP.

Here’s how to set it up:

  1. You need a PrivateVPN account to use with AnyConnect. Get one via these discount offers.
  2. Go to the PrivateVPN AnyConnect server list (here) and copy a preferred server address. I’ll use the France server for this example.
copying france anyconnect server address from privatevpn
  1. Launch your Ubuntu terminal.
  2. Run the command below to download the OpenConnect manager to your Ubuntu system.
				
					sudo apt-get install openconnect network-manager-openconnect network-manager-openconnect-gnome
				
			
running sudo apt install openconnect network manager code in ubuntu
  1. Press Y, then the Enter key if prompted.
choosing y option in ubuntu
  1. Once downloaded, click the systems status tray to access the Network Manager.
locating ubuntu wired settings
  1. Click Wired Connected > Wired Settings.
  2. Click the “+” sign against “VPN.”
locating + sign in ubuntu to add vpn
  1. Select “Multi-protocol VPN client (openconnect).”
selecting multi protocol vpn client in ubuntu
  1. Set any name for the connection. I’ll use “France AnyConnect Server” for easy referencing.
adding france anyconnect server in ubuntu
  1. Enter the server address you copied in Step 2 as “Gateway.”
  2. Leave the other settings as is, then click “Add.”
  3. Toggle the VPN connection you just created.
enable france anyconnect server vpn in ubuntu
  1. Enter your PrivateVPN account username (email address) in the pop-up box. Then, click “Login.”
login for france anyconnect server in ubuntu
  1. Enter your PrivateVPN account password in the next popup box. Click “Login” again.
password login for france anyconnect server in ubuntu
  1. Optional: You can toggle the “Save passwords” option.
  2. Test for leaks to ensure you’re browsing with the VPN-assigned IP address.
privatevpn ip leak test results on france paris server
  1. Start unblocking choice content, keep your IP hidden on untrusted networks or download torrents faster without ISP throttling on your Ubuntu system.
unblocking france tv with privatevpn on france server
I unblocked France TV to watch "The Descendants" in HD with PrivateVPN

How to Set Up PrivateVPN on Ubuntu via the OpenVPN Client?

While you can already access PrivateVPN’s OpenVPN protocols on the Network Manager, the OpenVPN client is another way to connect to its servers on this protocol.

This setup method is handy for users who prefer the Ubuntu OpenVPN client or can’t get other setups to work for them.

Follow these steps:

  1. Not yet a PrivateVPN subscriber? Grab these discounts to get an account now.
  2. Install the OpenVPN client by running the command below.
				
					sudo apt-get install openvpn curl
				
			
running sudo apt get install openvpn curl code in ubuntu
  1. Enter your Ubuntu system password if promoted.
do you want to continue in ubuntu
  1. Press Y, then press the Enter key to continue the download.
  2. Download a preferred PrivateVPN OpenVPN server configuration. You can follow the links below to get the TCP or UDP option.
    1. UDP: https://intercom.help/privatevpn/en/articles/6349164-openvpn-configuration-files-udp-1194
    2. TCP: https://intercom.help/privatevpn/en/articles/6419539-openvpn-configuration-files-tcp-443
  3. Once downloaded, open the file path via your terminal by running the command below. Skip to step 13 if you know how to get the path folder.
				
					sudo openvpn_path of the configuration file
				
			
    1. In my case, the command is [sudo openvpn /home/ochristopher/Downloads/PrivateVPN-IT-Milan-TUN-1194.ovpn].
sudo openvpn command in ubuntu
  1. Optional: If you’re unsure of the path folder, locate the download. Mine is in the “Downloads” folder.
  2. Right-click the download, then select “Properties.”
selecting properties for downloads folder
  1. Copy the text in front of the “Parent folder” and paste it after [sudo openvpn] in the terminal.
copy parent folder for ubuntu
  1. Return to the downloads folder to copy the file name.
  2. Return to the terminal, put a forward slash before the pending command, then paste the file name copied from Step 10.
pasting parent file name in ubuntu
  1. Press Enter.
  2. You’ll be asked to enter your username. Put your PrivateVPN login email address here, then press Enter.
adding privatevpn login email address in ubuntu
  1. You’ll be prompted to enter your password. Write your PrivateVPN login password, then press Enter.
entering privatevpn login password in ubuntu
  1. Wait for the message “Initialization Sequence Completed.”
initialization sequence completed in ubuntu
  1. Test for leaks to ensure you have the VPN server’s IP address. My leak test returned the Italy server I connected to in this case.
privatevpn ip leak test results on italy milan server
  1. Keep your Ubuntu code transfers private, lockout snoopy network admins spying on your activities, unblock geo-restricted content anywhere, and enjoy safe torrenting on your Ubuntu.
unblocking raiplay tv with privatevpn on italy server
I unblocked RaiPlay TV in HD over PrivateVPN's Italian server configuration.

How to Set Up PrivateVPN WireGuard on Ubuntu?

PrivateVPN doesn’t offer WireGuard on its Windows, Mac, and smartphone apps. However, Ubuntu users get this relatively lightweight and ultra-fast protocol!

Here’s how to set it up:

  1. Got a PrivateVPN account already? You’re in luck with these discounts.
  2. Go to the PrivateVPN website.
  3. Click “My Account.”
selecting my account tab in privatevpn website
  1. Log in with your username and password.
privatevpn log in
  1. Click “Control Panel.”
privatevpn control panel
  1. Scroll to “Wireguard config,” then click the dropdown menu to choose a server. I’ll use the Mexico – Mexico City server for this demo.
selecting mexico city server in privatevpn
  1. Click “Generate Config” after choosing a server.
selecting generate config button in privatevpn
  1. Download the generated configuration file.
download configuration file in privatevpn
  1. Go to your Ubuntu terminal.
  2. Run the command line below to install WireGuard on your Ubuntu.
				
					sudo apt install wireguard
				
			
  1. Enter your password if prompted.
running sudo apt install wireguard code in ubuntu
  1. Press “Y” (for Yes) if prompted, then press Enter.
selecting y for do you want to continue question in ubuntu
  1. Wait for the download to complete.
  2. Then, run the command line below to invoke the downloaded configuration file (from Step 8) via the file’s path.
				
					sudo wg-quick up_wireguard file path
				
			
    1. Follow steps 7-11 from the OpenVPN client setup above to get and use the proper file path. In my case, it’s [sudo wg-quick up /home/ochristopher/Downloads/wireguard.conf].
file path in ubuntu
  1. You should now be connected.
  2. Test for leaks to be extra sure.
privatevpn ip leak test results on mexico city server
  1. Enjoy your WireGuard-enabled PrivateVPN server for fast gaming speeds, robust DDoS protection on games like CS2, and HD content unblocking.
streaming tv azteca with privatevpn on mexico server
I unblocked TV Azteca over PrivateVPN's Mexico server

How to Install PrivateVPN Browser Extensions on Ubuntu?

PrivateVPN doesn’t have browser extensions. However, there’s a workaround to use its proxy setup in Google Chrome, Edge, and Mozilla Firefox browsers.

Here’s what to do:

  1. Buy a PrivateVPN account if you don’t have one. Here are some discount offers for you.
  2. Launch your browser. I’ll use Google Chrome for this demo.
  3. Go to the PrivateVPN server list and copy a server address. I’ll use the Germany – Berlin server for this demonstration.
copying berlin server address in privatevpn
  1. Next, go to the PrivateVPN website.
  2. Click “My Account.”
selecting my account tab in privatevpn website
  1. Login with your account username and password.
privatevpn log in
  1. Click “Control panel.”
privatevpn control panel
  1. Scroll to “Proxy login.”
privatevpn proxy login
  1. Copy the username for later. The proxy password is the same as your PrivateVPN login password.
  2. Go to your browser’s extensions store. That’s the Chrome Web Store, in my case.
  3. Search for “Proxy SwitchyOmega.”
searching proxy switchyomega in chrome web store
  1. Click the extension.
  2. Click “Add to Chrome.”
add to chrome button for proxy switchyomega
  1. Click “Add extension” on the pop-up menu.
selecting add extension button in chrome for proxy switchyomega
  1. Click “Skip guide” on the next pop-up.
skip guide in proxy switchyomega
  1. Choose “proxy” under “Profiles.”
selecting proxy profile in proxy switchyomega
  1. Fill the spaces with the information below:
    1. Protocol: HTTP
    2. Server: Paste the server address you copied in Step 3.
adding details for protocol, server, and port in proxy switchyomega
  1. Click the padlock icon.
  2. Enter the PrivateVPN proxy username you copied in Step 9 under “Username.”
proxy authentication in proxy switchyomega
  1. Enter your PrivateVPN account password in the appropriate box.
  2. Click “Save changes.”
  3. The padlock icon should now turn green. Then, click “Apply changes.”
apply changes in proxy switchyomega
  1. Click the browser extension icon to reveal Proxy SwitchyOmega.
selecting proxy switchyomega extension
  1. Click the extension itself.
  2. Click “proxy” to connect to the configured proxy address.
selecting proxy in proxy switchyomega for proxy address connection
  1. Test for leaks to confirm you have the proxy server’s IP address. In my case, I’m now browsing via Berlin, the connected server.
proxy switchyomega ip leak test results in germany server

How to Disconnect From PrivateVPN on Ubuntu?

How you disconnect from an active PrivateVPN server connection on Ubuntu depends on the setup method you prefer.

I’ve shared how to end the VPN connection for all PrivateVPN-Ubuntu setup methods below.

Network Manager Setup

Access the VPN settings under the Network Manager to toggle the VPN off.

In other words:

  1. Click the Ubuntu system status tray.
au server under wired connected in ubuntu
  1. Tap the connected server. That’s the AU Server, in my case.
  2. Toggle it off.
You can test for leaks immediately to ensure you’re now browsing with your actual IP address, not the VPN’s.

OpenVPN Client Setup

The PrivateVPN-Ubuntu OpenVPN CLI setup can be disconnected by entering the Ctrl + C command in the terminal.

Here are the steps:

  1. Launch the Ubuntu terminal.
  2. Hold the Ctrl and C keys together.
  3. The connection will be disabled by closing the TUN/TAP interface and exiting the process.
server exit notice in ubuntu

WireGuard Setup

The WireGuard setup requires that you always remember the WireGuard configuration file path to connect and disconnect.

Here’s what I mean:

  1. Go to the Ubuntu terminal.
  2. Run the command line below.
				
					sudo wg-quick down [wireguard config directory]
				
			
  1. In my case, that’s [sudo wg-quick down /home/ochristopher/Downloads/wireguard.conf].
wireguard command line in ubuntu
  1. Enter your password if prompted, then press Enter on your keyboard to continue.
  2. You’re now disconnected from the PrivateVPN WireGuard protocol on Ubuntu.
privatevpn wireguard disconnect from ubuntu

HTTP Proxy

Disconnecting from the PrivateVPN HTTP setup on Ubuntu is easy. Here’s how:

  1. Click the browser extension icon.
selecting proxy switchyomega extension in chrome
  1. Click “Proxy SwitchyOmega.”
  2. Click “[System Proxy].”
selecting system proxy in proxy switchyomega
  1. You should be back to your regular connection and IP address.

How to Uninstall PrivateVPN on Ubuntu?

Since we didn’t install PrivateVPN as an app on Ubuntu, you don’t need to uninstall the VPN either. However, you can delete all PrivateVPN instances on Ubuntu by removing its configuration files and deleting the server configurations.

Here’s how:

  1. Go to your Downloads folder.
  2. Delete all PrivateVPN server configuration files you’ve downloaded.
selecting move to trash for privatevpn configuration files
  1. Click the Ubuntu systems manager icon.
ubuntu systems manager icon
  1. Click Wired Connected > Wired Settings.
  2. Click the settings cog icon in front of the PrivateVPN server configuration.
selecting cog icons under wired settings in ubuntu
  1. Click “Remove VPN.”
remove vpn button in ubuntu
  1. Repeat Steps 5 and 6 for the remaining PrivateVPN server configurations.
  2. You’ve successfully removed the VPN from your Ubuntu system.

Suppose you’ve configured the VPN on your browser via its extension.

In that case, you only need to delete the browser extension to remove the VPN.

The video guide below will help you.

Can You Use PrivateVPN Port Forwarding on Ubuntu?

You can use PrivateVPN port forwarding on Ubuntu, but only via the OpenVPN setup and with specific servers.

So, you should pick from PrivateVPN’s Ubuntu port forwarding servers (here) and follow the OpenVPN Network Manager or OpenVPN Client setup methods above to get it working.

privatevpn port forwarding server list for ubuntu

Once set up, PrivateVPN support maintains that you can forward most ports requested from Ubuntu.

PrivateVPN-Ubuntu Troubleshooting Setup Guides

Following the setup methods above will usually lead to a hitch-free PrivateVPN connection on Ubuntu. Hence, you can start unblocking content, downloading torrents securely, and enjoying online anonymity on your Ubuntu in no time.

However, I noticed a small step that could become an issue if not resolved.

So, use these troubleshooting guides if you fall into any of the categories below.

Disable IPv6

Recommended for: PrivateVPN OpenVPN Setups

IPv6 often interferes with OpenVPN client and Network Manager setups.

If enabled, this network option may lead to IP/DNS leaks for you.

Hence, remember to disable it before installing OpenVPN configurations.

Here’s how:

  1. Launch your Terminal.
  2. Run the command below to bring up the network configuration files.
				
					sudo nano /etc/sysctl.conf
				
			
running network configuration files code in ubuntu
  1. Scroll to the bottom of the page.
  2. Add the four lines below to the bottom of the page.
    1. net.ipv6.conf.all.disable_ipv6 = 1
    2. net.ipv6.conf.default.disable_ipv6 = 1
    3. net.ipv6.conf.lo.disable_ipv6 = 1
    4. net.ipv6.conf.tun0.disable_ipv6 = 1
command lines at the base of ubuntu
  1. Save and exit the file.
  2. Restart your Ubuntu system.

Enable IPv6

Recommended for: PrivateVPN WireGuard Setup

The WireGuard setup will go through but may fail to connect with IPv6 disabled.

So, if you’re having issues connecting to PrivateVPN via its Ubuntu WireGuard setup, do these:

  1. Repeat Steps 1-3 from above.
  2. Delete the four lines of code you’ve added during the OpenVPN config in step 4 above.
  3. Save and exit the file.
  4. Restart your system.

You should now be able to connect via WireGuard.

FAQs

PrivateVPN offers a kill switch on Linux distros like Ubuntu.

Still, you can’t access a toggle-able option since the VPN lacks a graphical user interface. Instead, you’ll have to modify the VPN server’s code in your Ubuntu terminal after every connection to adapt the kill switch to your current server.

However, back up your iptables and firewall rulesets before configuring the PrivateVPN kill switch, as it may mess with those files.

Secure Your Ubuntu With PrivateVPN

Ubuntu is already a secure OS, but PrivateVPN’s 256-bit encryption on all servers provides security against online snoops and network admins.

So, you can connect to public Wi-Fi networks without worrying about network admins seeing your internet activities.

On top of that, PrivateVPN gives you access to geo-restricted Netflix, YouTube TV, Prime Video, Hulu, Peacock TV, BBC iPlayer, and other content on your Ubuntu.

Why not grab this one-time PrivateVPN deal before it expires and follow one of the setup guides above to use this robust Ubuntu VPN provider?

PrivateVPN logo
PrivateVPN devices
EXCLUSIVE February DEAL!
Our partner, PrivateVPN, offers an exclusive discount for a limited time! Don't miss out on the chance to save extra money.
OFFER EXPIRES IN:
Hours
Minutes
Seconds
TODAY!
VIEW EXCLUSIVE OFFER
Or Try PrivateVPN for FREE