How to Install Wireguard Web-UI on Ubuntu 22.04
WireGuard is a communication protocol and free and open-source software that implements encrypted virtual private networks, and was designed with the goals of ease of use, high speed performance, and low attack surface.
Prerequisites
- A host running Ubuntu 22.04 with a kernel that supports WireGuard.
Install Docker
If Docker is not already installed, you can install it by executing the following commands in your terminal,
curl -sSL https://get.docker.com | sh
sudo usermod -aG docker $(whoami)
exit
After running these commands, log in again to apply the group changes.
Run WireGuard Easy Container
Run the following command to automatically install and run WireGuard Easy container with the Web UI,
docker run -d \
--name=wg-easy \
-e LANG=de \
-e WG_HOST=YOUR_SERVER_IP \
-e PASSWORD=YOUR_ADMIN_PASSWORD \
-v ~/.wg-easy:/etc/wireguard \
-p 51820:51820/udp \
-p 51821:51821/tcp \
--cap-add=NET_ADMIN \
--cap-add=SYS_MODULE \
--sysctl="net.ipv4.conf.all.src_valid_mark=1" \
--sysctl="net.ipv4.ip_forward=1" \
--restart unless-stopped \
ghcr.io/wg-easy/wg-easy
Replace:
YOUR_SERVER_IP
with your WAN IP or a Dynamic DNS hostname.YOUR_ADMIN_PASSWORD
with a password to log in to the Web UI.
Allow Port
To ensure that ports 51820 (UDP) and 51821 (TCP) are open on your firewall, execute the following commands,
firewall-cmd --permanent --add-port=51820/udp
firewall-cmd --permanent --add-port=51821/tcp
Reload the firewall to apply changes,
firewall-cmd --reload
Access the Web UI
Once the container is running, you can access the Web UI by opening a web browser and navigating to,
http://YOUR_SERVER_IP:51821
Note: Replace YOUR_SERVER_IP with your server's IP address or hostname.
Additional Notes
- The Web UI provides features such as managing WireGuard clients, displaying statistics, and enabling/disabling clients.
- Make sure to keep your server and Docker installation updated for security purposes.
By following these steps, you'll have WireGuard with the Web UI up and running on your Ubuntu and Debian server.
CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME
for 10% off!
1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month
Available Locations: LAX | MIA | ATL | FRA | AMS