Home

Published

- 2 min read

OpenVPN Setup Guide

img of OpenVPN Setup Guide

OpenVPN Setup Guide

Setting up a VPN can be complex, but with this script, you can have OpenVPN running in just a few minutes! Follow these simple steps to secure your network.

Step 1: Download the OpenVPN Installation Script

Run the following command to download the OpenVPN installation script:

   wget https://git.io/vpn -O openvpn-install.sh

Step 2: Make the Script Executable

Before running the script, you need to grant it execution permissions. Run this command:

   sudo chmod +x openvpn-install.sh

Step 3: Run the OpenVPN Installation Script

Now, execute the script to begin the installation:

   sudo bash openvpn-install.sh

Now it will ask :-

  • Which protocol should OpenVPN use?

Hit Enter

  • What port should OpenVPN listen on?

Hit Enter unless port [1194] is not being used [Make sure firewall is disable].

  • Select a DNS server for the clients:

Press 3 and hit Enter [Or use any other from options available].

  • Enter a name for the first client:

Enter any name of your choice and hit Enter [For eg client1].

Press Enter Again.

Step 4: Retrieve Your VPN Configuration File

Once the installation is complete, your first VPN client configuration file will be saved as client1.ovpn or anyother you declared earlier. To move it to your home directory, run:

   sudo cp /root/client1.ovpn ~

Step 5: Setup

  • Download the file present in root directory.
  • Download OpenVPN Connect.
  • Go to upload file
  • Import the downloaded client1.ovpn file.

Done now you can simply connect with your VPN

Step 6: Create additional clients

  • Redo Step 3
  • Select option 1 and hit Enter.
  • Provide a name for eg client2
  • Now run :-
   sudo cp /root/client2.ovpn ~
  • Download the client2.ovpn file and upload again following Step 5.

And that’s it! 🎉 Your OpenVPN server is now up and running.