You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+20-9Lines changed: 20 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@
7
7
[](https://github.com/linuxserver"view the source for all of our repositories.")
8
8
[](https://opencollective.com/linuxserver"please consider helping us by either donating or contributing to our budget")
9
9
10
-
The [LinuxServer.io](https://linuxserver.io) team brings you another container release featuring :-
10
+
The [LinuxServer.io](https://linuxserver.io) team brings you another container release featuring:
11
11
12
12
* regular and timely application updates
13
13
* easy user mappings (PGID, PUID)
@@ -71,6 +71,7 @@ docker create \
71
71
-e SERVERPORT=51820 `#optional` \
72
72
-e PEERS=1 `#optional` \
73
73
-e PEERDNS=8.8.8.8 `#optional` \
74
+
-e INTERNAL_SUBNET=10.13.13.0 `#optional` \
74
75
-p 51820:51820/udp \
75
76
-v /path/to/appdata/config:/config \
76
77
-v /lib/modules:/lib/modules \
@@ -85,6 +86,7 @@ docker create \
85
86
Compatible with docker-compose v2 schemas.
86
87
87
88
```
89
+
---
88
90
version: "2.1"
89
91
services:
90
92
wireguard:
@@ -101,6 +103,7 @@ services:
101
103
- SERVERPORT=51820 #optional
102
104
- PEERS=1 #optional
103
105
- PEERDNS=8.8.8.8 #optional
106
+
- INTERNAL_SUBNET=10.13.13.0 #optional
104
107
volumes:
105
108
- /path/to/appdata/config:/config
106
109
- /lib/modules:/lib/modules
@@ -109,7 +112,6 @@ services:
109
112
sysctls:
110
113
- net.ipv4.conf.all.src_valid_mark=1
111
114
restart: unless-stopped
112
-
113
115
```
114
116
115
117
## Parameters
@@ -122,10 +124,11 @@ Container images are configured using parameters passed at runtime (such as thos
122
124
|`-e PUID=1000`| for UserID - see below for explanation |
123
125
|`-e PGID=1000`| for GroupID - see below for explanation |
124
126
|`-e TZ=Europe/London`| Specify a timezone to use EG Europe/London |
125
-
|`-e SERVERURL=wireguard.domain.com`| External IP or domain name for docker host. Required for server mode. |
126
-
|`-e SERVERPORT=51820`| External port for docker host. Required for server mode. |
127
+
|`-e SERVERURL=wireguard.domain.com`| External IP or domain name for docker host. Used in server mode. If set to `auto`, the container will try to determine and set the external IP automatically|
128
+
|`-e SERVERPORT=51820`| External port for docker host. Used in server mode. |
127
129
|`-e PEERS=1`| Number of peers to create confs for. Required for server mode. |
128
-
|`-e PEERDNS=8.8.8.8`| DNS server set in peer/client configs. |
130
+
|`-e PEERDNS=8.8.8.8`| DNS server set in peer/client configs. Used in server mode. |
131
+
|`-e INTERNAL_SUBNET=10.13.13.0`| Internal subnet for the wireguard and server and peers (only change if it clashes). Used in server mode. |
129
132
|`-v /config`| Contains all relevant configuration files. |
130
133
|`-v /lib/modules`| Maps host's modules folder. |
131
134
|`--sysctl=`| Required for client mode. |
@@ -166,17 +169,24 @@ If you're on a debian/ubuntu based host with a custom or downstream distro provi
166
169
This can be run as a server or a client, based on the parameters used.
167
170
168
171
## Server Mode
169
-
Pass the environment variables `SERVERURL`, `SERVERPORT`, `PEERS` and `PEERDNS`, and the container will generate all necessary confs for both the server and the clients. The client config qr codes will be output in the docker log. They will also be saved in text and png format under `/config/peerX`.
172
+
If the environment variable `PEERS` is set to a number, the container will run in server mode and the necessary server and peer/client confs will be generated. The peer/client config qr codes will be output in the docker log. They will also be saved in text and png format under `/config/peerX`.
173
+
174
+
Variables `SERVERURL`, `SERVERPORT`, `INTERNAL_SUBNET` and `PEERDNS` are optional variables used for server mode. Any changes to these environment variables will trigger regeneration of server and peer confs. Peer/client confs will be recreated with existing private/public keys. Delete the peer folders for the keys to be recreated along with the confs.
170
175
171
-
If there is an existing `/config/wg0.conf`, the above environment variables won't have any affect. To add more peers/clients later on, you can run `docker exec -it wireguard /app/add-peer` while the container is running.
176
+
To add more peers/clients later on, you can run `docker exec -it wireguard /app/add-peer` while the container is running.
172
177
173
178
To display the QR codes of active peers again, you can use the following command and list the peer numbers as arguments: `docker exec -it wireguard /app/show-peer 1 4 5` (Keep in mind that the QR codes are also stored as PNGs in the config folder).
174
179
175
-
To recreate all server and client confs, set the above env vars, delete `/config/wg0.conf` and restart the container. Client confs will be recreated with existing private/public keys. Delete the peer folders for the keys to be recreated along with the confs.
180
+
The templates used for server and peer confs are saved under `/config/templates`. Advanced users can modify these templates and force conf generation by deleting `/config/wg0.conf` and restarting the container.
176
181
177
182
## Client Mode
178
-
Drop your client conf into the config folder as `/config/wg0.conf` and start the container.
183
+
Do not set the `PEERS` environment variable. Drop your client conf into the config folder as `/config/wg0.conf` and start the container.
184
+
185
+
186
+
## Docker Mods
187
+
[](https://mods.linuxserver.io/?mod=wireguard"view available mods for this container.")
179
188
189
+
We publish various [Docker Mods](https://github.com/linuxserver/docker-mods) to enable additional functionality within the containers. The list of Mods available for this image (if any) can be accessed via the dynamic badge above.
180
190
181
191
182
192
## Support Info
@@ -243,5 +253,6 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
243
253
244
254
## Versions
245
255
256
+
***05.04.20:** - Add `INTERNAL_SUBNET` variable to prevent subnet clashes. Add templates for server and peer confs.
246
257
***01.04.20:** - Add `show-peer` script and include info on host installed headers.
- { env_var: "SERVERURL", env_value: "wireguard.domain.com", desc: "External IP or domain name for docker host. Required for server mode."}
44
-
- { env_var: "SERVERPORT", env_value: "51820", desc: "External port for docker host. Required for server mode."}
43
+
- { env_var: "SERVERURL", env_value: "wireguard.domain.com", desc: "External IP or domain name for docker host. Used in server mode. If set to `auto`, the container will try to determine and set the external IP automatically"}
44
+
- { env_var: "SERVERPORT", env_value: "51820", desc: "External port for docker host. Used in server mode."}
45
45
- { env_var: "PEERS", env_value: "1", desc: "Number of peers to create confs for. Required for server mode."}
46
-
- { env_var: "PEERDNS", env_value: "8.8.8.8", desc: "DNS server set in peer/client configs."}
46
+
- { env_var: "PEERDNS", env_value: "8.8.8.8", desc: "DNS server set in peer/client configs. Used in server mode."}
47
+
- { env_var: "INTERNAL_SUBNET", env_value: "10.13.13.0", desc: "Internal subnet for the wireguard and server and peers (only change if it clashes). Used in server mode."}
47
48
48
49
optional_block_1: false
49
50
optional_block_1_items: ""
50
51
51
-
custom_compose: |
52
-
version: "2.1"
53
-
services:
54
-
wireguard:
55
-
image: linuxserver/wireguard
56
-
container_name: wireguard
57
-
cap_add:
58
-
- NET_ADMIN
59
-
- SYS_MODULE
60
-
environment:
61
-
- PUID=1000
62
-
- PGID=1000
63
-
- TZ=Europe/London
64
-
- SERVERURL=wireguard.domain.com #optional
65
-
- SERVERPORT=51820 #optional
66
-
- PEERS=1 #optional
67
-
- PEERDNS=8.8.8.8 #optional
68
-
volumes:
69
-
- /path/to/appdata/config:/config
70
-
- /lib/modules:/lib/modules
71
-
ports:
72
-
- 51820:51820/udp
73
-
sysctls:
74
-
- net.ipv4.conf.all.src_valid_mark=1
75
-
restart: unless-stopped
76
-
77
52
# application setup block
78
53
app_setup_block_enabled: true
79
54
app_setup_block: |
@@ -84,18 +59,21 @@ app_setup_block: |
84
59
This can be run as a server or a client, based on the parameters used.
85
60
86
61
## Server Mode
87
-
Pass the environment variables `SERVERURL`, `SERVERPORT`, `PEERS` and `PEERDNS`, and the container will generate all necessary confs for both the server and the clients. The client config qr codes will be output in the docker log. They will also be saved in text and png format under `/config/peerX`.
62
+
If the environment variable `PEERS` is set to a number, the container will run in server mode and the necessary server and peer/client confs will be generated. The peer/client config qr codes will be output in the docker log. They will also be saved in text and png format under `/config/peerX`.
63
+
64
+
Variables `SERVERURL`, `SERVERPORT`, `INTERNAL_SUBNET` and `PEERDNS` are optional variables used for server mode. Any changes to these environment variables will trigger regeneration of server and peer confs. Peer/client confs will be recreated with existing private/public keys. Delete the peer folders for the keys to be recreated along with the confs.
88
65
89
-
If there is an existing `/config/wg0.conf`, the above environment variables won't have any affect. To add more peers/clients later on, you can run `docker exec -it wireguard /app/add-peer` while the container is running.
66
+
To add more peers/clients later on, you can run `docker exec -it wireguard /app/add-peer` while the container is running.
90
67
91
68
To display the QR codes of active peers again, you can use the following command and list the peer numbers as arguments: `docker exec -it wireguard /app/show-peer 1 4 5` (Keep in mind that the QR codes are also stored as PNGs in the config folder).
92
69
93
-
To recreate all server and client confs, set the above env vars, delete `/config/wg0.conf` and restart the container. Client confs will be recreated with existing private/public keys. Delete the peer folders for the keys to be recreated along with the confs.
70
+
The templates used for server and peer confs are saved under `/config/templates`. Advanced users can modify these templates and force conf generation by deleting `/config/wg0.conf` and restarting the container.
94
71
95
72
## Client Mode
96
-
Drop your client conf into the config folder as `/config/wg0.conf` and start the container.
73
+
Do not set the `PEERS` environment variable. Drop your client conf into the config folder as `/config/wg0.conf` and start the container.
97
74
98
75
# changelog
99
76
changelogs:
77
+
- { date: "05.04.20:", desc: "Add `INTERNAL_SUBNET` variable to prevent subnet clashes. Add templates for server and peer confs." }
100
78
- { date: "01.04.20:", desc: "Add `show-peer` script and include info on host installed headers." }
0 commit comments