Setting up a Torrent Server

From SingletonMillerWiki
Revision as of 04:01, 16 June 2013 by Martin (Talk | contribs) (Reference)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

This is a guide for setting up a torrent server on the Raspberry Pi using Deluge.

Basic Installation

Note. When doing this installation I found it best to do it from the account you want the deluge-daemon to be run from.

Install the deluge daemon and web interface. At the time of writing this installs deluge 1.3.3 and has been tested using Raspbian Wheezy '2013-02-09-wheezy-raspbian':

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

Follow the instructions at [1] to setup the start scripts and torrent logging. You can run the deluge-daemon using a user already on the Raspberry Pi or create a new user. Don't forget to edit the /etc/default/deluge-daemon file to point to the user account you want to use.

Ensure DELUGED_USER="" is a real user on your system, this is because deluge needs to write some configuration files to /home/<DELUGED_USER>/.config/deluge. If you haven't added newer users AddingUsers:RPi to your RPi, you'll want to use "pi".

Windows Users

If you create the startup scripts on a Windows machine and then copy them onto the Raspberry PI you will have to run it through dos2unix to get the text file into a linux format. If you don't do this the script won't run (spent a good couple of hours puzzling over this one)

To install dos2unix:

sudo apt-get install dos2unix

Make sure that both scripts are owned by root and have the correct permissions:

sudo chown root:root /etc/default/deluge-daemon
sudo chmod 644 /etc/default/deluge-daemon

sudo chown root:root /etc/init.d/deluge-daemon
sudo chmod 755 /etc/init.d/deluge-daemon

Thin Client Setup

Deluge can be setup so that you can control the deluge daemon from a number of different clients. This can be done either by a Web Interface or the GTK UI.

Note: Both the client and the server need to be similar versions, i.e. both 1.2.x or both 1.3.x.

Web Interface

  • Open up a web browser and go to the following address (need to change the IP address to match your RPi)
The password is deluge.

You can configure deluge via the web interface or the GTK interface. You will need to setup the file locations for completed torrents and also a directory to place torrents for the server to download.

For some reason the IPBlocker cannot be setup using the Web Interface (don't know why). For this you will need to use the GTK interface (see below). Before setting up the GTK client the daemon needs configuring to allow remote connections.

Using the Web Interface go to:

Preferences->Daemon->Allow Remote Connections

Click 'Apply' to save the settings.


Server Setup

Add a user and password to the authentication file (this does not have to be your server's user/pass)/

echo "username:password:level" >> ~/.config/deluge/auth

where "username" and "password" are the username and password you intend to use and "level" is your desired authentication level.

for authentication levels look here

Restart the deluge daemon

sudo service deluge-daemon restart
Client Setup on a Windows Machine

Download and install the Windows client from here. Make sure you select the same version as the daemon installed on the RPi.

  • Run deluge.
  • Go to "Preferences -> Interface" and untick 'Classic Mode' to disable it.
  • Restart deluge. You should now see the Connection Manager pop up.
  • Remove the localhost daemon.
  • Click "Add" and for 'Hostname' enter your server's IP.
  • Leave the Port as default (58846).
  • Enter the Username & Password you added to the authentication file then finish by clicking 'Add'. A green tick should now appear as the status for the host you just added.
  • (Optional) Expand "Options" and select "Automatically connect to selected host on startup" and "Do not show this dialog on start-up".
  • Click "Connect" and the connection manager pop up box should disappear.

IP Filter Setup

Image of IPFilter setup
  • Start the GTK UI
  • Go to "Preferences -> Plugins" and tick the 'Blocklist'.
  • The 'Blocklist' will appear as a tab on the left hand side. Select this.
  • Tick 'Import blocklist on startup' and then click 'Check Download and Import'.
  • This will download the IPFilter from the URL listed in the box.

To Do List

  • Execute Plugin (Will allow you to run commands on certain events) - could be useful.
  • RSS Reader