Need Guidance on Routing Docker Container Traffic through a Wireguard VPN

Hey there, I’m a newbie when it comes to self-hosting and working with Docker. I’m looking to route traffic from a couple of my Docker containers (specifically, qBittorrent and Prowlarr) through a Wireguard container that’s hooked up to Mullvad. Any tips on how to set this up?


Here is my compose file:


<span style="color:#323232;">version: "3.7"
</span><span style="color:#323232;">
</span><span style="color:#323232;">services:
</span><span style="color:#323232;">  prowlarr:
</span><span style="color:#323232;">    container_name: prowlarr
</span><span style="color:#323232;">    image: ghcr.io/hotio/prowlarr
</span><span style="color:#323232;">    ports:
</span><span style="color:#323232;">      - "9696:9696"
</span><span style="color:#323232;">    environment:
</span><span style="color:#323232;">      - PUID=1000
</span><span style="color:#323232;">      - PGID=1000
</span><span style="color:#323232;">      - UMASK=002
</span><span style="color:#323232;">      - TZ=ETC/GMT
</span><span style="color:#323232;">    volumes:
</span><span style="color:#323232;">      - '/home/${USER}/server/configs/prowlarr:/config'
</span><span style="color:#323232;">    restart: unless-stopped
</span><span style="color:#323232;">  sonarr:
</span><span style="color:#323232;">    image: lscr.io/linuxserver/sonarr:latest
</span><span style="color:#323232;">    container_name: sonarr
</span><span style="color:#323232;">    environment:
</span><span style="color:#323232;">      - PUID=1000
</span><span style="color:#323232;">      - PGID=1000
</span><span style="color:#323232;">      - TZ=ETC/GMT
</span><span style="color:#323232;">    volumes:
</span><span style="color:#323232;">      - '/home/${USER}/server/configs/sonarr:/config'
</span><span style="color:#323232;">      - '/home/${USER}/server:/data'
</span><span style="color:#323232;">    ports:
</span><span style="color:#323232;">      - 8989:8989
</span><span style="color:#323232;">    restart: unless-stopped
</span><span style="color:#323232;">  radarr:
</span><span style="color:#323232;">    image: lscr.io/linuxserver/radarr:latest
</span><span style="color:#323232;">    container_name: radarr
</span><span style="color:#323232;">    environment:
</span><span style="color:#323232;">      - PUID=1000
</span><span style="color:#323232;">      - PGID=1000
</span><span style="color:#323232;">      - TZ=ETC/GMT
</span><span style="color:#323232;">    volumes:
</span><span style="color:#323232;">      - '/home/${USER}/server/configs:/config'
</span><span style="color:#323232;">      - '/home/${USER}/server:/data'
</span><span style="color:#323232;">    ports:
</span><span style="color:#323232;">      - 7878:7878
</span><span style="color:#323232;">    restart: unless-stopped
</span><span style="color:#323232;">  jellyfin:
</span><span style="color:#323232;">    image: lscr.io/linuxserver/jellyfin:latest
</span><span style="color:#323232;">    container_name: jellyfin
</span><span style="color:#323232;">    environment:
</span><span style="color:#323232;">      - PUID=1000
</span><span style="color:#323232;">      - PGID=1000
</span><span style="color:#323232;">      - TZ=ETC/GMT
</span><span style="color:#323232;">    volumes:
</span><span style="color:#323232;">      - '/home/${USER}/server/configs/jellyfin:/config'
</span><span style="color:#323232;">      - '/home/${USER}/server/media:/data/media'
</span><span style="color:#323232;">    ports:
</span><span style="color:#323232;">      - 8096:8096
</span><span style="color:#323232;">    restart: unless-stopped
</span><span style="color:#323232;">  qbittorrent:
</span><span style="color:#323232;">    image: lscr.io/linuxserver/qbittorrent:latest
</span><span style="color:#323232;">    container_name: qbittorrent
</span><span style="color:#323232;">    environment:
</span><span style="color:#323232;">      - PUID=1000
</span><span style="color:#323232;">      - PGID=1000
</span><span style="color:#323232;">      - TZ=Etc/UTC
</span><span style="color:#323232;">      - WEBUI_PORT=8080
</span><span style="color:#323232;">    volumes:
</span><span style="color:#323232;">      - '/home/${USER}/server/configs/qflood:/config'
</span><span style="color:#323232;">      - '/home/${USER}/server/torrents:/data/torrents'
</span><span style="color:#323232;">    ports:
</span><span style="color:#323232;">      - 8080:8080
</span><span style="color:#323232;">      - 6881:6881
</span><span style="color:#323232;">      - 6881:6881/udp
</span><span style="color:#323232;">    restart: unless-stopped
</span>
mike_wooskey,
@mike_wooskey@lemmy.d.thewooskeys.com avatar

This might be a bit much, depending on your experience with docker and bash, but I uae this framework/platform to selfhost many apps and services, and qbittorrent via wireguard (using mullvad) is one of them: d.rymcg.tech

That link is to the main page of the project, which explains how to set up and use the framework/platform. From that page, you can get to the qbit torrent-wireguard app, or here is a direct link: d.rymcg.tech/qbittorrent-wireguard.

Once you get used to the platform, it’s quite easy to use, very customizable and versatile, and follows good philosophy of seperating your data from the app. And while it may be more advanced than you’re looking for, it’s very well documented, making it pretty easy to just follow the required steps.

kryllic,
@kryllic@programming.dev avatar

I followed this dude’s tutorial and my setup is working flawlessly: youtu.be/xbSfaKwyfXE?feature=shared

In Gluetun’s wiki, they have a section that covers most vpn providers, and has a section that gives you an example docker compose: github.com/qdm12/gluetun-wiki/blob/…/mullvad.md

I have a very similar setup to yours with just qbittorrent running through Gluetun via Mullvad. It’s working perfectly and pretty easy to connect additional containers. Fair warning tho, each time you ad a new container you need to redo the network setting for your previous containers in portainer for some reason, idk why but that took me a while to figure out lol

MoonlitSanguine,

Thank you so much! I managed to get it working. However, I’m not sure now how to establish communication between Sonarr/Radarr/etc and Prowlarr, as well as the reverse.

kryllic,
@kryllic@programming.dev avatar

If you’re talking about the *arr apps connecting to qBT, there should be a setting in each app called connections or something that let you add an api key so they can talk with the download manager, as well as Prowlarr

  • All
  • Subscribed
  • Moderated
  • Favorites
  • selfhost@lemmy.ml
  • PowerRangers
  • DreamBathrooms
  • thenastyranch
  • magazineikmin
  • mdbf
  • Youngstown
  • ethstaker
  • slotface
  • khanakhh
  • rosin
  • hgfsjryuu7
  • kavyap
  • tsrsr
  • ngwrru68w68
  • Leos
  • Durango
  • modclub
  • everett
  • cubers
  • vwfavf
  • InstantRegret
  • osvaldo12
  • GTA5RPClips
  • tester
  • cisconetworking
  • tacticalgear
  • normalnudes
  • anitta
  • All magazines