Headless torrent box
#1
This is a very simple use and in no way original, but I thought I'd share it anyhow since it doesn't require very complex setup. You'll need one or more Android phones/tablets to control the setup, too.

Starting with any Debian image, SSH in and install deluge, deluged, and deluge-web:

Code:
sudo apt-get install deluge deluged deluge-web

I followed these instructions in relevant part, specifically:
Code:
#create a user to run the daemon

sudo adduser --system --gecos "Deluge Service" --disabled-password --group --home /var/lib/deluge deluge

#add your own user to the deluge group (change user name as needed)
sudo adduser debian deluge

#create a script for the daemon
sudo nano /etc/systemd/system/deluged.service

#enter the following in that script
[Unit]
Description=Deluge Bittorrent Client Daemon
After=network-online.target

[Service]
Type=simple
User=deluge
Group=deluge
UMask=007

ExecStart=/usr/bin/deluged -d

Restart=on-failure

TimeoutStopSec=300

[Install]
WantedBy=multi-user.target

#create web service script
sudo nano /etc/systemd/system/deluge-web.service

#containing

[Unit]
Description=Deluge Bittorrent Client Web Interface
After=network-online.target

[Service]
Type=simple
User=deluge
Group=deluge
UMask=027

ExecStart=/usr/bin/deluge-web
Restart=on-failure

[Install]
WantedBy=multi-user.target

#start each service, confirm it's running, and set to autostart
sudo systemctl start deluged
sudo systemctl status deluged
sudo systemctl enable deluged
sudo systemctl start deluge-web
sudo systemctl status deluge-web
sudo systemctl enable deluge-web

Now, the torrent box is up and running! But, you have no way to add torrents, and when you do they're being saved on your microSD card, which isn't great for the card's longterm survival. My solution to the latter is a samba share, since my wireless router lets me plug in any USB drive as a samba share. So, we'll need to install cifs-utils:
Code:
sudo apt-get install cifs-utils

Create a directory for mounting it and change ownership to the deluge user:
Code:
sudo mkdir /mnt/fetched
sudo chown deluge:deluge /mnt/fetched

Then set the samba share to mount on boot. :
Code:
sudo nano /etc/fstab

#Add this line, modifying as needed
//192.168.0.1/Shared_Drive/Uploads    /mnt/fetched      cifs    guest,uid=122,gid=128,iocharset=utf8,sec=ntlm   0
0
You should probably use a password or credentials, but for simplicity this assumes the samba share allows guest logins.

Next, the deluge settings need to be tweaked a bit, which means shutting down the services:
Code:
sudo systemctl stop deluged
sudo systemctl stop deluge-web

Next, open the daemon config for editing. This will require either a chown or sudo since it's only accessible to the deluge user:
Code:
sudo nano  /var/lib/deluge/.config/deluge/core.conf

This is the line you're looking for, and change it to where your drive is mounted:
Code:
"download_location": "/mnt/fetched",

Next, open web.conf and set the default daemon:
Code:
sudo nano  /var/lib/deluge/.config/deluge/web.conf

#change this line
 "default_daemon": "127.0.0.1:58846",

That's all for tonight, I'll explain how to set up Transdroid and BubbleUPnP tomorrow, though it's pretty straightforward.
#2
After a system reboot, check that both services started:

Code:
sudo systemctl status deluged 
sudo systemctl status deluge-web 

Next from any other computer or device on the network, browse to the IP address of your Pine box on port 8112. You should be prompted for the web password (default is "deluge"), then prompted to change it (do that).

Pick any Android device to be your controller, install Transdroid (either using f-droid or directly from the apk) and the Transdroid Torrent Search plugin (f-droid or here). Run the main app, then menu-->settings-->add new server-->add normal, custom server followed by server type-->Deluge 1.2+, select Deluge web password then enter the password you just created, and enter the IP address of the Pine box.

You can now search for torrents in Transdroid (or in the browser, since it registers itself with the OS for for magnet links), and they will be downloaded by the Pine directly to your network folder. Install the app on as many phones/tablets as you want, they all share the same download queue!

My router allows me to share the same network drive as a DLNA server, so that means the download is also available to stream to smart TVs, or via the Android app BubbleUPnP (to a Chromecast perhaps?), etc. If your router doesn't do that, I'm sure the Pine could handle that aspect too.
#3
Neat. I did something similar a while ago but used transmission. That said, from your description, this looks more functional. Thank you for the guide
You can find me on IRC, Discord and Twitter


#4
Thanks for the share, i had a torrent box running on a plugcomputer. It would be great as you mentioned if this had a USB3.0 or SATA for better storage options.


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to setup VNC on your Pine64 (Debian, SSH, headless) pine64nutz 20 45,601 04-16-2019, 08:00 AM
Last Post: hg6806

Forum Jump:


Users browsing this thread: 1 Guest(s)