System Administration

How to Make Your Own VPN using OpenVPN


OpenVPN is open-source commercial software that implements virtual private network techniques to create secure point-to-point or site-to-site connections in routed or bridged configurations and remote access facilities.

A VPN, or Virtual Private Network, allows you to create a secure connection to another network over the Internet. VPNs can be used to access region-restricted websites, shield your browsing activity from prying eyes on public Wi-Fi.

A virtual private server is a virtual machine sold as a service by an Internet hosting service. The virtual dedicated server also has a similar meaning.

We will use a bash script to do all the installation and configuration for us.

Step 1: Login to your VPS

Type the following ssh command replacing with your VPS username and IP:
ssh [email protected]

Step 2: Download and Run the Script

Type the following wget command or curl command:
wget -O && sudo bash

Step 3: Configure

When prompted set IP address to and Port to 443. Use Google or OpenDNS DNS servers with the vpn. Next, type client name (such as iPhone, Nexus6, client etc). Finally, press [Enter] key to install and set up OpenVPN on your system

Type the following command stop the OpenVPN service:
sudo systemctl stop openvpn@server

Type the following command start the OpenVPN service:
sudo systemctl start openvpn@server

Type the following command restart the OpenVPN service:
sudo systemctl restart openvpn@server

Step 4: Client configuration

On server your will find a client configuration file called ~/client.ovpn. All you have to do is copy this file to your local desktop using the scp and provide this file to your OpenVPN client to connect:
scp [email protected]:~/client.ovpn .

First, install the openvpn client, enter:
sudo yum install openvpn

sudo apt install openvpn

Step 5: Connecting

sudo openvpn client.ovpn


About the author

Mazen Elzanaty

Add Comment

Click here to post a comment

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: