I have been pulling my hair out for three days trying to migrate from my TrueCharts (24.04) setup to Docker Compose (25.04).
Previously I had QBitTorrent running with a Wireguard VPN to TorGuard. I was able to login to the web UI locally, and my torrent traffic went through the VPN.
I have read several posts here today and have made a little progress, but still cannot get it to work completely.
Here’s where I am now:
- With the Table, PostUp, and PostDown settings in my Wireguard config, I am able to access the web UI
- The wg0 interface shows in the web UI advanced settings tab
- Torrents will not start, and it indicates it is disconnected from the Internet
- If I switch to “any” interface in the advanced settings tab, torrents work, but not through the VPN
- If I remove the Table, PostUp, and PostDown settings in the Wireguard config, I am unable to access the web UI (and it still doesn’t seem that torrent traffic is going through the VPN)
- The Wireguard config file is the same I was using in TrueCharts, except that I commented out the DNS entry as I read that can cause problems
- I am using TorGuard’s Torrent IP Detector magnet link and service to check the origin IP
- I am also using Debian and Ubuntu ISO torrents (which connect, but error out; but that’s a different problem to work out later)
- Yes, I use some 172.16 subnets for my network, and I have Docker changed in TrueNAS to use 10.32/16. This is working fine with other services.
Compose:
services:
wireguard:
image: lscr.io/linuxserver/wireguard:latest
container_name: wireguard
cap_add:
- NET_ADMIN
- SYS_MODULE
environment:
- PUID=568
- PGID=568
- TZ=America/Chicago
volumes:
- /mnt/vol1/crypt/home/yottabit/wireguard/92.conf:/config/wg_confs/wg0.conf
- /lib/modules:/lib/modules
ports:
- 10009:8080
- 54583:6861/tcp
- 54583:6861/udp
sysctls:
- net.ipv4.conf.all.src_valid_mark=1
restart: unless-stopped
qbittorrent:
image: lscr.io/linuxserver/qbittorrent:latest
container_name: qbittorrent
network_mode: service:wireguard
environment:
- PUID=568
- PGID=568
- TZ=America/Chicago
- WEBUI_PORT=8080
- LAN_NETWORK=172.16.42.0/24
volumes:
- /mnt/vol1/docker/config/qbittorrent:/config
- /mnt/ssd_scratch/incoming_media:/incoming_media
- /mnt/vol1/movies:/mnt/movies
- /mnt/vol1/tv:/mnt/tv
- /mnt/vol1/audio_books:/mnt/audio_books
# tmpfs:
# - /incoming_media:mode=1777
# ports:
# - 10009:8080
# - 54583:6861/tcp
# - 54583:6861/udp
depends_on:
- wireguard
restart: unless-stopped
networks: {}
Wireguard:
# TorGuard WireGuard Config
[Interface]
PrivateKey = ...
ListenPort = 57062
MTU = 1420
#DNS = 1.1.1.1
Address = 10.13.128.85/24
Table = 1000
PostUp = ip -4 route change default via 10.13.128.1 table 1000
PostUp = ip -4 rule add priority 1 from 10.13.128.85 table 1000
PostDown = ip -4 rule del priority 1 from 10.13.128.85 table 1000
[Peer]
PublicKey = ...
AllowedIPs = 0.0.0.0/0
Endpoint = 77.81.139.74:1443
PersistentKeepalive = 25
Any ideas here what I am missing?