|
|
|
@ -1,12 +1,5 @@ |
|
|
|
# WireGuard Easy |
|
|
|
|
|
|
|
[](https://github.com/WeeJeWel/wg-easy/actions/workflows/deploy.yml) |
|
|
|
[](https://github.com/WeeJeWel/wg-easy/actions/workflows/lint.yml) |
|
|
|
[](https://hub.docker.com/r/weejewel/wg-easy) |
|
|
|
[](https://hub.docker.com/r/weejewel/wg-easy) |
|
|
|
[](https://github.com/sponsors/WeeJeWel) |
|
|
|
 |
|
|
|
|
|
|
|
You have found the easiest way to install & manage WireGuard on any Linux host! |
|
|
|
|
|
|
|
<p align="center"> |
|
|
|
@ -23,66 +16,48 @@ You have found the easiest way to install & manage WireGuard on any Linux host! |
|
|
|
* Statistics for which clients are connected. |
|
|
|
* Tx/Rx charts for each connected client. |
|
|
|
* Gravatar support. |
|
|
|
* Multi-user management with Redis database |
|
|
|
|
|
|
|
## Requirements |
|
|
|
|
|
|
|
* A host with a kernel that supports WireGuard (all modern kernels). |
|
|
|
* A host with Docker installed. |
|
|
|
* A host with Docker and docker-compose installed. |
|
|
|
|
|
|
|
## Installation |
|
|
|
|
|
|
|
### 1. Install Docker |
|
|
|
|
|
|
|
If you haven't installed Docker yet, install it by running: |
|
|
|
|
|
|
|
```bash |
|
|
|
$ curl -sSL https://get.docker.com | sh |
|
|
|
$ sudo usermod -aG docker $(whoami) |
|
|
|
$ exit |
|
|
|
``` |
|
|
|
|
|
|
|
And log in again. |
|
|
|
### 1. Run WireGuard Easy |
|
|
|
|
|
|
|
### 2. Run WireGuard Easy |
|
|
|
|
|
|
|
To automatically install & run wg-easy, simply run: |
|
|
|
To install & run wg-easy: |
|
|
|
|
|
|
|
<pre> |
|
|
|
$ docker run -d \ |
|
|
|
--name=wg-easy \ |
|
|
|
-e WG_HOST=<b>🚨YOUR_SERVER_IP</b> \ |
|
|
|
-e PASSWORD=<b>🚨YOUR_ADMIN_PASSWORD</b> \ |
|
|
|
-v ~/.wg-easy:/etc/wireguard \ |
|
|
|
-p 51820:51820/udp \ |
|
|
|
-p 51821:51821/tcp \ |
|
|
|
--cap-add=NET_ADMIN \ |
|
|
|
--cap-add=SYS_MODULE \ |
|
|
|
--sysctl="net.ipv4.conf.all.src_valid_mark=1" \ |
|
|
|
--sysctl="net.ipv4.ip_forward=1" \ |
|
|
|
--restart unless-stopped \ |
|
|
|
weejewel/wg-easy |
|
|
|
$ git clone https://github.com/Elemento-Modular-Cloud/wg-easy.git |
|
|
|
$ cd wg-easy |
|
|
|
</pre> |
|
|
|
|
|
|
|
> 💡 Here you want to edit the `docker-compose.yml` file. |
|
|
|
> |
|
|
|
> 💡 Replace `YOUR_SERVER_IP` with your WAN IP, or a Dynamic DNS hostname. |
|
|
|
> |
|
|
|
> 💡 Replace `YOUR_ADMIN_PASSWORD` with a password to log in on the Web UI. |
|
|
|
> 💡 If you enable `USERS_PATH` be sure to place your file inside `./src/`. |
|
|
|
> |
|
|
|
> 💡 Your configuration files will be saved in `~/.wg-easy` |
|
|
|
<pre> |
|
|
|
$ docker-compose up |
|
|
|
</pre> |
|
|
|
|
|
|
|
The Web UI will now be available on `http://0.0.0.0:51821`. |
|
|
|
|
|
|
|
> 💡 Your configuration files will be saved in `~/.wg-easy` |
|
|
|
|
|
|
|
### 3. Sponsor |
|
|
|
### 2. Sponsor |
|
|
|
|
|
|
|
Are you enjoying this project? [Buy me a beer!](https://github.com/sponsors/WeeJeWel) 🍻 |
|
|
|
Are you enjoying this project? [Buy him a beer!](https://github.com/sponsors/WeeJeWel) 🍻 |
|
|
|
|
|
|
|
## Options |
|
|
|
|
|
|
|
These options can be configured by setting environment variables using `-e KEY="VALUE"` in the `docker run` command. |
|
|
|
These options can be configured by setting environment variables inside `docker-compose.yml`. |
|
|
|
|
|
|
|
| Env | Default | Example | Description | |
|
|
|
| - | - | - | - | |
|
|
|
| `PASSWORD` | - | `foobar123` | When set, requires a password when logging in to the Web UI. | |
|
|
|
| `WG_HOST` | - | `vpn.myserver.com` | The public hostname of your VPN server. | |
|
|
|
| `USERS_PATH` | - | `/app/users.json` | The path to a JSON file located under ./src/(users.json) made of users and passwords. | |
|
|
|
| `WG_DEVICE` | `eth0` | `ens6f0` | Ethernet device the wireguard traffic should be forwarded through. | |
|
|
|
| `WG_PORT` | `51820` | `12345` | The public UDP port of your VPN server. WireGuard will always listen on `51820` inside the Docker container. | |
|
|
|
| `WG_MTU` | `null` | `1420` | The MTU the clients will use. Server uses default WG MTU. | |
|
|
|
@ -97,17 +72,6 @@ These options can be configured by setting environment variables using `-e KEY=" |
|
|
|
|
|
|
|
> If you change `WG_PORT`, make sure to also change the exposed port. |
|
|
|
|
|
|
|
## Updating |
|
|
|
|
|
|
|
To update to the latest version, simply run: |
|
|
|
|
|
|
|
```bash |
|
|
|
docker stop wg-easy |
|
|
|
docker rm wg-easy |
|
|
|
docker pull weejewel/wg-easy |
|
|
|
``` |
|
|
|
|
|
|
|
And then run the `docker run -d \ ...` command above again. |
|
|
|
|
|
|
|
## Common Use Cases |
|
|
|
|
|
|
|
|