Amnezia WireGuard is a simple, secure, and high-performance VPN solution based on WireGuard.
50K+
Launch your projects with Aéza's ultra-affordable VPS from just €1!
Choose from multiple global locations and enjoy instant setup in under 5 minutes.
Powered by AMD processors and NVMe SSDs with AntiDDoS protection.
Start now at my-aeza.net! 20% CASHBACK
(fork of WireGuard) (https://docs.amnezia.org/documentation/amnezia-wg/)
This Docker image allows you to quickly set up and run a WireGuard server in a containerized environment, offering an easy-to-use, lightweight VPN with enhanced privacy and security. It is not recognized by DPI (Deep Packet Inspection) analysis systems, making it resistant to blocking.
docker pull metaligh/amneziawg
docker run -d --name amnezia_container --cap-add NET_ADMIN --device /dev/net/tun -p 51820:51820/udp metaligh/amneziawg
Configure your clients using the generated configuration or QR codes provided by the container.
New parameters: Jc, Jmin, Jmax, S1, S2, H1, H2, H3, H4 (vpn_params.cfg)IP: IP address of your Amnezia WireGuard Server (AWG). (serverip.cfg)DNS: Default is Google DNS Servers. (serverip.cfg)AWG_PORT: Specify the WireGuard port (default is 51820). (serverip.cfg)/etc/amnezia/amneziawg: Mount this directory to store the script, configuration, and keys before running the container:amneziawg.tar.gzUnpack amneziawg.tar.gz to /opt/amneziawg/
mkdir -p /opt/amneziawg && tar -xzf amneziawg.tar.gz -C /opt/amneziawg/
docker cp amnezia_container:/etc/amnezia/amneziawg/ /opt/
In this case also copy awg from container to host first -
docker cp amnezia_container:/usr/bin/awg /usr/bin/
The container includes all necessary tools to generate or regenerate keys and add or remove VPN clients.
docker exec -it amnezia_container /bin/bash
By accessing the running Docker container, you can follow this process:
cat ./readme
ls -la
awgstart awguser readme serverip.cfg vpn_params.cfg
nano ./serverip.cfg
"vpn_params.cfg" contains additional Amnezia WireGuard parameters.
nano ./vpn_params.cfg
Run the following command to generate the primary user configuration and QR code for the first connection:
awguser
awgstart
Run awguser again, then after verifying the configuration, run awgstart to apply changes. This will generate a QR code for your convenience.
.cfg files:You must regenerate all .conf files. This can be done using the awguser command.
Always run the awgstart command after making any changes to ensure they take effect.
exit
docker restart amnezia_container
If you want to use Docker Compose, create a file named docker-compose.yaml with the following content:
services:
amneziawgml:
image: metaligh/amneziawg:latest
container_name: amnezia_container
cap_add:
- NET_ADMIN
devices:
- /dev/net/tun
# volumes:
# - /opt/amneziawg:/etc/amnezia:rw
ports:
- "51820:51820/udp"
restart: unless-stopped
After creating the file, run the following command to start the service:
docker compose up -d
Then proceed with the configuration above.↑
Don't forget to configure routing from your interface for your VPN server to access the Internet on host server:
sysctl -w net.ipv4.ip_forward=1
echo "net.ipv4.ip_forward = 1" > /etc/sysctl.conf
sudo sysctl -p
Just a variant for iptables, where eth0 is your interface to get to the internet:
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
iptables -t nat -A POSTROUTING -o eth0 -s 192.168.200.0/32 -j MASQUERADE
Content type
Image
Digest
sha256:b9c97c8c7…
Size
35.1 MB
Last updated
almost 2 years ago
docker pull metaligh/amneziawg