Headless torrent box - Printable Version

+- PINE64 (
+-- Forum: PINE A64(+) (
+--- Forum: Pine A64 Projects, Ideas and Tutorials (
+--- Thread: Headless torrent box (/showthread.php?tid=1167)

Headless torrent box - wahdooyah - 05-25-2016

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:

sudo apt-get install deluge deluged deluge-web

I followed these instructions in relevant part, specifically:
#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
Description=Deluge Bittorrent Client Daemon


ExecStart=/usr/bin/deluged -d




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


Description=Deluge Bittorrent Client Web Interface




#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:
sudo apt-get install cifs-utils

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

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

#Add this line, modifying as needed
//    /mnt/fetched      cifs    guest,uid=122,gid=128,iocharset=utf8,sec=ntlm   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:
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:
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:
"download_location": "/mnt/fetched",

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

#change this line
 "default_daemon": "",

That's all for tonight, I'll explain how to set up Transdroid and BubbleUPnP tomorrow, though it's pretty straightforward.

RE: Headless torrent box - wahdooyah - 05-26-2016

After a system reboot, check that both services started:

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.

RE: Headless torrent box - Luke - 05-27-2016

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

RE: Headless torrent box - superboxf1 - 07-07-2016

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.