Torrent Server on Raspberry Pi

4 minutes read

I hope that you are aware of Raspberry Pi and have a working Raspberry with Raspbian installed. Now let us make a headless torrent server. This will run 24*7 so that you can download large files without keeping you desktop or laptop powered on.

If you are not aware of Raspberry Pi, then please check the blog “What is Raspberry Pi ?” and then to install OS(Raspbian) on Raspberry Pi check the blog “Starting/Booting Raspberry Pi“. You may also purchase a new Raspberry Pi(Purchase single unit or full package[recommended]) from amazon.

Torrents

A torrent file and torrent system is a peer to peer sharing, that means we share files between PC’s all around the world. The files are not downloaded from a specific server although there may be some servers which participate in the peering system as well.

As there is no centralized system, therefore no issues such as outage.We will never have to worry about the availability of the files until there is a good support from the peers. Surprisingly torrents are very popular and today we can download any type of files from the torrents (eg-; movies, softwares, songs, etc).

Note :- Piracy is very popular among torrents, hence you should be well aware about the files which you download.

Deluge – Opensource Bit-torrent client

 

Deluge is an application which downloads the torrent files for us. I have chosen Deluge for this task as it is Free, gives multi-platform support and is the oldest in the community.

Note :- We are going to install the deluge daemon on our raspberry pi, which would act as a back-end headless server. The main GUI application would be installed on your PC, Mac or laptops.

1.We start by updating the repositories.

sudo apt-get update && upgrade

2.Now install deluge deamon and deluge console.

sudo apt-get deluged deluge-console

3.After the deamon installation add user to the auth file.

Note:- Before the following step run the deluged deamon once and then kill it. This will create the following file.

deluged

sudo pkill -9 deluged
cp ~/.config/deluge/auth ~/.config/deluge/auth.old #backing up your file
sudo nano ~/.config/deluge/auth

4.Now in the file add you user.

localclient:636f2c7795e123cd5385349057c64da0d8311a29:10 pi:raspberry:10 #<user-name>:<password>:<level-of-authorization>

5.Now we should restart the deluged daemon and the deluge console to allow remote access.

deluged
deluged deluge-console

6.On console enter the following.

config -s allow_remote True 
config allow_remote 
exit

At this point, your Deluge daemon is ready for remote access. Head to your normal PC (not the Raspberry Pi) and install the Deluge desktop program. You’ll find the installer for your operating system on the Deluge Downloads page. Once you’ve installed Deluge on your PC, run it for the first time; we need to make some quick changes.

Once launched, navigate to Preferences > Interface. Within the interface submenu, you’ll see a checkbox for “Classic Mode”. By default it is checked. Uncheck it.

Click OK and then restart the Deluge desktop client. This time, when Deluge starts, it will present you with the Connection Manager. Click the “Add” button and then input the IP address of the Raspberry Pi on your network, as well as the username and password you set during the earlier configuration. Leave the port at the default 58846. Click Add.

Back in the Connection Manager, you’ll see the entry for the Raspberry Pi; if all goes well, the indicator light will turn green like so:

Click Connect, and you’ll be kicked into the interface, connected to the remote machine:

 

 

—————————————————————————————————————————————–

Now download and open up your deluge client on your primary machine and go to

Preferences ->Deamon -> Check "Allow Remote Connection"

This will enable your raspberry deluge to use remote connection.

You can also use your deluge from your browser. This will work good for your iOS and Android devices. The are many application that may also support remote connection but browsers are universal tool. If you do not want to install deluge client on your main machine you can always work through by the browser.

On you Raspberry Deluge application go to

Preferences -> Plugin -> check "WebUI"

Now go to

Preferences -> WebUI -> check "Enable web interface"

Close deluge application on your raspberry pi and go to command line.

Type in the following commands

sudo kill deluged

deluged

Now you have two ways to run deluge thin-client, add torrent from your main machine or mobile and the download will be done on your raspberry pi.

 

First: Using the Web UI.

Launch deluge application in your Raspberry pi.

Open you browser and type

<your ip address(eg-:192.168.1.5)>:<port number(default is 8112)>

Add torrents to download on raspberry pi and close you browser as soon as done. Your will be downloaded on raspberry pi.

 

Second: Using deluge application on you windows, Mac machines.

Download and install deluge application from http://deluge-torrent.org

Open up your application and go to

Preferences -> Interface -> Uncheck "Classic Mode : Enable"

Restart your application and you will get a connection pop-up

Enter your ip address in Host:192.168.1.5

Username:pi

password:raspberry

Note: I have used the username and password as given in the auth file earlier. Please scroll up to check.

Now click on add button.

If it turns green click connect and start using your torrent client.

If it is red and not turning green, please go through this final extra step.

Open up terminal and type

sudo kill deluged

deluged

Note : Do not start deluge client on your raspberry pi by GUI in this method. It will not work.

Now enjoy your Torrent Box.

For more clarifications i will upload a video soon.

 

Start Deluge server automatically on boot.

This is most important as in particular situations if our Linux server gets shutdown due to power cut or regular restart. We have to launch our deluged server manually. To eradicate this problem let us follow the following steps.

Create the file /etc/systemd/system/deluged.service

sudo nano /etc/systemd/system/deluged.service

Now enter the following information into your file. Please replace the user respectively.

[Unit]

Description=Deluge Bittorrent Client Daemon

Documentation=man:deluged

After=network-online.target

[Service]

Type=simple

User=shashank

Group=shashank

UMask=007

ExecStart=/usr/bin/deluged -d

Restart=on-failure

# Time to wait before forcefully stopped.

TimeoutStopSec=300

[Install]

WantedBy=multi-user.target

Please enter the following commands after creating the above file. This will start the service and deluge will launch automatically on boot.

sudo systemctl enable /etc/systemd/system/deluged.service

sudo systemctl start deluged

sudo systemctl status deluged

 

Stay Anonymous

Login to the following website. Choose any one server and enter the IP of the proxy server into your deluge client. This would help you to stay a little bit anonmous.

http://www.idcloak.com/proxylist/free-proxy-servers-list.html

Input Proxy
Input Proxy

OR

You may choose a Onion network.

OR

Use a VPN service

One Reply to “Torrent Server on Raspberry Pi”

  1. excellent read will deffo recommend this site. George all the way from Ireland http://www.leafletpost.ie

Leave a Reply