vpnAlert.com
Search
Close this search box.

How to Set Up Surfshark on Ubuntu? (5 Unique Methods)

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

The best way to set up and use Surfshark on Ubuntu is via the new GUI app. 

This is preferable for Ubuntu newbies who don’t want to open their terminal whenever they need Surfshark or advanced users who prefer simplicity.

You can also set up Surfshark’s OpenVPN client in your Ubuntu terminal, but you’ll lose access to WireGuard, features like the kill switch, and a graphical interface.

If you don’t mind those, you can also explore the Network Manager and basic OpenVPN setups.

I’ll show you how to do these setups below.

How to Install the Surfshark Ubuntu GUI App?

The Surfshark Ubuntu GUI app gives you faster access to all servers, allows you to tweak settings (like the kill switch) effortlessly, and makes disconnecting from the VPN a breeze.

On top of that, you get the WireGuard protocol, which other setups lack.

Here’s how to get it working:

  1. Buy a Surfshark subscription. Grab these discounts for savings and a 30-day money-back guarantee.
Screenshot MS 1 1
Image for illustration only. Design, deals, and details may differ. Click on the image for current info.
  1. Launch the Ubuntu terminal. You can find this via your app tray or by holding CTRL + ALT + T on your keyboard.
ubuntu terminal search
  1. Run the command below to install Surfshark.
				
					curl -f https://downloads.surfshark.com/linux/debian-install.sh --output surfshark-install.sh #gets the installation script
cat surfshark-install.sh #shows script's content
sh surfshark-install.sh #installs surfshark
				
			
download surfshark via ubuntu terminal
  1. You may be asked to enter your password. Do so, and press the Enter key.
    1. Note: The password input field may remain blank as you enter it. Don’t worry; the terminal recognizes the password input in the background.
  2. Wait to see the Surfshark successful installation message.
surfshark installed successfully via ubuntu terminal
  1. Go to your Ubuntu app tray.
ubuntu app tray
  1. You’ll see a Surfshark icon. Click it.
  2. Log in with your username and password. You can also log in with other provided methods if you’ve set those up.
surfshark gui log in
  1. Click the settings icon, then click “VPN settings.”
surfshark vpn settings
  1. Toggle “CleanWeb” ON to keep ads, trackers, and pop-ups away when browsing manga sites, torrent websites, and other ad-ridden platforms on your Ubuntu.
    1. You may need to disable CleanWeb on some websites if it’s messing with how the site loads.
surfshark cleanweb feature
  1. On the same page, toggle the “Kill Switch” to ensure your network admins, online peers, network managers, or other third parties don’t see your original IP address and internet activity on random server disconnections.
  2. You’ll be prompted to enter your password to enable the kill switch. Do so, then click “Authenticate.”
ubuntu bin bash authentication
  1. Click “Protocol,” then select the best for your internet needs. I recommend WireGuard for streaming/web surfing but use OpenVPN for advanced network protection and to bypass firewalls.
    1. PS If you’re on a restrictive network like mine, you might be unable to switch protocols. Instead, Surfshark chooses the best protocol for you.
surfshark vpn protocols
  1. Click “VPN” to return to Surfshark Ubuntu GUI’s home page.
surfshark ubuntu gui
  1. Click “Quickconnect” to connect to the fastest or nearest available server. This is your best option if you simply want DDoS protection, IP masking, data encryption, or other Surfshark privacy features.
  2. Alternatively, search for a choice location to connect to.
    1. You may have fewer locations to connect to depending on your chosen protocol type. WireGuard works with most server locations.
  3. Wait for the connection confirmation. I’ve connected to the Canada server in this example.
surfshark connected to canada server
  1. Test for leaks. Ensure the leak test returns the exact location and IP address as Surfshark.
    1. Otherwise, disconnect and reconnect.
surfshark ipleak test on canada server
  1. Enjoy fast content unblocking, play online Ubuntu games without DDoS attacks, bypass restrictive workplace or school network limits, and use the internet anonymously from anywhere.
One of my Surfshark GUI tests on Ubuntu included unblocking CraveTV (Canada-only) to watch some episodes of Curb Your Enthusiasm in 1080p HD without buffering.
streaming crave tv with surfshark canada server on ubuntu

How to Use Surfshark on Ubuntu via the Terminal?

Do you prefer the hands-on approach that the terminal provides? 

Do you have an Ubuntu version earlier than 20.04? Or is the GUI not behaving as you want?

No matter your reason for preferring the Surfshark terminal setup, I’ll show you the easiest way to get it done:

  1. You’ll need a Surfshark subscription. Here’s a one-time discount to get one.
  2. Launch your Ubuntu terminal.
  3. Run the command below to download Surfshark.
download surfshark via ubuntu terminal
				
					sudo wget https://ocean.surfshark.com/debian/pool/main/s/surfshark-release_1.0.0-2.1_amd64.deb
				
			
  1. You may be required to enter your Ubuntu password. Please do, then press the Enter key.
enter sudo password for ubuntu
  1. Run the command below to install the downloaded Surfshark file. The Ubuntu terminal will show you the downloaded file name, as indicated in the screenshot below.
install downloaded surfshark file
				
					sudo dpkg -i [insert the downloaded file name]
				
			
  1. Update the Surfshark app you downloaded by running the code below in your terminal.
				
					sudo apt-get update
				
			
  1. Run the code below to install the updated Surfshark package.
				
					sudo apt-get install surfshark-vpn
				
			
  1. Now, the VPN is successfully installed. Run the code below to start the installed Surfshark VPN.
				
					sudo surfshark vpn
				
			
start surfshark via ubuntu terminal
  1. If prompted, run “NO” (without the quotes) in the terminal to disable error reporting.
  2. Enter the email address associated with your Surfshark account, then press Enter. This is the email address you signed up with in Step 1 above.
enter surfshark account email
  1. Enter your Surfshark account password, then press Enter.
  2. Enter a 2FA code if you’ve set it up. Otherwise, skip this step.
enter surfshark 2fa code
  1. You’ll be presented with a list of servers. Keep pressing the Enter key till you have them all. I had to press the Enter key six times.
surfshark servers displayed on ubuntu terminal
  1. Input a number and press Enter to connect to the corresponding server. I chose 44 to connect to Ghana.
    1. Don’t memorize server numbers since they change on every connection. Manually look up the number associated with your choice server whenever you want to connect.
  2. Choose a protocol. Surfshark only supports OpenVPN protocol types on this setup, so you don’t get WireGuard.
    1. UDP is the faster option, but it’s less stable than TCP on some tough networks.
choose surfshark vpn connection type
  1. Wait for the connection confirmation.
  2. Once connected, test for leaks. Ensure your leak test returns the same location you’re connected to and an IP address there. Otherwise, disconnect and reconnect to the VPN.
surfshark ipleak test on france server

I used this Surfshark connection method to unblock France TV channels and content, which was previously unavailable to me before connecting to the Paris – France server.

streaming france tv with surfshark on ubuntu

Surfshark Terminal Commands to Know for Ubuntu

One of the drawbacks of using the terminal over the GUI for Ubuntu is that you need to remember the correct commands for specific tasks. The setup method already shows how to start the VPN, but there are a host of other commands to know.

Here are the ones you’ll commonly need.

Function Command
Check connectivity sudo surfshark-vpn status
Disconnect from the VPN server sudo surfshark-vpn down
Quick connect sudo surfshark-vpn attack
Log out sudo surfshark-vpn forget

The best part is that you don’t have to memorize all the commands, save the few you use frequently. When you need to explore other commands or forget one of your favorite commands, run the code below to bring up all the Surfshark Ubuntu terminal commands.

				
					sudo surfshark-vpn help
				
			

How to Setup Surfshark on Ubuntu via Network Manager?

I recommend the Network Manager setup for users who don’t want to use the GUI but also want a more visual interface than the terminal provides.

But while the Surfshark Ubuntu Network Manager setup balances the GUI and terminal, you’ll still have to manually add each server you want to connect to.

If that’s not a dealbreaker, here’s the easiest way to set it up:

  1. Got your Surfshark account yet? Grab these Surfshark deals for savings.
  2. Log in to your online Surfshark account.
surfshark online log in
  1. Click “VPN” to toggle it down.
surfshark vpn tab
  1. Click “Manual setup.”
  2. Select “Desktop or mobile.”
surfshark manual setup methods
  1. Choose “OpenVPN.” IKEv2 and WireGuard manual setups won’t work on Ubuntu.
  2. You’ll see a string of characters for your username and password. Copy these and keep them secure.
surfshark openvpn credentials
  1. Now, click the “Locations” tab.
surfshark locations tab
  1. Scroll to download a preferred location. I’ll download the Norway server for this demo.
surfshark norway oslo server
  1. Choose between TCP and UDP. TCP is slower than UDP but more stable on restrictive networks.
download surfshark server configuration files
  1. Launch your Ubuntu terminal.
  2. Run the command below to install the network manager.
    1. This step is optional if you already have the Network Manager. However, you can still run it to be extra sure.
				
					sudo apt-get install network-manager-openvpn-gnome
				
			
  1. Enter your password if prompted, then press Enter.
  2. Go to your Ubuntu system’s home page.
ubuntu setting menu
  1. Click the Network Manager icon. It looks like a three-pronged fork, usually in the screen’s upper right corner.
  2. Click “Settings.”
  3. Select “Network.”
ubuntu network settings
  1. Click the “+” sign next to “VPN.”
  2. Select “Import from file.”
import vpn configuration file to ubuntu
  1. Choose the Surfshark server configuration file you downloaded in Step 10 above. Then, click “Open.”
ubuntu downloads folder
  1. Enter the service credentials you copied in Step 7 above under the username and password fields.
    1. DO NOT use your Surfshark account login details here. It won’t work.
ubuntu vpn file authentication
  1. Change the server’s name to something you’ll quickly recognize. I used “Surfshark Norway Server” for this example.
change vpn server name on ubuntu
  1. Click “Add.”
  2. Toggle the server from your VPN server list.
ubuntu vpn server list
  1. Wait for the “VPN” icon to show in the network manager.
  2. Test for leaks. Ensure the leak test site returns details of the server you’re connected to, not your actual IP address.
surfshark ipleak test on norway server
  1. Start unblocking geo-restricted content, browsing the web privately, playing games securely, and accessing region-locked DLCs from anywhere on your Ubuntu.

I unblocked NRK TV live content via Surfshark’s OpenVPN connection on Ubuntu.

Even though OpenVPN connections are believed to be slow, handling live content is proof that this one is optimized for speed!

streaming nrk tv with surfshark norway server

How to Setup Surfshark OpenVPN Connection on Ubuntu?

The Surfshark OpenVPN connection setup combines some of the Network Manager and terminal setups described above. So, if you fancy both but lean towards using the terminal, here’s one for you:

  1. Buy your Surfshark subscription to start. Get these discounts for newbies for some savings.
  2. Follow steps 2-7 from the Network Manager setup above to get your account credentials.
  3. Launch your Ubuntu terminal.
  4. Run the command below to get the OpenVPN network manager packages.
				
					sudo apt-get install openvpn unzip
				
			
  1. Enter your PC password if prompted, and press Enter.
  2. Run the command below to ensure further commands you run are executed in the package you installed in Step 4.
				
					cd /etc/openvpn
				
			
  1. Now, run the command below to get Surfshark’s OpenVPN configuration files.
				
					sudo wget https://my.surfshark.com/vpn/api/v1/server/configurations
				
			
  1. Run a command to unzip the Surfshark files you downloaded in Step 7. Ubuntu will let you know the name of the downloaded file.
    1. My file is named “configurations.” If yours is named something else, please use that name in the code you’re running.
				
					sudo unzip configurations
				
			
  1. Afterward, run the simple command [ls] to see Surfshark’s available OpenVPN servers.
surfshark openvpn servers
  1. Browse the servers and copy the hostname of the one you want to connect to. I’ve chosen the US – New York server configuration for this guide.
surfshark new york openvpn server
  1. Enter the command [sudo openvpn (server hostname you copied)] to connect to your chosen server. For example, I ran the code below to connect to the server I copied above.
				
					sudo openvpn us-nyc.prod.surfshark.com.udp.ovpn
				
			
  1. Enter your Surfshark manual setup username when prompted.
enter surfshark manual setup username
  1. Enter the Surfshark manual setup password when prompted.
  2. Wait till you see the message “Initialization Sequence Completed.” That indicates a successful connection.
ubuntu initialization sequence completed
  1. As always, test for leaks. That helps determine if you’re browsing via the server-assigned IP address.
surfshark ipleak test on new york server

I unblocked multiple CNN shows from abroad using the Surfshark US server on Ubuntu.

streaming cnn with surfshark new york server on ubuntu

How to Install Surfshark Browser Extensions on Ubuntu?

You can install the Surfshark extension on your Google Chrome, Mozilla Firefox, or Microsoft Edge browsers. You should get the browser extension to enjoy CleanWeb 2.0, a more advanced ad-blocker that isn’t in the Surfshark app yet.

I’ll show you the steps for Google Chrome, but it’s like what you’ll do on Microsoft Edge and Firefox.

  1. You’ll need a Surfshark account to use the extension. Use these discounts to get one.
  2. Open your Ubuntu’s Firefox, Edge, or Chrome browser. I’ll use Chrome for this demo.
  3. Go to the Surfshark download page. Then, click your browser type.
surfshark available browser extensions
  1. Click “Download extension.”
download surfshark extension
  1. Click “Add to Chrome.”
add surfshark vpn extension to chrome
  1. Click “Add extension” on the next pop-up.
confirm surfshark extension download
  1. Click the extension icon, then click the pin next to Surfshark. This ensures you can access the VPN extension easily.
google chrome extensions
  1. Click the Surfshark extension itself.
  2. Log into your account via the web.
  3. Click Settings > CleanWeb Settings.
surfshark cleanweb settings
  1. Toggle “Ad blocker” and “Cookie pop-up blocker” ON.
    1. You should toggle these off on some sites that won’t work well with JavaScript blocking. In such cases, toggle them off one after the other to see which you can keep.
surfshark cleanweb options
  1. Click “Confirm” to consent to Surfshark blocking cookies on your behalf.
confirm surfshark cleanweb settings
  1. Optional: Return to Settings, then click “Bypass list.”
    1. This is for those who want to keep some sites from passing through the VPN or CleanWeb. For instance, keep fintech platforms like PayPal from VPN interference.
surfshark bypass list
  1. Click “Add new.”
add website to surfshark bypass list
  1. Add the website URL you want to bypass the VPN or CleanWeb.
surfshark bypass list options
  1. Select whether you want the website to bypass VPN and CleanWeb or one of them.
  2. Then, click “Add & reload.”
  3. Return to the VPN homepage to search for a server, or click “Quick connect” to get the Surfshark-determined optimal server location.
surfshark server search
  1. You can test for IP leaks to confirm that you’re using the Surfshark-assigned IP address.
surfshark ipleak test

I tested the Surfshark Chrome extension to unblock YouTube, and it blocked even the video ads!

surfshark ad blocker test

How to Disconnect From Surfshark Servers on Ubuntu?

How you’ll disconnect from Surfshark’s Ubuntu servers depends on your setup. 

I’ve tried them all and presented the easiest ways to disconnect from the VPN below.

GUI Setup

This is the easiest since you only need to click the Disconnect button to stop the server connection.

surfshark connected to canada server

You’ll find this on the VPN’s homepage and in the connection corner.

OpenVPN Terminal Setup

If you’ve used this setup method, you need to disconnect from the Surfshark server via the Ubuntu terminal.

Run the code below, and you’ll get a Surfshark disconnection successful message.

				
					sudo surfshark-vpn down
				
			
disconnect surfshark server via terminal

Network Manager Setup

Disconnecting from Surfshark when set up via the Ubuntu Network Manager is straightforward since it has a graphical interface.

Here’s how:

  1. Click the Network Manager tray.
ubuntu network manager tray
  1. Click the current Surfshark connection. In my case, that’s “Surfshark Norway Server.”
  2. Toggle off the server connection.
surfshark norway server on ubuntu
  1. Click the Network Manager tray again.
  2. A “VPN Off” message shows that Surfshark has been disconnected.
ubuntu vpn off setting

You can still test for leaks and see if you’re browsing via the Surfshark server or if your connection has reverted to normal.

Manual OpenVPN Setup

Disconnecting from the Surfshark Ubuntu manual OpenVPN setup is as simple as holding Ctrl + C while the terminal is open.

exiting process on ubuntu terminal

You’ll get a “process exiting” notification to show you that the server connection has ended. However, doing a manual leak test doesn’t hurt to confirm that you’ve truly disconnected from the server.

How to Uninstall Surfshark on Ubuntu?

Not all Surfshark Ubuntu setups require uninstalling the VPN software. 

In some instances, you only purge the files and dependencies.

Let me show you what that means.

Surfshark GUI Setup

The Ubuntu Surfshark GUI setup is one where you’ll need to uninstall the app.

Here’s how to do that:

  1. Run the command below to remove the main Surfshark GUI and associated dependencies.
				
					sudo apt purge surfshark
				
			
  1. Enter your PC password to continue if prompted.
  2. Enter “Y,” then press the Enter key when prompted.
confirm surfshark uninstall
  1. Next, run the code below to purge any other client dependencies the Surfshark GUI might have installed.
    1. If you want to switch to the network manager or OpenVPN setups, re-install their client dependencies.
				
					sudo apt purge surfshark-vpn
				
			
  1. Repeat Step 3 when prompted.
  2. Finally, run the code below to remove all Surfshark repository packages.
				
					sudo apt purge surfshark-release
				
			
  1. When prompted, repeat Step 3.
  2. You’ve successfully uninstalled Surfshark GUI from your Ubuntu Linux system.
surfshark uninstalled successfully via ubuntu terminal

OpenVPN Terminal Setup

The only thing to do here is disconnect from the VPN and then run the removal code in your Ubuntu terminal.

In other words

  1. Launch the Ubuntu terminal.
  2. Run the code below to disconnect from Surfshark. This step is essential so you don’t mess up your Ubuntu network settings.
				
					sudo surfshark-vpn down
				
			
  1. Run the code below to remove Surfshark.
				
					sudo apt-get remove surfshark-vpn
				
			

Network Manager Setup

Uninstalling Surfshark-Ubuntu setups via the Network Manager is as easy as deleting the VPN server and other associated files. Let me show you how:

  1. Click the Network Manager icon.
  2. Click Wired Connected > Wired Settings.
ubuntu wired settings
  1. Click the settings cog next to the Surfshark server you’ve set up.
ubuntu vpn server settings cog
  1. Click “Remove VPN.”
remove vpn server from ubuntu
  1. Surfshark is now removed from the list.
  2. Next, locate the download folder where you stored the Surfshark OpenVPN server files.
  3. Right-click the server, then click “Move to Trash” to delete it.
move server file to trash
  1. Repeat the steps for other Surfshark VPN servers you’ve installed on your Ubuntu this way.

How to Update the Surfshark GUI App on Ubuntu?

Trying to update or upgrade a new Surfshark GUI version may not work, depending on what version you’re coming from.

Still, the first approach to take toward updating or upgrading the app is below:

  1. Enter your Ubuntu terminal.
  2. Run the code below to update the app.
				
					sudo apt update
				
			
  1. Then, run the code below to upgrade the app.
				
					sudo apt upgrade
				
			

If you’ve tried that but it simply won’t work, do these:

  1. Uninstall the Surfshark GUI completely. Follow the uninstallation guide above to do so.
  2. Reinstall the Surfshark GUI. You can follow the GUI installation guide above to do so.
  3. The new version will be the latest version of the app.

Troubleshoot Surfshark-Ubuntu Set up Issues (5 Tips)

You shouldn’t have trouble using Surfshark seamlessly on Ubuntu once you’ve followed the setups. But in the case of app glitches, setup misconfigurations, or other internal Surfshark issues, these tips should help.

Disable the Kill Switch Temporarily

Applicable to: GUI Interface

You may have to temporarily disable the Surfshark GUI kill switch to connect to a location you’ve never used.

In most cases, the app will inform you to do this. But if it doesn’t, and you have the kill switch active while a server connection is blocked, it’s best to do so.

Here’s how:

  1. Launch the Surfshark Ubuntu GUI app.
  2. Go through Settings > VPN settings.
surfshark vpn settings
  1. Toggle the “Kill Switch” OFF.
surfshark kill switch enabled
  1. Return to the VPN homepage to connect to the server location.
  2. Return to settings and enable the kill switch for added protection.

Manually Entering Your Password

Applicable to: Manual setups

Copying and pasting your Surfshark password in the terminal during manual OpenVPN setups may throw an error message. You’ll be asked to contact support, but I recommend entering your password manually first.

The terminal uses plain text formatting. Hence, pasting passwords from other sources may come with extra formatting that invalidates the password.

Use Service Credentials

Applicable to: Network Manager setup and OpenVPN setup

The Surfshark Ubuntu Network Manager setup requires entering your service credentials when your username and password are requested. 

Using your Surfshark account username and password (the one to log into the app or web account) won’t work.

Check the Network Manager setup guide above to learn where to find these manual setup credentials.

Disable Other Proxy Extensions

Applicable to: Surfshark extension

If you’re getting page-load errors while Surfshark is active, and your internet connection isn’t at fault, check if you have other proxy extensions or VPN extensions installed.

Even if these aren’t running, they may keep your Surfshark connection from working correctly.

In my case, I had NordVPN and ProxySwitchyOmega installed, and they were both messing with my Surfshark extension connection.

Here’s how you can address the issue:

  1. Open your browser. I’ll use the Google Chrome browser for this example.
  2. Go to your extensions’ library. You can click the Google Chrome extensions tab for this.
  3. Click “Manage extensions.”
  4. Click “Remove” on the interfering extensions. You can also disable the extension(s).
remove google chrome extension
  1. Confirm the extension removal.
  2. Return to the Chrome main page and browse the internet securely.

Switch Protocols

Applicable to: GUI

Some Surfshark protocols may not work on certain network types. 

To be more specific, protocols like WireGuard don’t play nice with restrictive networks and firewalls.

Suppose you’re using the Surfshark Ubuntu GUI and can’t access the internet after connecting to a server. In that case, it’s time to switch protocols.

Here’s how:

  1. Stop all sensitive tasks running in the background. This might be scripts you’re executing, torrent downloads, or anything else.
  2. Launch the Surfshark GUI.
  3. Disconnect from the server.
  4. Click Settings > VPN settings.
  5. Scroll to click “Protocol.”
surfshark protocol
  1. Switch to another protocol. Most times, the OpenVPN protocols are your best bet.
    1. If UDP (preferred for speed) is the culprit, switch to OpenVPN TCP.
  2. Return to the VPN home page.
  3. Reconnect to a VPN server.

Does Surfshark CleanWeb Work on Ubuntu?

Surfshark’s CleanWeb and CleanWeb 2.0 work seamlessly on Ubuntu, helping you to keep ads, pop-ups, and online trackers away when using the internet. 

I tested the CleanWeb 2.0 on YouTube, and it unblocked MKBHD’s videos in HD without ads!

surfshark ad blocker test

You can only use Surfshark CleanWeb on Ubuntu when you’ve installed the VPN via its GUI app or the browser extension.

That said, some websites may not work with CleanWeb because they need to load JavaScript commands, which the ad blocker kicks against. 

In this case, you can add such websites to the CleanWeb bypass list, as taught in steps 13-17 of the Surfshark extensions guide.

Unfortunately, this setup isn’t available in the Surfshark GUI app.

Furthermore, Surfshark’s extension lets you report websites you can’t access while connected to it. That way, the VPN’s engineers can continue tweaking CleanWeb to work with all websites.

Interesting Reads:

Enjoy Surfshark on Your Ubuntu

You can now install and enjoy Surfshark for content unblocking, online privacy, anti-DDoS protection while gaming, or to hide your IP address on your Ubuntu PC.

If you’re using the web extension, you’ll get the extra benefit of an ad and pop-up blocker without paying for those tools.

You can explore the different Surfshark setups for Ubuntu above to find which works best for you.

No matter which you decide, these Surfshark deals are applicable and come with a 30-day money-back guarantee!

Surfshark logo
EXCLUSIVE DEAL:
Don't miss out on this amazing deal! Get Surfshark with a whopping discount, NOW!
OFFER EXPIRES IN:
Hours
Minutes
Seconds
TODAY!
CLAIM OFFER NOW
** For Limited Time Only **
💥 Exclusive June Discounts 💥
SHOW OFFER
Surfshark logo
SHOW OFFER
PrivateVPN logo
SHOW OFFER
Surfshark logo
EXCLUSIVE June DEAL!
Our partner, Surfshark, 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 Surfshark for FREE