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.
- BONUS - Deploy a great stack, p2p and media, all together.
-
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
- 🐳 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 be aware about potential threats:
Do I really need a VPN for Torrenting? 😲
-
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.
-
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.
As you can image - It depends on you
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 for Transmission
- 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:
- One container with Transmission which traffic is routed to our VPN container (Gluetun with NordVPN)
- The second, Gluetun VPN container, from where the ports are exposed now.
- Just make sure to get the Wireguards Keys from your NordVPN account
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 Tools for File Sharing
- qBittorrent
- You can use qBitrorrent together with Mullvad VPN
- eMule
- Syncthing & Filebrowser
- JDownloader
- Filestash
F/OSS VPN Clients
Where to get Trending Torrents
You can use torrhunt (not F/OSS ❎) application to get the latest trending Torrents:
flatpak install flathub com.ktechpit.torrhunt
How to check your container IP
#docker exec -it qbittorrent sh
curl -sS https://ipinfo.io/json #the command to use
#wget -qO- https://ipinfo.io/json
curl -sS https://am.i.mullvad.net/json #https://whatismyipaddress.com/
If you are using Windows, your IP will differ:
#for windows you would use
powershell -Command "(Invoke-WebRequest -Uri https://ipinfo.io/json).Content"
How to check if someone is using torrent at home
- https://iknowwhatyoudownload.com/en/peer/?ip=
- Torrent Address detection -> https://ipleak.net/
Interesting F/OSS Stack to use for Torrenting
Self-hosted Media & P2P Server Stack ⏬
version: '3.8'
services:
syncthing: ###### https://fossengineer.com/selfhosting-filebrowser-docker/
image: syncthing/syncthing #ghcr.io/linuxserver/syncthing
container_name: syncthing
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Rome
volumes:
- /home/Docker/Syncthing/config:/config
- /mnt/ntfs_drive:/data1 #
ports:
- 8384:8384
- 22000:22000/tcp
- 22000:22000/udp
- 21027:21027/udp
restart: unless-stopped
filebrowser:
image: filebrowser/filebrowser
container_name: filebrowser
ports:
- 8080:80
volumes:
- /home/Docker/FileBrowser/config:/config
- /mnt/ntfs_drive:/srv #same as Syncthing!
restart: unless-stopped
jellyfin:
image: lscr.io/linuxserver/jellyfin
container_name: jellyfin
environment:
- PUID=1000
- PGID=1000
- TZ=Europe/Rome
ports:
- "8096:8096"
volumes:
- "/home/Docker/Jellyfin:/config" #change it
- "/mnt/ntfs_drive/Downloads:/data" #change it
metube:
image: ghcr.io/alexta69/metube
container_name: metube
restart: unless-stopped
ports:
- "8081:8081"
volumes:
- "/mnt/ntfs_drive/Downloads:/downloads"
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" #THIS IS THE IMPORTANT PART!
volumes:
- /home/Docker/Torrents/Transmission/config:/config
- /mnt/ntfs_drive/Downloads:/downloads
- /mnt/ntfs_drive/Downloads/Transmission_watch:/watch
restart: unless-stopped
There are some well known places to get torrents…
…for example the raspberry Pi page, to share the images: https://www.raspberrypi.com/software/operating-systems/