3. Torrent Server

by HobbyGenius VIP on May 14, 2014 at 1:50 am | 0 comments.


In this tutorial we will be setting up the Raspberry Pi to run as a torrent server. Raspberry Pis are small, cheap, powerful but most importantly, they consume very little power compared to a normal computer. As a result they can function very well when they are always on and can be used as a very modest server.

We recommend you allow remote access so that you can tuck your RPi somewhere nice and secluded and then only connect to it when you need to tweak something. This will reduce the space required since you won’t need a screen, mouse and keyboard connected.

Although it’s not required, we recommend following tutorial 2 so that you can transfer files to the RPi across your local network. Again this means we can leave it tucked away somewhere.

Transmission

We will be installing a program called Transmission which will be the actual torrent server. It is easy to use and has a web interface which we can use to give us a more simple way of accessing all the settings.

Start by opening your Raspberry Pi’s terminal (or connecting to it via SSH) and type in sudo apt-get install transmission-daemon

Install Transmission

Install Transmission

Enter y when prompted if you want to install it and wait until it’s finished.

We now need to configure Transmission so we will need to stop the server before we continue. We can do this by typing in sudo service transmission-daemon stop

Stop Transmission Service

Stop Transmission Service

Adding Folders

Now that we have Transmission installed we need to setup where our files will be stored. In this tutorial we will be using the local storage on the SD Card: so enter mkdir /home/pi/Torrents (replace pi if you are using another user) which will create a new folder in your home directory.

We now need to configure Transmission to have access to these files. When we installed it, a new user was created called debian-transmission and we must first add this to our user group. Do this by entering sudo usermod –a –G users debian-transmission

Next we need to make this user the owner of our Torrents folder: enter sudo chown debian-transmission /home/pi/Torrents

If want to make sure everything was successful type in ls -l /home/pi and your folders will be listed along with who the owner is

Make Transmission the Owner of Torrents

Make Transmission the Owner of Torrents

Configuring Samba

If you installed Samba to access your files remotely then we will need to configure it. Type in sudo nano /etc/samba/smb.conf to edit the Samba config file and navigate down to the Share Definitions section. We will be creating a new share that links to our torrents folder. Add the following just above the [homes] line:

[Torrents]
comment = RPi Torrent Storage
path = /home/pi/Torrents/
browseable = yes
public = yes
writeable = yes
guest ok = yes

Add Torrents Share

Add Torrents Share

We can now save and close, by entering CTRL-X and typing y. Type in sudo service samba restart to restart Samba and you will now be able to see Torrents on other computers.

Torrents Share

Torrents Share

Configuring Transmission

We now need to configure Transmission. First type in sudo nano /etc/transmission-daemon/settings.json

Disable Whitelist Only

Disable Whitelist Only

Scroll down to “rpc-whitelist-enabled” and change it to false. In doing this we enable any computer to connect to Transmission not just the whitelist (which only consists of the local user).

We next need to specify the download directory, so scroll up to the “download-dir” line and change it to equal your Torrents folder:

Change Download Folder

Change Download Folder

Finally we need to add some security so that only users can add new torrents. Go to the “rpc-authentication-required” line and ensure it reads true, then define a password on the “rpc-password” line.

Add Some Security

Add Some Security

Save the file and exit (CTRL-X) and we can then start Transmission by typing in sudo service transmission-daemon start

Note that the settings.json file can only be edited whilst the service is stopped.

Once done you can open up the Transmission web interface by typing in your computer’s IP Address into your browser followed by the Transmission port (eg: http://192.168.1.115:9091).

Enter Username and Password

Enter Username and Password

We can now use the Transmission interface to control our Torrent Server:

Transmission Web Interface

Transmission Web Interface