WireGuard VPS template on HostAfrica

WireGuard implementation on HostAfrica

Russell

Last Update 3 months ago

Overview:

WireGuard is a modern VPN protocol that aims to provide a simpler and more efficient alternative to traditional VPN technologies. It is designed for high performance and security, utilizing state-of-the-art cryptography. WireGuard is easy to set up and configure, making it suitable for both personal and enterprise use.

EXAMPLE USE CASES:
  1. Remote Work Security: WireGuard can be used by remote employees to securely connect to their company's internal network, ensuring that sensitive data is protected while accessing resources from home or on the go.

  2. Secure Internet Browsing: Individuals can use WireGuard to encrypt their internet traffic, protecting their privacy and security while browsing, especially on public Wi-Fi networks.

  3. Site-to-Site VPN: Businesses can implement WireGuard to create secure connections between different office locations, allowing for safe data exchange and communication across sites.

  4. Bypassing Geo-Restrictions: Users can utilize WireGuard to access content that may be restricted in their region by routing their internet connection through servers in different locations.

  5. IoT Device Security: WireGuard can be deployed to secure communications between Internet of Things (IoT) devices, ensuring that data transmitted between devices is encrypted and protected from unauthorized access.

IMPLEMENTATION ON HOSTAFRICA

Our “WireGuard” VPS implementation includes wg-easy, the easiest way to run WireGuard VPN + Web-based Admin. It comes with a simple web interface to manage a WireGuard VPN server that allows easy creation of VPN clients, downloading configuration files, and using QR codes for quick mobile setup without manual file editing.

The implementation also includes caddy as a reverse-proxy and tool for SSL creation. All these are all implemented in a docker using docker containers.

Software Components:
ComponentDescription
DockerContainerization software
wg-easyContainerized wireguard app with webUI admin
CaddyContainerized reverse proxy and SSL creation
Cloud-initSoftware to provision the Wireguard app
The deployment files, including the docker-compose.yml, Caddyfile, and env, are stored in the /root/ directory. Hence, this makes the /root/ directory the working directory. The service is expose on HTTPS port 443.
Environment Variables:

The “.env” file holds environment variables for setting up the Wireguard application but contains no notable variables. The essential file is the Caddyfile, where the domain is declared.

Cloud-init Functionality:
Cloud-init passes the client’s generated domain and auth key to the /root/caddy/Caddyfile.
 How to change the Domain:
If a client wants to use a custom domain, I recommend using DNS CNAME records to point it to the randomly generated Hostafrica domain. If they insist, update the domain in /root/caddy/Caddyfile.
How to Access the WireGuard GUI:
WHMCS automatically generates a free domain after purchase. Visit “wg.(domain generated)” to access the Wireguard GUI. This opens a password-protected (or not) Wireguard setup page

Was this article helpful?

0 out of 0 liked this article

Still need help? Message Us