Skip to content
thrnz edited this page Sep 3, 2022 · 4 revisions

Here are some working examples showing some ways in which the container can be used.

SOCKS5 proxy accessible from the LAN

Note that the socks-proxy container essentially inherits the network stack of the vpn container, so things like ports are set on the vpn container itself.

version: '3'
services:
    vpn:
        image: thrnz/docker-wireguard-pia
        volumes:
            - pia-dat:/pia
        ports:
            - 1080:1080
        cap_add:
            - NET_ADMIN
        environment:
            - LOCAL_NETWORK=192.168.1.0/24
            - LOC=swiss
            - USER=xxxx
            - PASS=xxxx
        sysctls:
            - net.ipv4.conf.all.src_valid_mark=1

    socks-proxy:
        image: serjs/go-socks5-proxy
        network_mode: "service:vpn"

volumes:
    pia-dat:

Bittorrent client with port forwarding

The forwarded port number can be read from the vpn container's logs and entered manually into qBitorrent's settings. Using PORT_PERSIST=1 might be worthwhile to try to keep the same port number forwarded across contianer restarts. This can potentially be automated by scripting.

version: '3'
services:
    vpn:
        image: thrnz/docker-wireguard-pia
        volumes:
            - pia-dat:/pia
        ports:
            - 8080:8080
        cap_add:
            - NET_ADMIN
        environment:
            - LOCAL_NETWORK=192.168.1.0/24
            - LOC=swiss
            - USER=xxxx
            - PASS=xxxx
            - PORT_FORWARDING=1
        sysctls:
            - net.ipv4.conf.all.src_valid_mark=1

    qbittorrent:
        image: lscr.io/linuxserver/qbittorrent:latest
        network_mode: "service:vpn"
        volumes:
            - /path/to/appdata/config:/config
            - /path/to/downloads:/downloads

volumes:
    pia-dat: