Deluge howto for pets
2026-04-03
Pet longed for a headless torrent client. Previously it used Transmission but humans broke it. Sorting no longer works, progress bars no longer work, they are refreshed only after restart. It was a time to replace it.
Unfortunately, Deluge is not trustworthy too. Although the underlying bittorent library is written in a holy language, Deluge itself is written in Python, and all the Python flaws pop up and shine:
- With only a few seeds the CPU load does not drop below 25%.
- With six hundreds torrents the load is 100% and the only CPU core is used. It does not scale up.
A good thing is memory consumption which is quite low.
Anyway, it leaks in deluge-web and this service needs daily restarts.
deluged simply stucks from time to time and also needs daily restarts.
So, in the absense of better tools Deluge is better than Transmission.
Requirements
Pet needed two Deluge instances on two machines: private and public. The public instance is installed on the host system, the private one runs in a container on another machine. The container is connected with a host in DMZ via tunnel. The traffic is allowed to flow only via tunnel so the private network cannot be seen from the container. That's not the best solution in terms of security, but it's okay for now. The best one would require a host behind a dedicated router with the exit point somewhere far far away. Pet does not share any critical data that would require such precautions.
Installation
It's simple:
apt install deluged deluge-webDeluge has no init scripts and that's a huge advantage: less crap in the system.
Pet creates runit services:
/etc/sv/deluged/run:
exec 2>&1
if [ -e /etc/runit/verbose ]; then
echo "invoke-run: starting ${PWD##*/}"
fi
exec /usr/bin/python3 /usr/bin/deluged -U debian-deluged -g debian-deluged \
-d -c /var/lib/deluged -L warning -l /var/log/deluged/daemon.log/etc/sv/deluge-web/run:
exec 2>&1
if [ -e /etc/runit/verbose ]; then
echo "invoke-run: starting ${PWD##*/}"
fi
exec /usr/bin/python3 /usr/bin/deluge-web -U debian-deluged -g debian-deluged \
-d -c /var/lib/deluged -L warning -l /var/log/deluged/web.logPet creates a directory for logs:
mkdir /var/log/deluged
chown debian-deluged:debian-deluged /var/log/delugedThe directory /var/lib/deluged/Downloads should be either created manually or symlinked
to an existing location.
Pet used both options, and in the container it mounted another disk to it.
Deluge creates the default configuration on the first run, so launch services:
ln -s /etc/sv/deluged /etc/service/
ln -s /etc/sv/deluge-web /etc/service/Pet gave them some time, waited for config in /var/lib/deluged, and then stopped.
Configuration
The configuration needed only a couple tweaks.
First, auto-connect was enabled as described in FAQ https://deluge-torrent.org/faq/
Second, pet changed listening port.
All the rest was done via web interface and is not worth mentioning here.
Importing existing torrents
https://forum.deluge-torrent.org/viewtopic.php?t=55304
The best way for pet was enabling AutoAdd plugin. It needs some directory
mkdir /var/lib/deluged/autoadd
chown debian-deluged:debian-deluged /var/lib/deluged/autoaddPet made sure torrents are added in paused state. But before adding, the data must already exist in the Downloads directory.
Quirks
Pet was unable to set web port to 80. Why? The service is started as root, they could open this port before dropping privileges.
After adding, torrent filenames get changed in the state dir.
Why? That sucks.
Pet should have checked "Save torrent files to Downloads dir" to keep them.