In this tutorial, you will learn how to set up an OpenVPN connection on your Linux device.
Don't have a subscription yet? You can find all of the available subscription options on our pricing page.
- Get your credentials
- Install the OpenVPN package
- Download configuration files
- Connect to the VPN
- Make sure your connection was successful
This tutorial uses the Ubuntu distribution. Please note that some configurations may vary depending on the Linux distribution you are using.
Get your credentials
Here is how you can get your Surfshark service credentials:
- Go to this page, where you will find all of the details required for a manual connection.
You may need to log in before proceeding to this page. In that case, enter your email address and your password, then click Log in.
Click on the Credentials tab at the top. You will find the Surfshark service credentials here.
It's a good idea to keep this page open for now. You will need these credentials a bit later.
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:
- Download the Surfshark OpenVPN configuration by entering the following command:
sudo wget https://my.surfshark.com/vpn/api/v1/server/configurations
- Extract the configurations.zip by entering this command:
sudo unzip configurations
Enter the following command to see the list of all the available servers:
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 paste the server name here
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
- Before you can be connected to the server, you should enter Surfshark service credentials.
Enter the credentials that you collected in the 'Get your credentials' part, and press enter.
- If you can see the 'Initialization Sequence Completed' line in your terminal, you have successfully connected to Surfshark!
To disconnect from the OpenVPN connection, open the terminal and press Ctrl + C.
Make sure your connection was successful
It's always recommended to check whether your connection was successful after setting up a VPN for the first time. This can be easily done by doing an IP leak test and a DNS leak test which is available on our website. Click here to find out how to make sure your connection was successful.
Congratulations - you have successfully configured OpenVPN manual connection! As long as you’re connected, your location is private, and your sensitive data is secure.
You may also be interested in: