In this tutorial, you will learn how to set up the OpenVPN app on your Linux device. This method is a proven way to easily connect to the VPN from countries with internet restrictions like China, UAE, etc.
To set up OpenVPN on Linux, you will need a device running Linux OS, OpenVPN app, and an active Surfshark subscription. You can find the available plans on Surfshark’s pricing page.
We will cover the following:
- Get your credentials
- Download and install the OpenVPN package
- Download configuration files
- Connect to the VPN
- Ensure your connection was successful
Get your credentials
NOTE: These are not your regular credentials, such as your email address and password.
- Enter the Surfshark login page and log in. Then, click on VPN > Manual Setup. This is the page where all the details required for manual connection are stored.
-
Click Desktop or Mobile > OpenVPN. Proceed to the Credentials tab. Click on the Credentials tab at the top.
NOTE: Keep this page open for now. You will need these credentials a bit later.
Download and install the OpenVPN package
- Open the terminal window. You can do that by pressing Ctrl+Alt+T keys or navigating to it in your apps menu.
-
Enter the following command to install all the necessary packages:
sudo apt-get install openvpn unzip
You may need to enter your computer password to confirm this process. In such a case, enter the password and press Enter.
Download configuration files
-
Navigate to the OpenVPN directory. You can do that by entering this command:
cd /etc/openvpn
-
Download the Surfshark OpenVPN configuration by entering the following command:
sudo wget https://surfshark.zendesk.com/hc/article_attachments/360018527519/configurations.zip
-
Extract the configurations.zip by entering this command:
sudo unzip configurations
-
Enter the following command to see the list of all the available servers:
ls
Connect to the VPN
- Choose one server from the list that you want to connect to and copy the hostname (URL) representing this server's hostname.
-
Connect to your chosen server by entering this command:
sudo openvpn
For example, if you'd like to connect to the us-slc server, this would be the command:
sudo openvpn us-slc.prod.surfshark.com_udp.ovpn
- Enter Surfshark service credentials (refer to Get your credentials section in this article). Press Enter.
- If you can see the 'Initialization Sequence Completed' line in your terminal, you have successfully connected.
- To disconnect from the OpenVPN connection, open the terminal and press Ctrl + C.
Ensure the connection is successful
We always recommend checking if Surfshark VPN is working after setting it up for the first time. You can easily do it by performing Surfshark IP leak test and a DNS leak test. For your convenience, both are available on our website.
You may also be interested in