This is the multi-page printable view of this section. Click here to print.
Distribution
- 1: Torrent
- 1.1: rTorrent
- 1.2: Transmission
1 - Torrent
I’ve taken a look at a few of the clients you’d run on a server. The notable ones are:
- Aria2
- Deluge
- qBittorrent
- rTorrent
- Transmission
1.1 - rTorrent
RTorrent is a contender for the best, light-weight, torrent client. It’s terminal based, though there are web interfaces for it. In my testing it was second-best in terms of resource use.
The developer has recently picked it up again and is pulling in community contributions. My recent (Jan 2026) builds of it had segfault issues, but those may be cleaned up by now.
You can build and install on the same box, but if you’re running a seed box you may prefer to package it for deployment, so I’ve included both so you can:
or
Build and Install
LibTorrent
RTorrent depends on LibTorrent, also from this developer.
# on Debian 13 (Trixie)
sudo apt install git
git clone https://github.com/rakshasa/libtorrent
cd libtorrent
sudo apt install build-essential autoconf libcurlpp-dev libtool
autoreconf -ivf
./configure
make
sudo make install
RTorrent
# Assuming you've already installed and built libtorrent on this box. Adjust branch after checking
git clone https://github.com/rakshasa/rtorrent --branch v0.16.6 --depth 1 rtorrent-0.16.6
sudo apt install libncurses-dev
autoreconf -ivf
./configure
make
sudo make install
Build and Package
Packaging things into a .deb is a bit of an adventure. But give it a try. Once you get it going you can probably use some sort of system to keep it up do date. Maybe do a repo and go full-debian on.
Assuming you’ve built and copied the packages:
sudo apt install ./libtorrent36_0.16.6-1_amd64.deb ./rtorrent_0.16.6-1_amd64.deb
# Connect to the console with
sudo -u rtorrent tmux a
# Disconnect from tmux to leave it running with
Ctrl-b d
You probably want to link it to other tools, like sonarr. They don’t talk SCGI, so you’ll need a proxy. Lightty is an easy way to do that.
sudo apt install lighttpd
sudo vi /etc/lighttpd/conf-available/10-rtorrent.conf
server.modules += ( "mod_scgi" )
scgi.server = (
"/RPC2" =>
( "127.0.0.1" =>
(
"socket" => "/home/user/rtorrent/rpc.socket",
"check-local" => "disable",
"disable-time" => 0, # don't disable SCGI if connection fails
)
# YOU MUST ADD SOME KIND OF AUTH
)
)
or possibly
"host" => "127.0.0.1",
"port" => 8080,
sudo lighty-enable-mod rtorrent
sudo systemctl restart lighttpd
You can test with a curl or xmlrpc (though you may need to add the latter)
curl -H "Content-Type: text/xml" --data "<?xml version='1.0'?><methodCall><methodName>system.listMethods</methodName></methodCall>" http://127.0.0.1/RPC2
xmlrpc tpub/RPC2 system.listMethods
1.2 - Transmission
Transmission is a very clean and easy to use client. It runs efficiently and includes a web interface. The only downside is under heavy load it suffers performance issues. Say over a hundred torrents and a thousand connections.
But for casual use, it’s my preferred client.
Installation
sudo apt install transmission-daemon
Notes on Use
One note about installing transmission; make sure to stop the service before editing the config file. It will replace your settings with it’s running settings when it exits, otherwise.
sudo apt install transmission-daemon
sudo service transmission-daemon stop
sudo vim /etc/transmission-daemon/settings.json
"dht-enabled": false,
"rpc-whitelist": "127.0.0.1,192.168.*.*",
"peer-limit-global": 960,
"peer-limit-per-torrent": 288,
"preallocation": 2,
"rename-partial-files": false,
"watch-dir": "xxxxx",
"watch-dir-enabled": true
# Legacy setting not needed anymore
"max-peers-global": 960,
Most systems will require adjustment of the iptables firewall, should you be using such, for both the web admin port and the torrent traffic port. If you’re using something other than the standard port, adjust to suit. If you’re using random ports, you may want to open a range.
# The web admin port is tcp 9091 and peer traffic is 51413 tcp/udp by default
sudo iptables -A INPUT -p tcp -s 192.168.1.1/24 --dport 9091 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
sudo iptables -A INPUT -p tcp --dport 51413 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
sudo iptables -A INPUT -p udp --dport 51413 -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
Should you have a router and NAT tranmission will use upnp to forward the appropriate ports. You can also check out upnpc for manipulating that device manually or via script.
If you’re using a VPN you may want to restrict traffic to that connection. You can configure transmission for that. Disable the transmission server so that you can start it as part of the VPN service.
sudo systemctl disable --now transmission-daemon
Here’s an example using PIA. Note: This may be somewhat dated at this point.
# These are not your normal credentials. Even though you may be using wireguard, set them up under the openvpn service.
# Get these and the client ID from their website support section
USER=xxxx
PASS=xxxxx
CLIENT_ID=xxxxx
IP=$(ip -o -4 addr list tun0 | awk '{print $4}')
PORT=$(curl -d "user=$USER&pass=$PASS&client_id=$CLIENT_ID&local_ip=$IP" https://www.privateinternetaccess.com/vpninfo/port_forward_assignment | grep -o '[0-9]\+')
echo $IP $PORT
# Just in case it's already running
sudo service transmission-daemon stop
sudo sed -i "s/bind-address-ipv4.*/bind-address-ipv4\": \"$IP\",/" /etc/transmission-daemon/settings.json
sudo sed -i "s/peer-port\".*/peer-port\": $PORT, /" /etc/transmission-daemon/settings.json
sudo iptables -A INPUT -i tun0 -p tcp -m tcp --dport $PORT -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
sudo iptables -A INPUT -i tun0 -p udp -m udp --dport $PORT -m conntrack --ctstate NEW,ESTABLISHED -j ACCEPT
sudo service transmission-daemon start