Get Your Free Subscription By Email:

Installing, Configuring and Using Raspberry Pi as a Torrent Downloading Server

BitTorrent is without a doubt the most popular file-sharing method out there, Peer-2-Peer (P2P) torrent downloading requires a computer which runs a torrent downloading client to fetch content from other users sharing it. Torrent downloading can be slow as speeds depends on swarm sharing the content, this means you need to have your computer powered-on consuming electricity. Luckily, we can now use our ultra-cheap Raspberry Pi to get the job done 24x7 - consuming just 5w of power.

After completing the basic setup of the Raspberry Pi, networking it to internet, attaching an external HDD and configuring it to work as an Network Attached Storage (NAS) we all all set to install the cross-platform Transmission Torrent Client of the RasPi to get our cheap seedbox working.

Transmission torrent cleint web-interface from Raspberry Pi

Steps to install and configure Transmission on Raspberry Pi :

  1. Install Transmission using sudo apt-get install transmission-daemon.
  2. Create folders for downloading content :

    mkdir -p /home/pi/incomplete # for incomplete downloads
    mkdir /home/pi/complete # finished downloads

  3. Configure proper permissions for transmission :


    sudo usermod -a -G debian-transmission pi
    chgrp debian-transmission /home/pi/incomplete
    chgrp debian-transmission /home/pi/complete
    chmod 770 /home/pi/incomplete
    chmod 770 /home/pi/complete

  4. Now, reload transmission daemon - sudo service transmission-daemon reload
  5. Edit transmission settings.json file using sudo nano /etc/transmission-daemon/settings.json and use following settings.
  6. {
    "alt-speed-down": 50,
    "alt-speed-enabled": false,
    "alt-speed-time-begin": 540,
    "alt-speed-time-day": 127,
    "alt-speed-time-enabled": false,
    "alt-speed-time-end": 1020,
    "alt-speed-up": 50,
    "bind-address-ipv4": "0.0.0.0",
    "bind-address-ipv6": "::",
    "blocklist-enabled": false,
    "blocklist-url": "http://www.example.com/blocklist",
    "cache-size-mb": 4,
    "dht-enabled": false,
    "download-dir": "/home/pi/complete",
    "download-limit": 100,
    "download-limit-enabled": 0,
    "download-queue-enabled": true,
    "download-queue-size": 5,
    "encryption": 1,
    "idle-seeding-limit": 30,
    "idle-seeding-limit-enabled": false,
    "incomplete-dir": "/home/pi/incomplete",
    "incomplete-dir-enabled": true,
    "lpd-enabled": false,
    "max-peers-global": 200,
    "message-level": 2,
    "peer-congestion-algorithm": "",
    "peer-limit-global": 91,
    "peer-limit-per-torrent": 150,
    "peer-port": 51413,
    "peer-port-random-high": 65535,
    "peer-port-random-low": 49152,
    "peer-port-random-on-start": false,
    "peer-socket-tos": "default",
    "pex-enabled": false,
    "port-forwarding-enabled": true,
    "preallocation": 1,
    "prefetch-enabled": 1,
    "queue-stalled-enabled": true,
    "queue-stalled-minutes": 30,
    "ratio-limit": 2,
    "ratio-limit-enabled": false,
    "rename-partial-files": true,
    "rpc-authentication-required": true,
    "rpc-bind-address": "0.0.0.0",
    "rpc-enabled": true,
    "rpc-password": "{2dc2c41724aab07ccc301e97f56360cb35f8ba1fGVVrdHDX",
    "rpc-port": 9091,
    "rpc-url": "/transmission/",
    "rpc-username": "transmission",
    "rpc-whitelist": "*.*.*.*",
    "rpc-whitelist-enabled": false,
    "scrape-paused-torrents-enabled": true,
    "script-torrent-done-enabled": false,
    "script-torrent-done-filename": "",
    "seed-queue-enabled": false,
    "seed-queue-size": 10,
    "speed-limit-down": 250,
    "speed-limit-down-enabled": true,
    "speed-limit-up": 0,
    "speed-limit-up-enabled": true,
    "start-added-torrents": true,
    "trash-original-torrent-files": false,
    "umask": 18,
    "upload-limit": 100,
    "upload-limit-enabled": 0,
    "upload-slots-per-torrent": 14,
    "utp-enabled": true
    }

  7. After saving the settings, reload and restart transmission daemon.


    sudo service transmission-daemon reload
    sudo service transmission-daemon restart

  8. You are all set to access the web-interface to control your Transmission client remotely, just point your web-browser to http://RASPI.IP.ADDRESS:9091/ and use the login/password (default for above config transmission/transmission) combination inside settings.json to login.
  9. My router supports DynamicDNS (DDNS) and it can be used to control your torrent client from anywhere in the world over internet (as shown in image above).

This setup worked fine for some time but resulted in frequent hangs if left running for longer periods. To solve the RaspberryPi Kernel panic issue when using transmission downloading make the following changes and reboot your RasPi :

  1. Edit /boot/cmdline.txt and add “smsc95xx.turbo_mode=N” to it.
  2. Edit /etc/sysctl.conf and change “vm.min_free_kbytes =16384″ (from 8MB to 16MB).

Once torrents are downloaded, they can be accessed over the network via a Samba share. Make sure to create a new public share to your transmission completed download directory (/home/pi/complete) using the instructions provided earlier and have it accessed easily from the RasPI NAS.

Comments

Great Aricle. Manage to get it working! However, I have a query, I have NAS setup on our server and would like to save my torrents to the server.

When I edit;

"download-dir": "/home/pi/complete",

to

"download-dir": "\\wilma\torrents",

sudo service transmission-daemon reload
sudo service transmission-daemon restart

It seems I can no longer connect and when I check the script, it changes to default. Can you please advice?

You have entered the wrong backslash's (front and back), it should be :

"download-dir": "//wilma/torrents",

I can't delete the downloaded files on the /complete folder. Need permission from debian-transmission. What do I do?

Login as root and change the folder and file permissions to 777, also chnage the umask value in settings.json to 0 so all new files are world-writable.

Hi,

I just tried to dowload a file, and I'm getting this error below:

Error: Unable to save resume file: No space left on device

Note: I have Specified it to save to "download-dir": "/media/ExternalHd/download/complete", (Which is my 500GB External Disk)

I'm able to browse to my Hard disk via Windows and I know Samba is working.

I'm not sure how to solve this, I read somewhere and I think it is something to do with root tmp file.

http://www.acryan.com/forums/viewtopic.php?f=98&t=7986

I tried the steps at the link above, no luck.

Any ideas?

Hi,
When I try to download something, the download speed is very unstable. It reaches ~400kbps then goes down to zero, every 2~3 seconds. I have looked at the router's bandwidth page, transmission remote GUI and transmission web, all show the same unstable speeds. I tried limiting the download/upload speed, changing the global no. of peers, changing the cache to 8 Mb. Even when I limit the download speed to ~50kbps, the speed reaches ~60kbps then down to zero every 2~3 seconds. I even tried connecting my USB 3.0 HDD to no avail. Can you help?

you should install and use aria2, a much better download accelerator for raspberry pi - http://www.megaleecher.net/taxonomy/term/13680

hi,
how can i configure Transmission to use a proxy for the internet connection? (proxy that requires Username + Password)

How can I move downloaded files to a different computer automatically? Like I want the Pi to download and them move to another computer which acts as a media server.

a). You can use the MiniDLNA (Tutorial for Raspberry Pi- http://www.megaleecher.net/DLNA_Streaming_From_Raspberry_Pi) or MediaTomb as a MediaServer without needing the other server.

b). Use some sort of script to get files moving as intended, this will help you out - http://forum.qnap.com/viewtopic.php?p=301145

Thanks for the step-by-step instructions, worked like a charm within 5 minutes from opening terminal.

Hi,
First of all, thanks for the wonderful tutorial. I have some questions, i am getting download rate <30kbps and it fluctuates from 0 to ~30kbps,do you have any comment?. ALso, why is the upload rate is set to 0?

Thanks

After trying everything, I settled for excellent aria2c download manager - http://www.megaleecher.net/aria2_For_Raspberry_Pi. Give that a try.

Any suggestion on how to use it with magnet links? Piratebay (for example) has magnet links but not .torrent file.

Add new comment

This is just one of the many helpful tips we have posted, You can find more stories here,
Do subscribe to updates using your favorite RSS feed reader or using the secure FeedBurner email update form on top of this post.