Why?

This setup will allow you to download and seed torrents for shows that you have already purchased on a physical medium exclusively through your VPN. If the VPN connection fails, the network inside the container is disconnected. Your IP will absolutely never be seen in a bittorrent swarm, therefore the traffic can not be traced back to you, provided your VPN service doesn't log your information. Additionally, automated downloading TV shows allows you to be one of the first users to download a torrent for new episodes of shows which you already have purchased on a physical medium, thus improving your seed ratio significantly from future leechers.

What you need First, you'll need to make sure you have Docker and docker-compose installed on your machine. Next, you'll need a VPN connection and the relevant OpenVPN configuration. I personally use Mullvad, and you can find their configuration download here. I recommend choosing a location relatively close to yours for improved download speeds. Also make sure that you have a dedicated port forwarded from your VPN service. Mullvad has a handy guide here. Going forward we'll assume that Mullvad has assigned me port 6969 .

qBittorrent and OpenVPN First, create a docker-compose.yml file. version: '3.7' services: torrent: container_name: qbittorent-vpn image: markusmcnugen/qbittorrentvpn ports: - 8080:8080 - 6969:6969 - 6969:6969/udp sysctls: net.ipv6.conf.all.disable_ipv6: 0 privileged: true volumes: - ./torrent:/config - ./media:/downloads environment: VPN_ENABLED: 'yes' LAN_NETWORK: 192.168.1.0/24 NAME_SERVERS: 8.8.8.8,8.8.4.4 INCOMING_PORT_ENV: 6969 In your ./torrent/openvpn folder, you'll want to paste all of the openVPN config files that you obtained earlier. The image we're using is markusmcnugen/qbittorrentvpn , which is actively updated at the time of writing. If you find that there are not active updates, there are plenty of forks available. You can even fork it yourself here. The ports we are exposing are 8080 for the web UI that we will use to interact with qBittorrent, and 6969 , the forwarded port provided to us by our VPN service. sysctls: net.ipv6.conf.all.disable_ipv6: 0 This little bit just makes sure that ipv6 is enabled in the container, openvpn needs it. The torrent folder is where the configurations for openVPN and qBittorrent will be places. The media folder is where qBittorrent will save torrents by default. The INCOMING_PORT_ENV environment variable is the forwarded port from earlier. Next we'll look at setting up the Plex container. This step is optional if you already have Plex installed on your machine or are using another media platform.

Setting up Plex (Optional) This is an optional step if you already have Plex on your machine, or are using an alternative media platform such as Emby or Jellyfin Add the following to your docker-compose.yml file. plex: container_name: plex image: plexinc/pms-docker:latest restart: unless-stopped environment: - TZ=America/New_York volumes: - ./plex/config:/config - ./plex/transcode:/transcode - ./media:/data This one is a little more straight forward. We're using the official plexinc docker image here. Set the environment variable TZ to your time zone code. You can find your timezone code here. Your ./plex directory will be used to persist your configurations and your media transcoding. Go ahead and point that same media directory to the container's data directory. This is where plex wants all of your shows to be. By default, plex uses the host network, so you don't need to expose any ports. If you are migrating Plex servers you can set the PLEX_CLAIM environment variable to your claim token. Our last step is setting up Sonarr and Jackett to automatically download shows and make them available to Plex.

Sonarr and Jackett Sonarr is a service that monitors indexers (trackers) for shows that you want to download new episodes for. Jackett is essentially an interface tool that handles Sonarr requests for trackers, and tracker responses. Go ahead and add the following services to your docker-compose.yml sonarr: container_name: sonarr image: linuxserver/sonarr:preview ports: - 8989:8989 environment: - PUID=1000 - PGID=1000 - TZ=America/New_York volumes: - ./sonarr:/config - ./media/TV:/tv jackett: image: linuxserver/jackett container_name: jackett ports: - 9117:9117 environment: - PUID=1000 - PGID=1000 - TZ=America/New_York volumes: - ./jackett:/config At the time of writing, Sonarr's v3 is still under development. Their :latest docker image is only v2. We're going to use v3 because it has more rich features and a nicer UI. Feel free to use v2 is you're more comfortable with that. In both our sonarr and jackett containers we're going to set our PUID and PGID to the same as the host system. You don't have to do this but it might save you from some permission errors in the future. Sonarr and Jackett will expose ports 8989 and 9117 , respectively. Both sonarr and jackett will have their own config volumes on the host system for persistence. We'll use the ./media/TV folder to hold our TV shows for Sonarr to scan, so it knows the episodes that we have for monitoring purposes.

Final docker-compose file After following all the previous steps, your docker-compose.yml file should look something like this: version: '3.7' services: torrent: container_name: qbittorent-vpn image: markusmcnugen/qbittorrentvpn ports: - 8080:8080 - 6969:6969 - 6969:6969/udp privileged: true sysctls: net.ipv6.conf.all.disable_ipv6: 0 volumes: - ./torrent:/config - ./media:/downloads environment: VPN_ENABLED: 'yes' LAN_NETWORK: 192.168.1.0/24 NAME_SERVERS: 8.8.8.8,8.8.4.4 INCOMING_PORT_ENV: 6969 plex: container_name: plex image: plexinc/pms-docker:latest restart: unless-stopped environment: - TZ=America/New_York volumes: - ./plex/config:/config - ./plex/transcode:/transcode - ./media:/data sonarr: container_name: sonarr image: linuxserver/sonarr:preview ports: - 8989:8989 environment: - PUID=1000 - PGID=1000 - TZ=America/New_York volumes: - ./sonarr:/config - ./media/TV:/tv jackett: image: linuxserver/jackett container_name: jackett ports: - 9117:9117 environment: - PUID=1000 - PGID=1000 - TZ=America/New_York volumes: - ./jackett:/config Go ahead and run docker-compose up and watch your services come to life.

Configuring the services Head into your Plex instance at localhost:32400 and set /data/TV to be your TV show library. Now, pop over to Jackett at localhost:9117 and input the information for the torrent indexer of your choice. Afterwards, log into Sonarr at localhost:8989 , click Settings -> indexers and input your Jackett information per the instructions on the Jackett webpage. It's worth noting that since your docker containers are all in the same network, you'll have to change the URL host provided by Jackett when configuring Sonarr from localhost to jackett . It should look something like this: Next, go to the Download Clients tab to input your qBittorent information. Your configuration should look something like this: Just fill in the username and password that you are using for qBittorrent. Important: Note that the category is TV , this is important for qBittorrent to automatically manage your torrents later. For our final Sonarr configuration, we'll set up a remote path. This is located in the Download Clients tab. This basically tells Sonarr that qBittorrent's /downloads/TV/ path maps to Sonarr's /tv/ path. Which, if you remember the configuration in docker-compose earlier, it does! In order to have qBittorrent place the torrents in the correct folder, we have to set up automatic management in qBittorrent settings. Navigate to localhost:8080 in your browser and login, then select the options window (the little gear). Enable Automatic torrent management like so. This is where the Sonarr category setting of TV comes into play. All torrents tagged with TV will be saved to /downloads/TV/ , which is Sonarr's /tv/ folder! It's all coming together. One nice-to-have that I like is a little script to automatically unpack .rar files that may be within torrents. Scroll down in qBittorrent options and enter the following: "/usr/bin/unrar" x -ibck -inul "%F/*.r*" "%F/" This won't affect any non-rar files.

So there you have it! Any shows that you follow on Sonarr will automatically have torrents downloaded by qBittorrent through a secure VPN, and convenientally placed for consumption through Plex. Completely automated to get you as high a ratio as possible.

I hope this guide was helpful, feel free to let me know if you have any questions.