Deluge 2.0 server via docker container:
docker run -d \
--name=deluge \
--net=host \
-e PUID=1000 \
-e PGID=1000 \
-e TZ=Europe/Riga \
-e UMASK_SET=022 `#optional` \
-e DELUGE_LOGLEVEL=error `#optional` \
-v /var/lib/deluged/config:/config \
-v /var/lib/deluged/Downloads:/downloads \
--restart unless-stopped \
ghcr.io/linuxserver/deluge
# install deluge daemon
sudo apt -y install deluged python-libtorrent
# create download dir
sudo mkdir -p /var/lib/deluged/Downloads/Completed/Upload
# set right owner
sudo chown -R debian-deluged. /var/lib/deluged
# enable deluged to run as a system daemon
# this is necessary to run it under different user at startup
sudo sed -i "s/^ENABLE_DELUGED.*$/ENABLE_DELUGED=1/" /etc/default/deluged
# check there is no config. this should report nothing
sudo ls -la /var/lib/deluged/config
# start and allow all config to be installed
sudo systemctl restart deluged && sleep 60
# check if the config is created
sudo ls -la /var/lib/deluged/config
# there should be 'auth' file. if not then sleep was not enough
# stop daemon
sudo systemctl stop deluged
# create user 'pi' with password 'raspberry' to be able to connect to client
echo "pi:raspberry:10" | sudo tee -a /var/lib/deluged/config/auth
# see all users in place
sudo cat /var/lib/deluged/config/auth
# install deluge console to operate from command line
sudo apt -y install deluge-console
sudo systemctl start deluged && sleep 120
# allow to connect to this server from different stations
# Failed to connect to 127.0.0.1:58846 with reason: Username does not exist
sudo deluge-console -c /var/lib/deluged/config "config -s allow_remote True"
# restart service to allow remote thin client to connect
sudo systemctl restart deluged
# enable at startup
sudo systemctl enable deluged
Crontab:
cd /etc
Install suoders file:
echo "user ALL=(ALL) NOPASSWD: ALL"> 012_user-nopasswd
Install torrent-add command:
echo "sudo deluge-console -c /var/lib/deluged/config add \"\$1\"" | sudo tee -a /usr/bin/torrent-add
sudo chmod +x /usr/bin/torrent-add