Wireguard UI Panel
Wireguard UI Panel
--
# Wireguard-UI Panel Installation
# Reference Link: https://linuxiac.com/how-to-set-up-wireguard-vpn-with-docker/
-----------------------------------------------------------------------------------
--
docker --version
docker compose version
-----------------------------Wireguard-UI Panel
Installation-----------------------------
mkdir wireguard
cd wireguard
nano docker-compose.yaml
#9.1
version: "3"
services:
# WireGuard VPN service
wireguard:
image: linuxserver/wireguard:latest
container_name: wireguard
cap_add:
- NET_ADMIN
volumes:
- ./config:/config
ports:
# Port for WireGuard-UI
- "5000:5000"
# Port of the WireGuard VPN server
- "51820:51820/udp"
# WireGuard-UI service
wireguard-ui:
image: ngoduykhanh/wireguard-ui:latest
container_name: wireguard-ui
depends_on:
- wireguard
cap_add:
- NET_ADMIN
# Use the network of the 'wireguard' service
# This enables to show active clients in the status page
network_mode: service:wireguard
environment:
- SENDGRID_API_KEY
- EMAIL_FROM_ADDRESS
- EMAIL_FROM_NAME
- SESSION_SECRET
- WGUI_USERNAME=admin
- WGUI_PASSWORD=password
- WG_CONF_TEMPLATE
- WGUI_MANAGE_START=true
- WGUI_MANAGE_RESTART=true
logging:
driver: json-file
options:
max-size: 50m
volumes:
- ./db:/app/db
- ./config:/etc/wireguard
docker-compose up -d
http://server-ip-address:5000
#12 http://server-ip-address
# switch to the “Wireguard Server
# “Post Up Script”
iptables -A FORWARD -i wg0 -j ACCEPT; iptables -t nat -A POSTROUTING -o eth0 -j
MASQUERADE
# “Post Down Script“
ufw enable
ufw start
------------------------------Additional Docker
Commands------------------------------------
#15 in any case if the server rebooted and wireguard was not functioning start the
relevant docker container
docker ps -a