WireGuard is a fast, lightweight, and modern VPN protocol designed for simplicity and performance.
If youโre looking for a minimal yet powerful VPN solution, WireGuard with wg-easy is a great choice. It provides a clean web-based UI for managing peers โ perfect for self-hosted environments, small businesses, or labs.
In this post, Iโll guide you through deploying WireGuard using Docker on Ubuntu 24.04, based on my actual setup and test server configuration.
Make sure you have the following ready:
199.180.134.132 (replace with your own)Weโll use Docker to simplify the deployment process.
curl -fsSL https://get.docker.com | sudo bash Verify Docker installation:
docker --version Create a directory to store all configuration files and keys:
sudo mkdir -p /srv/wireguard
sudo chmod -R 755 /srv/wireguard Starting from wg-easy v14, plain text passwords are no longer supported.
You must use a bcrypt hash for the admin password.
To generate it:
docker run ghcr.io/wg-easy/wg-easy:14 wgpw YOUR_PASSWORD Replace YOUR_PASSWORD with your desired dashboard password.
Example output:
$2a$12$Rc5VfU6n9d4Wm3JTnBYB1eUPEZvs4glH73VPYuKXGmuJsYkkKXJle Keep this hash safe โ youโll use it in the next step.
Now run the container using the command below.
Replace the IP and password hash with your own values.
docker run -d \
--name=wg-easy \
-e WG_HOST=199.180.134.132 \
-e PASSWORD_HASH='$2a$12$Rc5VfU6n9d4Wm3JTnBYB1eUPEZvs4glH73VPYuKXGmuJsYkkKXJle' \
-v /srv/wireguard:/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:latest Check if the container is running:
docker ps You should see a container named wg-easy with a โhealthyโ or โupโ status.
To view logs:
docker logs wg-easy Once the container is running, open the web interface in your browser:
๐ http://199.180.134.132:51821
Log in using the password you set earlier.
From here, you can:
If you need to adjust timezone settings, you can add this variable to your Docker command:
-e TZ=Etc/UTC Download the client configuration from the dashboard and import it into your WireGuard client (available for Windows, macOS, Linux, Android, and iOS).
Activate the connection and test your IP at https://whatismyipaddress.com.
If it shows your VPN serverโs IP, your setup is working perfectly!
Youโve now deployed a fully functional WireGuard VPN server using Docker and wg-easy on Ubuntu 24.04.
With this setup, you can easily manage peers via a simple web UI โ no manual configuration files needed.
Highlights:
Securing your website with HTTPS is essential for privacy, SEO ranking, and user trust. Letโs…
If you manage Linux servers regularly, you know how important SSH (Secure Shell) is. Whether…
If youโre new to Linux or thinking about switching from Windows or macOS, this guide…
Introduction Site Reliability Engineering (SRE) has become a critical discipline in modern IT operations. The…
Updated: August 17, 2025 A practical guide to the best free CRM (Customer Relationship Management)…
If you run a VPS or dedicated server with Linux, you probably know that managing…
This website uses cookies.