I am trying to have a QBitTorrent Docker container that is accessible on my local network and connects to WireGuard. I know this is a basic question, and I’m sorry if I’m wasting your time.

Here is my docker compose file.

---
services:
  qbittorrent:
    image: lscr.io/linuxserver/qbittorrent:latest
    container_name: qbittorrent
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
      - WEBUI_PORT=8080
      - TORRENTING_PORT=6881
    volumes:
      - /home/torrent/torrent/:/config
      - /home/torrent/download/:/downloads 
    network_mode: service:wireguard
    depends_on:
      - wireguard
    restart: always

  wireguard:
    image: lscr.io/linuxserver/wireguard
    container_name: wireguard
    cap_add:
    - NET_ADMIN
    - SYS_MODULE
    environment:
    - PUID=1000
    - PGID=1000
    - TZ=Europe/London
    ports:
    - 51820:51820/udp
    volumes:
    - /home/torrent/wireguard/:/config
    - /home/torrent/wireguard/london.conf/:/config/wg0.conf
    sysctls:
    - net.ipv4.conf.all.src_valid_mark=1
    restart: always

  • ffhein@lemmy.world
    link
    fedilink
    English
    arrow-up
    0
    ·
    6 days ago

    This is my wireguard docker setup:

    version: "3.6"
    services:
      wireguard:
        image: linuxserver/wireguard
        container_name: wireguard
        cap_add:
          - NET_ADMIN
          - SYS_MODULE
        environment:
          - PUID=116
          - PGID=122
          - TZ=Europe/Stockholm
          - ALLOWEDIPS=192.168.1.0/24
        volumes:
          - /data/torrent/wireguard/config:/config
          - /lib/modules:/lib/modules
        ports:
          - 192.168.1.111:8122:8122  # Deluge webui
          - 192.168.1.111:9127:9127  # jackett webui
          - 192.168.1.111:9666:9666  # prowlarr webui
          - 51820:51820/udp           # wireguard
          - 192.168.1.111:58426:58426  # Deluge RPC
        sysctls:
          - net.ipv4.conf.all.src_valid_mark=1
          - net.ipv6.conf.all.disable_ipv6=1
          - net.ipv6.conf.default.disable_ipv6=1
        restart: unless-stopped
    

    Can reach the webuis from LAN, no other network configuration was necessary. 192.168.1.111 is the server’s LAN address. The other services are configured very similar to your qbittorrent, and don’t expose any ports. Can’t promise it’s 100% correct but it’s working for me.