You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

109 lines
2.2 KiB
Markdown

1 year ago
# wg-easy
###### guide-by-example
![logo](https://i.imgur.com/IRgkp2o.png)
# Purpose & Overview
Web GUI for Wireguard VPN.<br>
* [Github](https://github.com/WeeJeWel/wg-easy)
Wireguard is the best VPN solution right now. But its not noob friendly or easy.<br>
WG-easy tries to solve this.
Written in javascript.
# Files and directory structure
```
/home/
└── ~/
└── docker/
└── wg-easy/
├── 🗁 wireguard_data/
├── 🗋 .env
└── 🗋 docker-compose.yml
```
* `wireguard_data/` - a directory with wireguard config files
* `.env` - a file containing environment variables for docker compose
* `docker-compose.yml` - a docker compose file, telling docker how to run the container
# Compose
`docker-compose.yml`
```yml
services:
wg-easy:
1 week ago
image: ghcr.io/wg-easy/wg-easy:13
1 year ago
container_name: wg-easy
hostname: wg-easy
restart: unless-stopped
11 months ago
env_file: .env
1 year ago
volumes:
- ./wireguard_data:/etc/wireguard
ports:
- "51820:51820/udp" # vpn traffic
12 months ago
- "51821:51821" # web interface
1 year ago
cap_add:
- NET_ADMIN
- SYS_MODULE
sysctls:
- net.ipv4.ip_forward=1
- net.ipv4.conf.all.src_valid_mark=1
1 year ago
networks:
default:
name: $DOCKER_MY_NETWORK
external: true
1 year ago
```
`.env`
```bash
# GENERAL
1 year ago
DOCKER_MY_NETWORK=caddy_net
1 year ago
TZ=Europe/Bratislava
#WG-EASY
1 month ago
WG_HOST=vpn.example.com # can also be just public IP
1 year ago
PASSWORD=supersecretpassword
1 year ago
WG_PORT=51820
WG_DEFAULT_ADDRESS=10.221.221.x
WG_ALLOWED_IPS=192.168.1.0/24
WG_DEFAULT_DNS=
```
DNS is set to null, otherwise issues.
# Reverse proxy
Caddy v2 is used, details
[here](https://github.com/DoTheEvo/selfhosted-apps-docker/tree/master/caddy_v2).</br>
`Caddyfile`
```php
vpn.{$MY_DOMAIN} {
1 year ago
reverse_proxy wg-easy:51821
1 year ago
}
```
# First run
1 year ago
![loginpic](https://i.imgur.com/V30cDwq.png)
Login with the password from the .env file.<br>
Add user, download config, use it.
1 year ago
# Trouble shooting
# Update
Manual image update:
- `docker compose pull`</br>
- `docker compose up -d`</br>
- `docker image prune`