2021-05-23 18:25:14 +08:00
|
|
|
# WireGuard Easy
|
|
|
|
|
2021-05-23 22:54:48 +08:00
|
|
|
[![Build & Publish Docker Image to Docker Hub](https://github.com/WeeJeWel/wg-easy/actions/workflows/deploy.yml/badge.svg?branch=production)](https://github.com/WeeJeWel/wg-easy/actions/workflows/deploy.yml)
|
2021-05-23 23:08:36 +08:00
|
|
|
[![Lint](https://github.com/WeeJeWel/wg-easy/actions/workflows/lint.yml/badge.svg?branch=master)](https://github.com/WeeJeWel/wg-easy/actions/workflows/lint.yml)
|
2021-05-23 23:05:24 +08:00
|
|
|
[![Docker](https://img.shields.io/docker/v/weejewel/wg-easy/latest)](https://hub.docker.com/r/weejewel/wg-easy)
|
|
|
|
[![Docker](https://img.shields.io/docker/pulls/weejewel/wg-easy.svg)](https://hub.docker.com/r/weejewel/wg-easy)
|
|
|
|
[![Sponsor](https://img.shields.io/github/sponsors/weejewel)](https://github.com/sponsors/WeeJeWel)
|
2021-05-23 22:54:48 +08:00
|
|
|
|
|
|
|
You have found the easiest way to install & manage WireGuard on any Linux host!
|
|
|
|
|
2021-05-23 22:57:51 +08:00
|
|
|
<p align="center">
|
2021-05-24 00:17:22 +08:00
|
|
|
<img src="./assets/screenshot.png" width="702" />
|
2021-05-23 22:57:51 +08:00
|
|
|
</p>
|
2021-05-23 22:54:48 +08:00
|
|
|
|
|
|
|
## Features
|
|
|
|
|
2021-05-23 22:59:27 +08:00
|
|
|
* All-in-one: WireGuard + Web UI.
|
|
|
|
* Easy installation, simple to use.
|
2021-07-14 03:00:40 +08:00
|
|
|
* List, create, edit, delete, enable & disable clients.
|
2021-05-23 22:59:27 +08:00
|
|
|
* Show a client's QR code.
|
|
|
|
* Download a client's configuration file.
|
|
|
|
* Statistics for which clients are connected.
|
|
|
|
* Gravatar support.
|
2021-05-23 22:54:48 +08:00
|
|
|
|
2021-07-14 03:00:40 +08:00
|
|
|
## Requirements
|
|
|
|
|
|
|
|
* A host with a kernel that supports WireGuard (all modern kernels).
|
|
|
|
|
2021-05-23 21:55:50 +08:00
|
|
|
## Installation
|
|
|
|
|
|
|
|
### 1. Install Docker
|
|
|
|
|
2021-05-23 22:24:25 +08:00
|
|
|
If you haven't installed Docker yet, install it by running:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ curl -sSL https://get.docker.com | sh
|
|
|
|
$ sudo sh get-docker.sh
|
|
|
|
$ sudo usermod -aG docker $(whoami)
|
|
|
|
$ bash
|
|
|
|
```
|
|
|
|
|
|
|
|
### 2. Configure WireGuard
|
|
|
|
|
|
|
|
Run these commands to prepare and configure WireGuard.
|
2021-05-23 18:25:14 +08:00
|
|
|
|
|
|
|
```bash
|
2021-05-23 21:59:50 +08:00
|
|
|
$ mkdir ~/.wg-easy
|
|
|
|
$ cd ~/.wg-easy
|
2021-05-23 22:04:37 +08:00
|
|
|
$ wget https://raw.githubusercontent.com/WeeJeWel/wg-easy/master/docker-compose.yml
|
|
|
|
$ vim docker-compose.yml
|
2021-05-23 18:25:14 +08:00
|
|
|
```
|
|
|
|
|
2021-05-23 22:04:37 +08:00
|
|
|
Change `WG_HOST=raspberrypi.local` to your server's public address, e.g. `WG_HOST=vpn.mydomain.com`.
|
2021-05-23 21:55:50 +08:00
|
|
|
|
|
|
|
Optionally, set a Web UI password by uncommenting `PASSWORD=foobar123` and change the password.
|
|
|
|
|
2021-05-25 21:59:18 +08:00
|
|
|
> By default, any WireGuard client will have access to the Web UI, unless you set a password.
|
|
|
|
|
2021-05-23 22:24:25 +08:00
|
|
|
### 3. Run WireGuard
|
|
|
|
|
|
|
|
Finally, run WireGuard. It will automatically start after a reboot.
|
2021-05-23 18:25:14 +08:00
|
|
|
|
2021-05-23 21:55:50 +08:00
|
|
|
```bash
|
2021-05-23 23:05:24 +08:00
|
|
|
$ docker-compose up --detach
|
2021-05-23 21:55:50 +08:00
|
|
|
```
|
2021-05-23 18:25:14 +08:00
|
|
|
|
2021-05-23 21:55:50 +08:00
|
|
|
The Web UI will be available on `http://0.0.0.0:51821`. You can create new clients there.
|
2021-05-23 18:25:14 +08:00
|
|
|
|
|
|
|
## Options
|
|
|
|
|
2021-05-23 21:55:50 +08:00
|
|
|
These options can be configured in `docker-compose.yml` under `environment`.
|
2021-05-23 18:25:14 +08:00
|
|
|
|
|
|
|
| Env | Default | Example | Description |
|
|
|
|
| - | - | - | - |
|
2021-05-23 21:55:50 +08:00
|
|
|
| `PASSWORD` | - | `foobar123` | When set, requires a password when logging in to the Web UI. |
|
2021-05-23 18:25:14 +08:00
|
|
|
| `WG_HOST` | - | `vpn.myserver.com` | The public hostname of your VPN server |
|
2021-07-15 19:01:26 +08:00
|
|
|
| `WEBHOST` | - | `0.0.0.0` | IP where the web server listens
|
2021-05-23 18:25:14 +08:00
|
|
|
| `WG_PORT` | `51820` | `51820` | The public UDP port of your VPN server |
|
2021-07-15 21:45:00 +08:00
|
|
|
| `WG_PERSISTENTKEEPALIVE` | `25` | `60` | Value in seconds to keep the "connection" open |
|
2021-05-23 18:25:14 +08:00
|
|
|
| `WG_DEFAULT_ADDRESS` | `10.8.0.x` | `10.6.0.x` | Clients IP address range |
|
|
|
|
| `WG_DEFAULT_DNS` | `1.1.1.1` | `8.8.8.8, 8.8.4.4` | DNS server clients will use |
|
2021-06-15 23:58:58 +08:00
|
|
|
| `WG_ALLOWED_IPS` | `0.0.0.0/0, ::/0` | `192.168.15.0/24, 10.0.1.0/24` | Allowed IPs clients will use |
|
2021-05-23 18:25:14 +08:00
|
|
|
|
2021-05-23 22:57:51 +08:00
|
|
|
> If you change `WG_PORT`, make sure to also change the exposed port.
|
2021-07-14 03:39:45 +08:00
|
|
|
|
|
|
|
# Updating
|
|
|
|
|
|
|
|
To update to the latest version, run:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
docker-compose down
|
|
|
|
docker-compose pull
|
|
|
|
docker-compose up --detach --remove-orphans
|
|
|
|
docker image prune
|
2021-07-15 19:01:08 +08:00
|
|
|
```
|