As a Linux user, you probably care a lot about privacy and security. Hence, you should be interested in harnessing the power of a virtual private network (VPN). But how do you set up a VPN on Linux?
There are several ways to do it:
Solution #1. Install a Linux-compatible VPN app.
Solution #2. Set up a VPN manually using OpenVPN.
Bonus solution: Use Ubuntu Network Manager.
We’ll be using Surfshark for demonstration purposes.
Solution #1. Set up a VPN on Linux with the Surfshark app
Solution #2. Set up a VPN on Linux manually
Granted, not all devices support VPN apps. Therefore, you may need to carry out the setup manually by getting the VPN configuration files from your VPN provider and using them with OpenVPN. Here’s how:
- Open the terminal window by pressing Ctrl + Alt + T.
- Install the required OpenVPN materials by using the command “sudo apt-get install openvpn unzip”.
If you are requested to enter your password, please enter your computer’s admin password.
- Go to the OpenVPN directory by entering the command “cd /etc/openvpn”.
- Log into Surfshark.
- Get the Surfshark OpenVPN configuration files by entering the command “sudo wget https://my.surfshark.com/vpn/api/v1/server/configurations”
- Extract the `configurations.zip` with the command “sudo unzip configurations”.
- Remove the .zip file which will no longer be needed.
- Open the list of available servers by entering “ls” in the command line.
- To connect to a chosen Surfshark server, enter the command “sudo openvpn [file name]”.
For example, here’s how you connect to a Dallas server:
sudo openvpn us-dal.prod.surfshark.com_udp.ovpn
sudo openvpn /etc/openvpn/us-dal.prod.surfshark.com_udp.ovpn
- To find your Surfshark service credentials (they’re not the same as your account login information) for OpenVPN, log into your account on surfshark.com and go to the Manual setup page.
- If you see “Initialization Sequence Completed” in the terminal logs, you have successfully connected to Surfshark.
- If you want to disconnect from OpenVPN, open the terminal and press Ctrl+C.
If you have any questions about the process, you can always turn to our customer support service that works 24/7 via email or live chat.
Bonus: set up a VPN using Ubuntu Network Manager
Are you an Ubuntu user? Then you can set up Surfshark by using your handy Network Manager app. Here’s how it’s done:
- If the Network Manager is not installed on your device, open the Terminal (Ctrl+Alt+T) and enter the command “sudo apt-get install network-manager-openvpn-gnome”.
You will be asked to enter your computer’s password – do so.
- Once you have the Network Manager, sign up for Surfshark.
- Log in to the Surfshark website and go to the Manual setup page..
- Download the UDP files for the server you wish to connect to and save them on your desktop for convenience. Don’t close the window yet – we’ll need it later.
- Click the white arrow or the Wi-Fi/Ethernet icon – it should be at the top-right corner of your desktop.
- Click the “Settings” button.
- Open the “Network” tab.
- Click the “+” sign to add a new VPN network.
- In the new window, click “import from file”.
- Navigate to the file you downloaded during step #4 and import it.
- Once you’re asked for authentication, enter the Surfshark service credentials that you can find at the bottom of the page you opened during step #3.
- A new VPN profile is added. Turn it on by flipping the switch to “ON.”
- To see if the VPN is connected, open the system tray the way you did in step #5.
And that’s all there is to it! Again, if you have questions, our 24/7 support team is always ready to help.
Secure your Linux experience with a VPN now
Linux is the system of choice for people who value privacy and security. However, the privacy and security benefits of Linux don’t extend to the internet, and that’s why you need additional help. Set up a Linux VPN on your distribution of choice and experience the freedom of the internet that you deserve.