Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save benjaminshafii/a4d8e4a77970785069cd0e156f67f6c9 to your computer and use it in GitHub Desktop.

Select an option

Save benjaminshafii/a4d8e4a77970785069cd0e156f67f6c9 to your computer and use it in GitHub Desktop.

Revisions

  1. benjaminshafii created this gist Jan 4, 2026.
    57 changes: 57 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,57 @@
    services:
    gluetun:
    image: qmcgaw/gluetun:latest
    container_name: gluetun
    cap_add:
    - NET_ADMIN
    devices:
    - /dev/net/tun
    environment:
    - VPN_SERVICE_PROVIDER=protonvpn
    - VPN_TYPE=wireguard
    - OPENVPN_USER=your_openvpn_username
    - OPENVPN_PASSWORD=your_openvpn_password
    - WIREGUARD_PRIVATE_KEY=your_wireguard_private_key
    - SERVER_COUNTRIES=United States
    - VPN_PORT_FORWARDING=on
    - VPN_PORT_FORWARDING_PROVIDER=protonvpn
    - VPN_PORT_FORWARDING_UP_COMMAND=/bin/sh -c 'wget -O- --retry-connrefused --post-data \"json={\\\"listen_port\\\":{{PORTS}}}\" http://127.0.0.1:8080/api/v2/app/setPreferences 2>&1'
    - WIREGUARD_MTU=1320
    - WIREGUARD_PERSISTENT_KEEPALIVE=25
    - HEALTH_VPN_DURATION_INITIAL=30s
    - HEALTH_VPN_DURATION=10s
    - BLOCK_MALICIOUS=off
    - DOT_PROVIDERS=quad9
    - TZ=America/New_York
    - PUID=1000
    - PGID=1000
    sysctls:
    - net.ipv4.conf.all.src_valid_mark=1
    volumes:
    - /DATA/gluetun:/gluetun
    - /tmp/gluetun:/tmp/gluetun
    ports:
    - "8080:8080" # qBittorrent Web UI (through gluetun)
    - "9091:9091" # whatever else you were exposing
    restart: unless-stopped
    healthcheck:
    test: ["CMD-SHELL", "test -f /tmp/gluetun/forwarded_port"]
    interval: 60s
    timeout: 10s
    retries: 3

    qbittorrent:
    image: hotio/qbittorrent
    network_mode: "service:gluetun"
    environment:
    - PUID=1000
    - PGID=1000
    - TZ=America/New_York
    - UMASK=002
    volumes:
    - /path/to/downloads:/downloads
    - /path/to/downloads2:/downloads2
    - /path/to/config:/config
    restart: unless-stopped
    depends_on:
    - gluetun