services:
wireguard:
image: lscr.io/linuxserver/wireguard:latest
container_name: wireguard
cap_add:
- NET_ADMIN
- SYS_MODULE # Optional, depending on your host kernel
environment:
- PUID=1000
- PGID=1000
- TZ=Etc/UTC
- SERVERURL=://yourdomain.com # Replace with your public IP address or DDNS domain
- SERVERPORT=51820 # The port clients will connect to externally
- PEERS=phone,laptop,tablet,desktop,smarttv # Creates exactly 5 uniquely named device profiles
- PEERDNS=1.1.1.1 # DNS used by the clients inside the tunnel
- ALLOWEDIPS=0.0.0.0/0 # Routes all client traffic through the VPN
- INTERNAL_SUBNET=10.13.13.0/24 # The internal subnet for the VPN tunnel
- LOG_CONFS=true # Prints QR codes directly into the docker container logs
volumes:
- ./config:/config
- /lib/modules:/lib/modules # Necessary if the container needs to load the kernel module
ports:
- 51820:51820/udp
sysctls:
- net.ipv4.conf.all.src_valid_mark=1
restart: unless-stopped