D
Dokploy6mo ago
Arnab

[Solved] WG-Easy Setup Help Required

I have used the below compose with coolify and it used to work, I am currently migrating to dokploy and can't get the wireguard working. I can open the web UI by assigning a domain to 51821 port, however clients can't connect to the wireguard server (uses port 51820).
version: '3.8'
services:
wg-easy:
environment:
- 'WG_HOST=${WG_HOST}'
- 'PASSWORD_HASH=${PASSWORD_HASH}'
image: ghcr.io/wg-easy/wg-easy
container_name: wg-easy
volumes:
- '/mnt/etc_wireguard:/etc/wireguard'
# ports:
# - '51820:51820/udp'
restart: unless-stopped
cap_add:
- NET_ADMIN
- SYS_MODULE
sysctls:
- net.ipv4.ip_forward=1
- net.ipv4.conf.all.src_valid_mark=1
version: '3.8'
services:
wg-easy:
environment:
- 'WG_HOST=${WG_HOST}'
- 'PASSWORD_HASH=${PASSWORD_HASH}'
image: ghcr.io/wg-easy/wg-easy
container_name: wg-easy
volumes:
- '/mnt/etc_wireguard:/etc/wireguard'
# ports:
# - '51820:51820/udp'
restart: unless-stopped
cap_add:
- NET_ADMIN
- SYS_MODULE
sysctls:
- net.ipv4.ip_forward=1
- net.ipv4.conf.all.src_valid_mark=1
3 Replies
Arnab
ArnabOP6mo ago
btw, coolify and dokploy both are on different servers from same vendor, so there shouldn't be issues with port exposing
Siumauricio
Siumauricio6mo ago
What’s the error ? I mean did you already check the logs if you see something wrong
Arnab
ArnabOP6mo ago
in the logs there were no error logs, I could connect to the client, it showed connection in wg-easy dashboard, however internet doesn't work I managed to solve the issue, it is most probably not a dokploy issue. I am not sure what exactly fixed it because I have already tried all the new changes before. maybe it is a combination of changes. eitherway, here is my docker-compose for future ref. 1. added WG_DEVICE & WG_PORT in environments 2. exposed WG_PORT to host
services:
wg-easy:
environment:
- LANG=en
# ⚠️ Required:
# Change this to your host's public address
- WG_HOST=${WG_HOST}
- PASSWORD_HASH=${PASSWORD_HASH}
- WG_DEVICE=${WG_DEVICE:-eth1}
- WG_PORT=${WG_PORT:-51820}
image: ghcr.io/wg-easy/wg-easy
container_name: wg-easy
volumes:
- /mnt/etc_wireguard:/etc/wireguard
ports:
- "51820:51820/udp"
# - "51821:51821/tcp"
restart: unless-stopped
cap_add:
- NET_ADMIN
- SYS_MODULE
# - NET_RAW # ⚠️ Uncomment if using Podman
sysctls:
- net.ipv4.ip_forward=1
- net.ipv4.conf.all.src_valid_mark=1
services:
wg-easy:
environment:
- LANG=en
# ⚠️ Required:
# Change this to your host's public address
- WG_HOST=${WG_HOST}
- PASSWORD_HASH=${PASSWORD_HASH}
- WG_DEVICE=${WG_DEVICE:-eth1}
- WG_PORT=${WG_PORT:-51820}
image: ghcr.io/wg-easy/wg-easy
container_name: wg-easy
volumes:
- /mnt/etc_wireguard:/etc/wireguard
ports:
- "51820:51820/udp"
# - "51821:51821/tcp"
restart: unless-stopped
cap_add:
- NET_ADMIN
- SYS_MODULE
# - NET_RAW # ⚠️ Uncomment if using Podman
sysctls:
- net.ipv4.ip_forward=1
- net.ipv4.conf.all.src_valid_mark=1

Did you find this page helpful?