How to Setup OpenVPN on Linux (Ubuntu)

Linux is no longer just for nerds. As a VPN user, your best chance of keeping your privacy online is through using free and open-source software, of the kind used to create user-friendly operating systems like Ubuntu Linux.

Canonical, Ubuntu’s developers, have much more transparent data collection policies, not to mention the fact that Linux isn’t affected by most forms of malware, which are designed for Windows. If you’re still thinking it over, read our online guide to discover more privacy advantages of making the switch to Ubuntu.

Use hide.me VPN servers in Linux

If you’re already an Ubuntu user, you already know that hide.me has an excellent open-source Linux client, which uses the Wireguard protocol. This by far is the best way to get set up with our VPN service quickly and easily.

Still, if you prefer the tried and tested OpenVPN protocol, you can connect to compatible hide.me servers without installing any extra software, given that Ubuntu now comes bundled with OpenVPN support.

If you favour the CLI, feel free to follow our guide to connect to hide.me using OpenVPN using the Linux Terminal.

Step By Step Tutorial

  1. Config Files

To get started, you’ll need to download at least one of hide.me’s OpenVPN config files (.ovpn). You can find these on our Servers page. Remember you’ll need to be subscribed to our ‘Premium’ plan to do this.

If you need help, follow the steps in our K-Base to choose the right configuration files. Generally, you’ll get the best performance if you choose a server located in your own country, as the latency (connection time between your device and the VPN server) is the fastest.  

When you click ‘More Details’ next to your chosen server, make sure to choose ‘Linux’ under ‘OpenVPN Configuration’.

  1. Add VPN Connection

Click the Network menu at the top right of the screen, then choose ‘Settings’. The ‘VPN’ section currently reads ‘Not Set Up. Click the ‘+’ icon to add a new connection. A selection box will appear. Choose ‘Import from File…’.

  1. OVPN Files

In the folder dialogue which now appears, navigate to the .ovpn you downloaded and extracted earlier. Select it, then click ‘Open’. 

  1. Enter Credentials

The ‘Add VPN’ window will now appear. Enter your hide.me username and password in the relevant boxes. Next, click ‘Add’ at the top right. 

  1. Add More Servers

You’ll now see your chosen VPN configuration in the ‘Network Settings’ menu. Click the rocker switch to connect via OpenVPN. You can now repeat these steps as many times as you wish to add VPN servers in different countries. 

  1. Connect To VPN Server

To connect to a VPN, simply click the rocker switch next to the name of the VPN server in question in the Network Settings window. Alternatively, click the network menu at the top right of the Ubuntu desktop, then select ‘VPN Off’. From here you can view available VPN connections. Whichever method you use, remember to only select one VPN connection at a time. 

  1. Check Your IP address

Before you do anything private, you should always double-check to make sure your VPN connection is working properly.

How do I auto-connect to VPN?

Screenshot of <sudo nm-connection-editor> in GNOME on Linux

The easiest way to do this is to open the old GNOME connection editor by launching Terminal and running:

<sudo nm-connection-editor>

From here you can select your usual AP such as your home WiFi network. Click the settings gear at the bottom left. 

Click the ‘General’ tab, then check the box next to ‘Automatically connect to VPN’. Make sure your chosen server is selected in the dropdown menu to the right. Finally, click ‘Save’ at the bottom right.

How do I disconnect from an OpenVPN connection?

If you want to disconnect from, first save and close any running web apps. Next, click the network menu at the top right of the Ubuntu desktop, then click the VPN server name e.g. adelaide.hideservers.net. You can then select the rocker switch to disconnect from the OpenVPN connection. 

How do I remove an OpenVPN connection?

screenshot of <sudo rm -vf name_of_vpn_connection> command on Linux

To remove a specific VPN configuration, click the network icon at the top right of your desktop, then choose ‘Settings’. In the Network Settings window, find the name of the VPN server you want to remove then click the gear icon next to it. Click the red ‘Remove VPN’ button at the bottom right of the new window.

If you don’t see this option, open Terminal and run the following command to list all network connections:

<ll /etc/NetworkManager/system-connections/>

To remove a network connection via the command line, run:

<sudo rm -vf name_of_vpn_connection>

E.g. 

<sudo rm -vf adelaide.hideservers.net.nmconnection>

How do I stop or restart the OpenVPN service?

screenshot of <sudo killall openvpn> command on linux

If you need to stop the OpenVPN service altogether for any reason, just open Terminal and run:

<sudo killall openvpn>

How do I update OpenVPN?

screenshot of <sudo apt-get update> command on linux

As the OpenVPN Network Manager is preinstalled in Ubuntu, you can update it alongside your system. The easiest way to check you’re running the latest version is just to open Terminal and run:

<sudo apt-get update>

You can also run the Ubuntu ‘Software Updater’ via the ‘Activities’ tab. 

How do I remove OpenVPN altogether?

screenshot of <sudo apt purge openvpn> command on linux

Ubuntu Linux now comes with built-in support for OpenVPN. Having it installed on your computer won’t make it any less safe but if you’re sure you won’t need it, simply open Terminal and run this command to run OpenVPN and all its dependencies:

<sudo apt purge openvpn>

Needless to say, this can cause connectivity issues, so make sure to make a full system backup before running this command.


We love bringing you this content and hope it helps keep you safe and secure online. Feel free to share it with your friends, too.

Here at hide.me we are all about internet freedom, and we are happy to be in a position to bring that to everyone. That is why we give you a 30-day money-back guarantee on our Premium plan. No questions asked and no logs recorded.

Get hide.me VPN!

If you have any questions, please feel to contact our 24/7 support team either at support@hide.me or via live chat.

Related articles

Christmas Sale

Includes 3 months extra

Days

Hrs

Min

Sec

Get the offer