How to set up OpenVPN on your Webdock Server
Last updated: November 10th 2022
Introduction
There are many reasons you may want to deploy your own private VPN. One big reason is that many VPN companies sell your VPN logs to law enforcement agencies, so having your own personal VPN will ensure your privacy. You may also have some public admin portals to which you need to restrict access for only the users who have your VPN access.
OpenVPN is a free, open source VPN protocol that you can use to deploy your own private VPN. It’s available for every Operating system including Windows, Mac, Linux and other Unix like platforms.
Prerequisites
- A fresh Webdock cloud Ubuntu instance.
- Make a note of your Webdock server IPv4 address
- You have shell (SSH) access to your VPS.
Know your public IP
To setup OpenVPN, you should know the public IP address of your Webdock server.
# curl icanhazip.com
You’ll get your IP Address in response.
Setup OpenVPN
Update your Ubuntu and clone the git repository of OpenVPN deployment script.
# sudo apt update && sudo apt upgrade # mkdir vpn && cd vpn # wget https://git.io/vpn -O install.sh
Change its permission and run it as sudo. The script will give you a few prompts, choose the options as per your requirement.
# chmod +x install.sh # sudo ./install.sh Welcome to this OpenVPN road warrior installer! This server is behind NAT. What is the public IPv4 address or hostname? Public IPv4 address / hostname [XX.XXX.20.90]: XX.XXX.20.90 Which protocol should OpenVPN use? 1) UDP (recommended) 2) TCP Protocol [1]: 1 What port should OpenVPN listen to? Port [1194]: 1194 Select a DNS server for the clients: 1) Current system resolvers 2) Google 3) 1.1.1.1 4) OpenDNS 5) Quad9 6) AdGuard DNS server [1]: 2 Enter a name for the first client: Name [client]: webdock OpenVPN installation is ready to begin. Press any key to continue...
Download the OVPN File to your Local Machine
After the installation, a file with “.ovpn” extension will be created in the home directory of the user that did the installation. In our case this is root, as we ran the script with sudo.
# sudo ls /root/
Sample output:
... /root/webdock.ovpn
You can now switch to root by doing "sudo su" and cd to this directory (/root) in order to serve the file with python, or you can copy it to your home directory first (here the user is called "myuser"):
# sudo cp /root/webdock.ovpn /home/myuser/ # sudo chown myuser:sudo /home/myuser/webdock.ovpn
Change myuser:sudo to whatever your user/group is and webdock.ovpn to whatever your ovpn file was named.
You can download the file using Scp, Netcat or Python, but Python way is the easiest.
# cd && python3 -m http.server
Sample output:
Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ...
Go to your web browser and enter your Webdock server’s Public IP Address with the port number 8000 i.e, http://XX.XX.20.90:8000/, and download the file.
Use your VPN
OpenVPN client software is available for Android, iOS, Windows, Linux etc.
For Linux, you can simply install it using apt.
sudo apt install openvpn
Start the VPN
sudo openvpn webdock.ovpn
Conclusion
In this article, we’ve successfully set up our own private VPN using Webdock Ubuntu server. If you want to learn more about OpenVPN, you can read the official documentation here: https://openvpn.net/vpn-server-resources/
As an alternative, if you do not want to set up a VPN yourself there is a wide range of VPN companies which you can use to get a fully managed service.
Related articles
-
How to install OpenLiteSpeed on Webdock
In this article we show you how you can install the OpenLiteSpeed web server on Ubuntu Jammy.
-
How to Deploy your First Node.js Application on your Ubuntu Web Server
-
How to Install and configure aaPanel on Ubuntu
-
How to install azuracast on Webdock
This guide shows you how to work around certain issues when installing azuracast on Webdock.
-
How to set up Runcloud on Webdock
-
How to set up cPanel on Webdock
-
How to set up Gridpane on Webdock
-
How to set up Ploi on Webdock
This article details the steps you need to go through in order to install Ploi on a Webdock server.
-
How to set up Laravel Forge on Webdock
-
How to set up Plesk on Webdock
This article details the steps you need to go through in order to install Plesk on a Webdock server.
-
How to set up Cyberpanel on Webdock
-
How to set up SpinupWP on Webdock
-
How to set up DirectAdmin on Webdock
-
How to set up Hestia on Webdock
-
How to set up Virtualmin on Webdock
-
How to install and create pipelines in Jenkins
-
Basic WordPress site setup with aaPanel
In this guide, we will install and setup a basic WordPress site with aaPanel.
-
How to use Nginx as reverse proxy and secure connections with SSL certificates
Using Nginx to proxy pass your site with SSL security.
-
Setting up monitoring with Netdata on your Webdock server
-
How to Setup Python Web Application With Flask Gunicorn and Nginx
A simple Python Flask web app hosting with Gunicorn and Nginx
-
How to Daemonize an Application with Systemd
Using systemd to autostart your application on system startup.
-
Set-up New Relic Monitoring on Your Webdock Server
This guide provides step-by-step instructions to install New Relic to monitor your VPS.
-
Getting Started with Ruby on Rails on Webdock
In this guide, we will show you how to get started with Ruby on Rails on your Webdock server
-
How to Install VaultWarden on Your Webdock Server
-
How to Install the Latest Version of HTOP on Ubuntu Server
Instructions to install latest htop package on your Ubuntu server
-
How to Install ImageMagick 7 on Ubuntu LEMP/LAMP stacks
Simple instructions to install ImageMagick 7 along with the PHP extension
-
A Quick Guide to Installing Rust on Ubuntu
-
How To Install Proxmox on Your Webdock Server
This article provides instructions on how to install Proxmox on your Webdock server
-
How To Run Nextcloud on Your Webdock Ubuntu Server
Instructions to Install Nextcloud on your server with Docker
-
The Ultimate Guide to Setting Up Mastodon server
A detailed guide with instructions to set up Mastodon on your Webdock server
-
A Guide To Setting Up Mindustry Game Server on Ubuntu
Step-by-step instructions to set up your own Mindustry server
-
A Guide to Installing ERPNext on Your Webdock Server
Step-by-step instructions to install ERPNext - a resource planning software - on your server
-
A Beginner's Guide to Installing Apache Kafka on Ubuntu
Detailed instructions to get Kakfa running on Ubuntu!
-
A Quick Guide To Installing Rocket Chat on Ubuntu
Instructions to install Rocket Chat on your Ubuntu server
-
How to Install Ghost CMS on a Webdock Server
Easily install Ghost CMS on your Webdock server with these instructions!