Skip to content

VPN with killswitch and qBittorrent in docker-compose #406

Open
@ghost

Description

Hi everyone.

I managed to configure this VPN container and attached a qBittorrent container to it. It seems to work fine so far, and checking the public IP addresses inside of both the VPN and the qBittorrent container show that they are connected to the VPN.

Still, I don't feel like I 100% understand everything relating to this setup, so I wanted to ask if someone could take a look at my docker compose file and tell me if it's fine like this or if I made a mistake anywhere. I especially want the qBittorrent container to never ever be able to connect to the internet if it's not through the VPN.

Thanks in advance!

version: '3.4'
services:
  vpn:
    container_name: vpn
    image: dperson/openvpn-client
    devices:
      - /dev/net/tun
    dns: 1.1.1.1
    environment:
      FIREWALL: ''
      TZ: 'Europe/Berlin'
    volumes:
      - /home/pi/docker/openvpn:/vpn
    restart: unless-stopped
    cap_add:
      - net_admin
    networks:
      - default
    ports:
      - 8081:8081
      - 6881:6881
      - 6881:6881/udp
  qbittorrent:
    container_name: qbittorrent
    image: lscr.io/linuxserver/qbittorrent:latest
    depends_on: 
      - vpn
    network_mode: service:vpn
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Berlin
      - WEBUI_PORT=8081
    volumes:
      - /home/pi/docker/qbittorrent_linuxserver:/config
      - /mnt/Toshiba2TB/downloads:/downloads
    restart: unless-stopped
networks:
  default:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions