In this guide I will be showing you how to connect to your OpenVPN server using a Linux desktop. The following guide should work regardless of whether you are running Debian, Ubuntu, Fedora or any other Linux distribution. You will need root or sudo access in order to connect to your VPN.
Install OpenVPN Client
You will need to install the OpenVPN package in order to use the OpenVPN client. You can use one of the following command to install OpenVPN. This command should work regardless of which distribution you are using unless you are using a distribution that doesn’t support apt-get or yum.
sudo apt-get install openvpn -y || sudo yum install openvpn -y
Connect To OpenVPN On Linux Desktop
Now we will start the VPN connection, to do this we will run the OpenVPN command while pointing to our client configuration file (usually ends with .ovpn). Note that we will also use nohup and send the process to the background, that way the VPN will stay connected even if we close the terminal or end our session. You can do all of this with the following command. You will need to change the path to your actual client configuration file location.
sudo nohup openvpn --config /path/to/client-config.ovpn &
Congratulations, that is all there is to it. You should now be connected to your VPN, you can check your external IP to be sure by running the following command.
curl -s https://teachmelinux.com/ipchecker.php
I hope this guide has helped you connect to OpenVPN on Linux, please don’t forget to like, comment, or share using the social media buttons below. Thank you!