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
[](https://blog.linuxserver.io"all the things you can do with our containers including How-To guides, opinions and much more!")
@@ -65,6 +64,7 @@ This image provides various versions that are available via tags. Please read th
65
64
| :----: | :----: |--- |
66
65
| latest | ✅ | Stable releases based on Alpine *without* support for compiling Wireguard modules. |
67
66
| legacy | ✅ | Stable releases with support for compiling Wireguard modules for older kernels. |
67
+
68
68
## Application Setup
69
69
70
70
During container start, it will first check if the wireguard module is already installed and loaded. Kernels newer than 5.6 generally have the wireguard module built-in (along with some older custom kernels). However, the module may not be enabled. Make sure it is enabled prior to starting the container.
@@ -87,11 +87,13 @@ To add more peers/clients later on, you increment the `PEERS` environment variab
87
87
88
88
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` or `docker exec -it wireguard /app/show-peer myPC myPhone myTablet` (Keep in mind that the QR codes are also stored as PNGs in the config folder).
89
89
90
-
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.
90
+
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/wg_confs/wg0.conf` and restarting the container.
91
+
92
+
The container managed server conf is hardcoded to `wg0.conf`. However, the users can add additional tunnel config files with `.conf` extensions into `/config/wg_confs/` and the container will attempt to start them all in alphabetical order. If any one of the tunnels fail, they will all be stopped and the default route will be deleted, requiring user intervention to fix the invalid conf and a container restart.
91
93
92
94
## Client Mode
93
95
94
-
Do not set the `PEERS` environment variable. Drop your client conf into the config folder as `/config/wg0.conf` and start the container.
96
+
Do not set the `PEERS` environment variable. Drop your client conf(s) into the config folder as `/config/wg_confs/<tunnel name>.conf` and start the container. If there are multiple tunnel configs, the container will attempt to start them all in alphabetical order. If any one of the tunnels fail, they will all be stopped and the default route will be deleted, requiring user intervention to fix the invalid conf and a container restart.
95
97
96
98
If you get IPv6 related errors in the log and connection cannot be established, edit the `AllowedIPs` line in your peer/client wg0.conf to include only `0.0.0.0/0` and not `::/0`; and restart the container.
97
99
@@ -134,7 +136,7 @@ Don't forget to set the necessary POSTUP and POSTDOWN rules in your client's pee
134
136
135
137
## Usage
136
138
137
-
Here are some example snippets to help you get started creating a container.
139
+
To help you get started creating a container from this image you can either use docker-compose or the docker cli.
138
140
139
141
### docker-compose (recommended, [click here for more info](https://docs.linuxserver.io/general/docker-compose))
140
142
@@ -194,12 +196,11 @@ docker run -d \
194
196
--sysctl="net.ipv4.conf.all.src_valid_mark=1" \
195
197
--restart unless-stopped \
196
198
lscr.io/linuxserver/wireguard:legacy
197
-
198
199
```
199
200
200
201
## Parameters
201
202
202
-
Container images are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate `<external>:<internal>` respectively. For example, `-p 8080:80` would expose port `80` from inside the container to be accessible from the host's IP on port `8080` outside the container.
203
+
Containers are configured using parameters passed at runtime (such as those above). These parameters are separated by a colon and indicate `<external>:<internal>` respectively. For example, `-p 8080:80` would expose port `80` from inside the container to be accessible from the host's IP on port `8080` outside the container.
203
204
204
205
| Parameter | Function |
205
206
| :----: | --- |
@@ -230,10 +231,10 @@ You can set any environment variable from a file by using a special prepend `FIL
230
231
As an example:
231
232
232
233
```bash
233
-
-e FILE__PASSWORD=/run/secrets/mysecretpassword
234
+
-e FILE__MYVAR=/run/secrets/mysecretvariable
234
235
```
235
236
236
-
Will set the environment variable `PASSWORD` based on the contents of the `/run/secrets/mysecretpassword` file.
237
+
Will set the environment variable `MYVAR` based on the contents of the `/run/secrets/mysecretvariable` file.
237
238
238
239
## Umask for running applications
239
240
@@ -242,15 +243,20 @@ Keep in mind umask is not chmod it subtracts from permissions based on it's valu
242
243
243
244
## User / Group Identifiers
244
245
245
-
When using volumes (`-v` flags) permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user `PUID` and group `PGID`.
246
+
When using volumes (`-v` flags), permissions issues can arise between the host OS and the container, we avoid this issue by allowing you to specify the user `PUID` and group `PGID`.
246
247
247
248
Ensure any volume directories on the host are owned by the same user you specify and any permissions issues will vanish like magic.
248
249
249
-
In this instance `PUID=1000` and `PGID=1000`, to find yours use `id user` as below:
250
+
In this instance `PUID=1000` and `PGID=1000`, to find yours use `id your_user` as below:
@@ -261,12 +267,29 @@ We publish various [Docker Mods](https://github.com/linuxserver/docker-mods) to
261
267
262
268
## Support Info
263
269
264
-
* Shell access whilst the container is running: `docker exec -it wireguard /bin/bash`
265
-
* To monitor the logs of the container in realtime: `docker logs -f wireguard`
266
-
* container version number
267
-
*`docker inspect -f '{{ index .Config.Labels "build_version" }}' wireguard`
268
-
* image version number
269
-
*`docker inspect -f '{{ index .Config.Labels "build_version" }}' lscr.io/linuxserver/wireguard:legacy`
270
+
* Shell access whilst the container is running:
271
+
272
+
```bash
273
+
docker exec -it wireguard /bin/bash
274
+
```
275
+
276
+
* To monitor the logs of the container in realtime:
277
+
278
+
```bash
279
+
docker logs -f wireguard
280
+
```
281
+
282
+
* Container version number:
283
+
284
+
```bash
285
+
docker inspect -f '{{ index .Config.Labels "build_version" }}' wireguard
286
+
```
287
+
288
+
* Image version number:
289
+
290
+
```bash
291
+
docker inspect -f '{{ index .Config.Labels "build_version" }}' lscr.io/linuxserver/wireguard:legacy
292
+
```
270
293
271
294
## Updating Info
272
295
@@ -276,38 +299,83 @@ Below are the instructions for updating containers:
276
299
277
300
### Via Docker Compose
278
301
279
-
* Update all images: `docker-compose pull`
280
-
* or update a single image: `docker-compose pull wireguard`
281
-
* Let compose update all containers as necessary: `docker-compose up -d`
282
-
* or update a single container: `docker-compose up -d wireguard`
283
-
* You can also remove the old dangling images: `docker image prune`
302
+
* Update images:
303
+
* All images:
304
+
305
+
```bash
306
+
docker-compose pull
307
+
```
308
+
309
+
* Single image:
310
+
311
+
```bash
312
+
docker-compose pull wireguard
313
+
```
314
+
315
+
* Update containers:
316
+
* All containers:
317
+
318
+
```bash
319
+
docker-compose up -d
320
+
```
321
+
322
+
* Single container:
323
+
324
+
```bash
325
+
docker-compose up -d wireguard
326
+
```
327
+
328
+
* You can also remove the old dangling images:
329
+
330
+
```bash
331
+
docker image prune
332
+
```
284
333
285
334
### Via Docker Run
286
335
287
-
* Update the image: `docker pull lscr.io/linuxserver/wireguard:legacy`
288
-
* Stop the running container: `docker stop wireguard`
289
-
* Delete the container: `docker rm wireguard`
336
+
* Update the image:
337
+
338
+
```bash
339
+
docker pull lscr.io/linuxserver/wireguard:legacy
340
+
```
341
+
342
+
* Stop the running container:
343
+
344
+
```bash
345
+
docker stop wireguard
346
+
```
347
+
348
+
* Delete the container:
349
+
350
+
```bash
351
+
docker rm wireguard
352
+
```
353
+
290
354
* Recreate a new container with the same docker run parameters as instructed above (if mapped correctly to a host folder, your `/config` folder and settings will be preserved)
291
-
* You can also remove the old dangling images: `docker image prune`
355
+
* You can also remove the old dangling images:
356
+
357
+
```bash
358
+
docker image prune
359
+
```
292
360
293
361
### Via Watchtower auto-updater (only use if you don't remember the original parameters)
294
362
295
363
* Pull the latest image at its tag and replace it with the same env variables in one run:
296
364
297
-
```bash
298
-
docker run --rm \
299
-
-v /var/run/docker.sock:/var/run/docker.sock \
300
-
containrrr/watchtower \
301
-
--run-once wireguard
302
-
```
365
+
```bash
366
+
docker run --rm \
367
+
-v /var/run/docker.sock:/var/run/docker.sock \
368
+
containrrr/watchtower \
369
+
--run-once wireguard
370
+
```
303
371
304
372
* You can also remove the old dangling images: `docker image prune`
305
373
306
-
**Note:** We do not endorse the use of Watchtower as a solution to automated updates of existing Docker containers. In fact we generally discourage automated updates. However, this is a useful tool for one-time manual updates of containers where you have forgotten the original parameters. In the long term, we highly recommend using [Docker Compose](https://docs.linuxserver.io/general/docker-compose).
374
+
**warning**: We do not endorse the use of Watchtower as a solution to automated updates of existing Docker containers. In fact we generally discourage automated updates. However, this is a useful tool for one-time manual updates of containers where you have forgotten the original parameters. In the long term, we highly recommend using [Docker Compose](https://docs.linuxserver.io/general/docker-compose).
* We recommend [Diun](https://crazymax.dev/diun/) for update notifications. Other tools that automatically update containers unattended are not recommended or supported.
378
+
**tip**: We recommend [Diun](https://crazymax.dev/diun/) for update notifications. Other tools that automatically update containers unattended are not recommended or supported.
311
379
312
380
## Building locally
313
381
@@ -332,6 +400,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64
332
400
333
401
## Versions
334
402
403
+
***03.10.23:** - **Potentially Breaking Change:** Support formultiple interfaces added. Wireguard confs moved to `/config/wg_confs/`. Any file with a `.conf` extensionin that folder will be treated as a live tunnel config and will be attempted to start. If any of the tunnels fail, all tunnels will be stopped. Tunnels are started in alphabetical order. Managed server conf will continue to be hardcoded to `wg0.conf`.
335
404
***24.06.23:** - Deprecate armhf as per [https://www.linuxserver.io/armhf](https://www.linuxserver.io/armhf).
0 commit comments