How to set up WireGuard on your Webdock Server
Last updated: July 21st 2024
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.
WireGuard 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 WireGuard, you should know the public IP address of your Webdock server.
# curl icanhazip.com
You’ll get your IP Address in response.
Setup WireGuard
Update your Ubuntu and clone the git repository of the WireGuard deployment script.
# sudo apt update && sudo apt upgrade -y # mkdir vpn && cd vpn # wget https://git.io/wireguard -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.
# sudo chmod +x install.sh # sudo ./install.sh Welcome to this WireGuard road warrior installer! What port should WireGuard listen to? Port [51820]: <- Enter or choose a port you like Enter a name for the first client: Name [client]: webdock (or some client name you like) Select a DNS server for the client: 1) Current system resolvers 2) Google 3) 1.1.1.1 4) OpenDNS 5) Quad9 6) AdGuard DNS server [1]: 3 (Or whatever DNS provider you like) BoringTun will be installed to set up WireGuard in the system. Should automatic updates be enabled for it? [Y/n]: Y WireGuard installation is ready to begin. Press any key to continue...
After the installation, install a client and scan the QR code as instructed or download the client configuration file as shown in the final message:
█████████████████████████████████████████████████████████████████████████ █████████████████████████████████████████████████████████████████████████ ████ ▄▄▄▄▄ █▀▀▀▄████▄█▀ ▀ █ ▀▀█▄▄ ▄█▄▄▄▄ █▀ ▀█ ▀▀▄ ▀▄ ▀▀▄██▄▀█ ▄▄▄▄▄ ████ ████ █ █ █▀▀▄▄ ██▄▄▄ ▀█▀█▀██▀ ▄▀▄▀▀▄█▄▄▀▀██▀▄▄ ▀██▀██ ▀▀ ▀▄█ █ █ ████ ████ █▄▄▄█ █▀█▄▄██ ▄█▄ ▄▀▀█▀▄█▀▄█▀ ▄▄▄ █▀▀█ █▄█ ▀▄█▀█ ▄▄▀█▄█ █▄▄▄█ ████ ████▄▄▄▄▄▄▄█▄▀ ▀▄▀▄▀▄▀▄█ █▄█ ▀▄▀ █ █▄█ ▀ █ ▀ █▄█▄▀▄█ █ █ █▄▀▄█▄▄▄▄▄▄▄████ ████▄▄▄ ▄█▄▄▄▀▀▀▀▄▄ ▄▄ ▄▀ ▄ ▀ ▀ ▀█▄ ▄ ▀█ ▀ ▀▄██▀▀▄▀█▀▄▄▀██ ▀ ▀ ▀▄█ ▀████ ████ ▀ ▄▀█▄▀▀▄▄▄ ▀▄▄▀▄▄▄ ▀▄▄█▀▀█▄▄▄█▀█▀▀█ ▄██▄█▀▀█▀▀█▄ ▀█ ▄█ █▀▄▀▄█▄████ █████▀██ █▄█ ▄█ █▀▀█▀█▄▀▀█▀▀▄ ██ ▄ ▀▀▄ ▀█ ▄▄▄▄▀▀▄▄█▄▄ ▄█▄█ ▀██▀▀▄█ █████ █████▄▀▀▄▄▄▀▀▄▄ ▀▄ ▄▀▀▄▀ ▄ ▀██▀ █▄▄█ ▀ █ ▀▀▀██▀██ ▄▀▀▄█ █▄ ▄█▄▄▀█▀████ ████▄▄ ▄█▄▄ █▀█▄▀▄▄█▀ ▄▀▄█████▄ █ ▀█ ▀ █▀█▀▄▀▄▄█ ▄▄ █▀▀▄▀▀█▀ ▄████ ████▀█▄▄█ ▄▀ ▄ █▀▄▀ █▄█▄ ▀ ▄▄██▀████▀▄█▄▀█▀ █▄▀ ▄▀█▄█▀▄█ ▀▄ ▀██▄ █▄█████ ████▀ ██ ▄▀ ▀▀▄█ ▄▄▀▄▀ █▀▄█▄▄▄▄ ▄▄█▀▀▀ ▄▄▀ ▄▀▀▄▀▄▀▄▄▀▀█▀ ▀▄▀▄▄▄█ ▄▄████ ██████▄█ ▀▄█ ▄ ▄▀▀▀▄ ▀██▄▄███▀█▀█▄▀▀█▀▄███ ████▀ ▄█ ▄█ ▄▄█▄█▀█ ▄▄█▄▀████ ████ █ ▄▀█▀▀ ▄ ▀▀▀██▀█▀█▄█▄█▄▄▄▀▄██▀▄▀█▀▀▀▀▄▀▀▄ █ ▄ ▀▀ ▀██ ██ ▄████ ████▄ ▀▄▄█▄ ▀ ▀ █▄█▀▄▀▄█▄ ▄ ▀█▀▀██▄█▀ ▀▀▄█▄██▀▀ █ ▄█▄ ▄█▄█▀▄█ ▄▄█████ █████▄█▀▀▀▄▀▄ █ ▀▄ ▀██▀▄█ ▄ ▄▄ ▀▀▀ ▀▄█ ▀█▄█▄▄█▀▀▀▄ ▄▄ █▄▄ ▀█▄ █▄█▄▄████ ████ ▀▄ ▄▄▄ █ ▄▀▀▄▀█▀█▄█▄▀▄ ▀ ▄█▀ ▄▄▄ █ █▄ █ █▀▀ ▄▄ █ ▀▄█ ▄▄▄ ███████ ███████ █▄█ ▀▄█▀ ▀▀███ ███▄▄▄▄ █▄█ ▀▄▀ ██ ▄█▄ ▀ ▄▄▀▄▄▀ █▄█ ▀▀████ ████▀ ▀ ▄ ▄▄ ▄▀▀ ▀ █▄▄████▄▀ ▄▄▄▄▄ ▄▄█ █▄ ▄▄ █▀▀ ▄ ▀█ ▄▄ ▄ ▀▄█▄████ ████ ▀ ▀▀█▄▄▄ ▀▀█▀█▀▀ █▄▄█▀▄ ▄ ██▄▄█▄█▀▄ ▀▀▀ ▄▀█ █▀█ ██▄▀▀ █▄ ▀ ▄▄▄▀████ █████▄█ ▄▄ ▀ ▀ ▀ ▀▄█▄▄█▄█▀▄▀▀▀ ▄ ██▄█ █▄▄▀ ▀▀███▄▄███▀█▀▄▀▀▄ ████ ████▄▄ █ ▄▄ █▀▄█ ███ █ ▄█ ▀ ▀▄ █▄▄▀▄▀█▀▀▄▄ ▀██▀▄▄▀▄▄ ▀▀█▄ ▀▀██ ▄████ ████▀▄▀ █▄▄▀█▄▄▀██ █▄█▀ ▄ █ ▀██████▄█▄▄▀ █ █▄▀ █ ▄▀ ▀█ ▄█ ▄█▀ ▄█ ████ ████ ███ ▄ ████▀▀▄▄▀▀▀▀▀▄ ▀▄█▀▀▀ ▄▄▀▄▄▀▀▀▄▄▄▄█▀██ ▀ ▄ ▄▀▀██▄▄▄█▄█▄▄▄████ ████▄█▀▄▄▄▄▀▄█▄█ █▄ ▀█▀ ▄▀▀█▀▄▀▀▄ ▀▄ ██ █▄▄▄ ██ █▄▄▄█▄▀▄ █▄ ▄▄ ▄▀ █████ ████▄▀█▄█▀▄ ▀ █▄█▄ ▄██▄ █████▀▄▄▀▀▄ █ ▀▀▀ ▀ ▀ █▀▀▀ ▀▄ █▀▀ ▀▄███▄▀█ █████ ████▀▀ ▀▄█▄ ▄▄ ▄ ▀ ▄▄██▀▀ ██▄█▀▀▄ █▄ ▄ ▀██▀██▀█▀ ▀█ █▄▄▄ ▀█████▀█▄█████ ████ █▀█▄▄▄▀▀▄ █▀▀███▄▀ ▄▀▄█▀█▀▄▀▀▄█ ▄ ▄▄▀▀▀▄▄ ▄▄█▀▄ █▄▀ █▄ ▄▄█ ▄▄████ ████▀█▄ █▄▄█ ▀▄▀ ▀▀▀▀▀█▄ ▄██▀▀█▀ ▀▄▄█▀█ ▄█▄ ▄ ▀▀▀ █ ▄▀▄▄▄█▄█▄▀▄██▄▄ ████ █████▄▄█▄█▄█▀█▄▀█ █ ▄███▀█▀▀▀█▄ █▀ ▄▄▄ ██▀ █▀▄▀▄▀█ ▀▀▄▄▄▄█▀▀ ▄▄▄ ▄▀ ▀████ ████ ▄▄▄▄▄ █▄▀▀██▀▀▀▄█▄▄█▄ ▄▄▀ ▀▀▄ █▄█ ▀▀▄█▄▄▄██ ▀█▄█ ▄▀▄ ▀ █▄█ ▄▀▄▀████ ████ █ █ █ █ ▀ █ ▀█▀█▄████ ▄█▀█▄▄ ▄▀▄▄ ▄▀ ▀ █▀█ ▄█▀██▄ ▄ ▄█▄ ▄████ ████ █▄▄▄█ █ ▄█▀ ▀▀█▀█▄█▄▄█▄▀ ███▄▀▄▀██ ▄▀▄█▄█▀█ ▀█ ██ ▀▄▀ █ █ █████ ████▄▄▄▄▄▄▄█▄██▄██▄▄▄█▄█▄█▄▄███▄▄████▄▄▄█▄█▄████▄███▄▄█▄█████▄▄▄▄▄▄██████ █████████████████████████████████████████████████████████████████████████ █████████████████████████████████████████████████████████████████████████ ↑ That is a QR code containing the client configuration. Finished! The client configuration is available in: /root/webdock.conf New clients can be added by running this script again.
Use your VPN
WireGuard client software is available for Android, iOS, Windows, Linux etc.
For Linux, you can simply install it using apt.
sudo apt install wireguard
Download the Client Config File to your Local Machine
You can download the file using Scp, Netcat or Python, but Python way is the easiest.
# cd /root && 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 webdock.conf file.
Conclusion
In this article, we’ve successfully set up our own private VPN using Webdock Ubuntu server. If you want to learn more about WireGuard, you can read the official documentation here: https://www.wireguard.com/
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.
Last updated: March 29th 2023
-
How to Deploy your First Node.js Application on your Ubuntu Web Server
Deploy a Node.js application on your Ubuntu server and how to issue SSL certificates for your Node application.
Last updated: July 19th 2023
-
How to Install and configure aaPanel on Ubuntu
Install aaPanel on Ubuntu as well as building a LEMP stack, pointing your domain to your server and setting SSL certificates with Let's Encrypt.
Last updated: November 10th 2022
-
How to install azuracast on Webdock
This guide shows you how to work around certain issues when installing azuracast on Webdock.
Last updated: November 10th 2022
-
How to set up Runcloud on Webdock
This article details the steps you need to go through in order to install Runcloud on a Webdock server.
Last updated: July 29th 2024
-
How to set up cPanel on Webdock
This article details the steps you need to go through in order to install cPanel on a Webdock server.
Last updated: September 23rd 2024
-
How to set up Gridpane on Webdock
This article details the steps you need to go through in order to install Gridpane on a Webdock server.
Last updated: November 10th 2022
-
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.
Last updated: November 10th 2022
-
How to set up Laravel Forge on Webdock
This article details the steps you need to go through in order to install Laravel Forge on a Webdock server.
Last updated: November 10th 2022
-
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.
Last updated: November 10th 2022
-
How to set up Cyberpanel on Webdock
This article details the steps you need to go through in order to install Cyberpanel on a Webdock server.
Last updated: December 9th 2023
-
How to set up SpinupWP on Webdock
This article details the steps you need to go through in order to installSpinupWP on a Webdock server.
Last updated: March 15th 2023
-
How to set up DirectAdmin on Webdock
This article details the steps you need to go through in order to install DirectAdmin on a Webdock server.
Last updated: September 1st 2023
-
How to set up Hestia on Webdock
This article details the steps you need to go through in order to install Hestia on a Webdock server.
Last updated: November 10th 2022
-
How to set up Virtualmin on Webdock
This article details the steps you need to go through in order to install Virtualmin on a Webdock server.
Last updated: November 10th 2022
-
How to install and create pipelines in Jenkins
This guide describes the step-by-step procedure of installing Jenkins and creating pipelines in Jenkins.
Last updated: November 10th 2022
-
Basic WordPress site setup with aaPanel
In this guide, we will install and setup a basic WordPress site with aaPanel.
Last updated: January 23rd 2023
-
How to use Nginx as reverse proxy and secure connections with SSL certificates
Using Nginx to proxy pass your site with SSL security.
Last updated: July 19th 2023
-
Setting up monitoring with Netdata on your Webdock server
Setting up monitoring on your server to receive alerts and to know real-time resource consumption on your server.
Last updated: July 19th 2023
-
How to Setup Python Web Application With Flask Gunicorn and Nginx
A simple Python Flask web app hosting with Gunicorn and Nginx
Last updated: July 19th 2023
-
How to Daemonize an Application with Systemd
Using systemd to autostart your application on system startup.
Last updated: July 19th 2023
-
Set-up New Relic Monitoring on Your Webdock Server
This guide provides step-by-step instructions to install New Relic to monitor your VPS.
Last updated: July 29th 2024
-
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
Last updated: July 19th 2023
-
How to Install VaultWarden on Your Webdock Server
This guide provided step-by-step instructions to Vaultwarden, an open-source Password Manager on your Webdock Server.
Last updated: July 19th 2023
-
How to Install the Latest Version of HTOP on Ubuntu Server
Instructions to install latest htop package on your Ubuntu server
Last updated: July 29th 2024
-
How to Install ImageMagick 7 on Ubuntu LEMP/LAMP stacks
Simple instructions to install ImageMagick 7 along with the PHP extension
Last updated: November 1st 2023
-
A Quick Guide to Installing Rust on Ubuntu
Instructions to install Rust
Last updated: December 18th 2023
-
How To Install Proxmox on Your Webdock Server
This article provides instructions on how to install Proxmox on your Webdock server
Last updated: July 29th 2024
-
How To Run Nextcloud on Your Webdock Ubuntu Server
Instructions to Install Nextcloud on your server with Docker
Last updated: February 13th 2024
-
The Ultimate Guide to Setting Up Mastodon server
A detailed guide with instructions to set up Mastodon on your Webdock server
Last updated: February 20th 2024
-
A Guide To Setting Up Mindustry Game Server on Ubuntu
Step-by-step instructions to set up your own Mindustry server
Last updated: November 4th 2024
-
A Guide to Installing ERPNext on Your Webdock Server
Step-by-step instructions to install ERPNext - a resource planning software - on your server
Last updated: May 28th 2024
-
A Beginner's Guide to Installing Apache Kafka on Ubuntu
Detailed instructions to get Kakfa running on Ubuntu!
Last updated: June 20th 2024
-
A Quick Guide To Installing Rocket Chat on Ubuntu
Instructions to install Rocket Chat on your Ubuntu server
Last updated: July 2nd 2024
-
How to Install Ghost CMS on a Webdock Server
Easily install Ghost CMS on your Webdock server with these instructions!
Last updated: September 2nd 2024
-
How to Install cPanel on a Webdock Ubuntu Server
Instructions for setting up cPanel on an Ubuntu server
Last updated: September 23rd 2024