Torrenting, at its core, is a technology that enables efficient file sharing.

It’s a method that allows users to download files from multiple sources simultaneously, speeding up the download process and reducing the load on any single server.

You might have heard about decentralization and peer-to-peer (P2P) networks are fundamental concepts in the world of open-source software and digital technology.

They offer a different approach to data storage, distribution, and communication, which can have significant benefits for open-source projects.

Torrenting in Docker with Transmission

  • Our goal today:

    • πŸ› οΈ Setting up a private torrenting hub using Transmission with Docker
    • πŸ™Š Routing the traffic through VPN to protect your privacy and ensure hackers can’t trace your home IP address.
  • Before you can begin setting up Transmission with VPN, there are a few things you’ll need to have in place:

    • 🌐 A reliable internet connection
    • πŸ”’ An active VPN subscription
      • We will have Transmission working with ProtonVPN
      • You can do similarly for Mullvad
    • 🐳 Docker installed and running on your machine

The Transmissions Project

Transmission is a popular BitTorrent client that allows users to download files over peer-to-peer networks.

It’s open-source and has been around since the early days of file sharing.

A Fast, Easy and Free Bittorrent Client that you can customize with Add-Ons

Transmission has both a web interface and native apps for macOS, Android, and Linux.

It is known for being fast, easy to use, and secure, making it an ideal choice for torrent users who want to protect their identity while downloading content.

Why P2P?

Peer-to-Peer networks can be used to improve security, backup resilience and availability.

What else can P2P do? πŸ‘ˆ
  • Enhanced Resilience and Redundancy: Decentralized systems and P2P networks offer enhanced resilience and redundancy compared to centralized setups, crucial for open-source projects reliant on volunteer contributions.

  • Facilitated Collaboration and Distribution: Collaboration and distribution are facilitated through P2P networks, enabling easier code sharing among developers and faster, more reliable software downloads from multiple sources. Decentralization promotes transparency and trust, core values of the open-source movement, by dispersing control and fostering user confidence.

Why Torrenting with VPNs Matters

While sharing public data with other users can be beneficial, it’s crucial to remain vigilant about potential threats:

Do I really need a VPN for Torrenting? 😲
  1. Anonymity: Utilizing a VPN can help obscure your IP address, making it more challenging for others to monitor your online activities. During torrenting, your public IP address is visible to all peers in the swarm, exposing you to potential targeted attacks or unwelcome attention.

    • By using a VPN, your real IP address is concealed, replaced by the IP address of the VPN server. This allows you to share without revealing your home’s internet address.
  2. Security: VPNs employ encryption to safeguard your internet traffic, shielding it from unauthorized access. This becomes particularly significant when accessing public Wi-Fi networks, where your data might be vulnerable to interception by malicious entities.

    • The encryption offered by a VPN ensures that even if your data is intercepted, it remains unreadable to unauthorized parties.

Self-Hosting Transmission

We will be using a Transmission Docker Image created by the linuxserver people.

If you plan to use P2P continuosly, its recommended to use a VPN together with your Transmission Client.

You will also know how to do it by using Glutune container with ProtonVPN

Important step and quite recommended for any SelfHosting Project - Get Docker Installed

Trust me! - Just Get Docker πŸ‹πŸ‘‡

You can install it for any PC/mac/Linux at home or in any cloud provider that you wish.

It will just take few moments, this one. If you are in Linux, just

apt-get update && sudo apt-get upgrade && curl -fsSL https://get.docker.com -o get-docker.sh
sh get-docker.sh 
#sudo apt install docker-compose -y

And install also Docker-compose with:

apt install docker-compose -y

And when the process finishes - you can use it to SelfHost other services as well.

You should see the versions with:

docker --version
docker-compose --version

#sudo systemctl status docker #and the status

Transmission Docker Configuration

Transmission Docker without VPN

Torrenting with Docker has its advantage - any process running inside a container (like a transmission) has limited access to the host system and to other containers.

  • This can help to limit the potential damage if the torrent client is compromised - the Transmission container wont be able to modify other information than the volumes we specify.

Use this configuration as a Portainer Stack or docker-compose.yaml to deploy Transmission:

---
version: "2.1"
services:
  transmission:
    image: ghcr.io/linuxserver/transmission 
    container_name: transmission
    environment:
      - PUID=1000 
      - PGID=1000 
      - TZ=Europe/Madrid 
    ports:
      - 9091:9091 #UI Port
      - 51413:51413 
      - 51413:51413/udp 
    volumes:
      - /home/Docker/Torrents/Transmission/config:/config
      - /home/Downloads:/downloads
      - /home/Downloads/Transmission_watch:/watch
    restart: unless-stopped

You can also get the same images at: lscr.io/linuxserver/transmission or linuxserver/transmission

Now, Transmission is ready at: localhost:9091

Self-Hosting Transmission with VPN (ProtonVPN)

Now, this is the best option for safer P2P:

The configuration for Transmission to use our Gluetun container as VPN looks like this:

version: "3"

services:
  transmission:
    image: ghcr.io/linuxserver/transmission
    container_name: transmission
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Madrid
    # ports:
    #   - 9091:9091 # UI Port
    #   - 51413:51413
    #   - 51413:51413/udp
    network_mode: "container:your_gluetun_container_name"
    volumes:
      - /home/Docker/Torrents/Transmission/config:/config
      - /home/Downloads:/downloads
      - /home/Downloads/Transmission_watch:/watch  
    restart: unless-stopped

  gluetun:
    image: qmcgaw/gluetun
    container_name: your_gluetun_container_name
    cap_add:
      - NET_ADMIN
    ports:
      - 9091:9091
      - 51413:51413/udp
      - 51413:51413
    environment:
      - VPN_SERVICE_PROVIDER=protonvpn
      - VPN_TYPE=wireguard
      - WIREGUARD_PRIVATE_KEY=you_will_need_this_input_from_the_vpn_config_file
      - WIREGUARD_ADDRESSES=and_also_the_ipv4_version
      - SERVER_CITIES=New York NY # choose any available city
    volumes:
      - /Home/Docker/Gluetun:/gluetun
    restart: unless-stopped
Or if you want separated Stacks for Transmission and Gluetun with ProtonVPN πŸ‘
version: "3"

services:
  transmission:
    image: ghcr.io/linuxserver/transmission
    container_name: transmission
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Madrid
    # ports:
    #   - 9091:9091 # UI Port
    #   - 51413:51413
    #   - 51413:51413/udp
    network_mode: "container:your_gluetun_container_name"
    volumes:
      - /home/Docker/Torrents/Transmission/config:/config
      - /home/Downloads:/downloads
      - /home/Downloads/Transmission_watch:/watch  
    restart: unless-stopped

The Gluetun docker container for this particular case need to have the 3 ports that we are commenting from the Transmission file:

  • The 6881 is the torrenting port and the 6011 is the UI port to access the web interface.
  • Remember that I am using Mullvad as VPN provider, but gluetun gives option to use many other VPN providers.
version: "3"
services:
  gluetun:
    image: qmcgaw/gluetun
    container_name: your_gluetun_container_name    
    cap_add:
      - NET_ADMIN
    ports: #make sure to include these for Transmission to work
      - 6081:6881
      - 6081:6881/udp
      - 6011:6011      
    environment:
      - VPN_SERVICE_PROVIDER=protonvpn
      - VPN_TYPE=wireguard
      - WIREGUARD_PRIVATE_KEY=you_will_need_this_input_from_the_vpn_config_file
      - WIREGUARD_ADDRESSES=and_also_the_ipv4_version
      - SERVER_CITIES=New York NY #choose any available city
    volumes:
      - /Home/Docker/Gluetun:/gluetun
    restart: unless-stopped

FAQ

Other F/OSS Clients for Torrenting

F/OSS VPN Clients

You can use torrhunt (not F/OSS ❎) application to get the latest trending Torrents:

flatpak install flathub com.ktechpit.torrhunt