Social Icons

How to install Transmission on Raspberry Pi (with external storage)


Well there are already many guides on this topic, however, what I found is not all are in complete detail, or misses out on something of the other (completely personal opinion though :) ). Here comes my guide to install Transmission BitTorrent client on headless Raspberry Pi. This will especially be helpful for users who have followed my guides on setting up NAS drive with RasPi.

Let's Start...

Step 1
Install transmission
sudo apt-get update
sudo apt-get install transmission-daemon

Step 2
Create required directories on your NAS storage (path to storage is assumed as /media/NASDRIVE)
mkdir -p /media/NASDRIVE/Torrent_inprogress
mkdir -p /media/NASDRIVE/Torrent_complete

Step 3
Permissions
Transmission by default runs with user "debian-transmission", as it is recommended not to change this due to security reasons. In our setup the NASDRIVE has the permission set as 770 for pi : pi. Thus we will add user "debian-transmission" to "pi" group to give rwx access on our NASDRIVE. You can go ahead and modify this step as per your security requirement, but just make sure your torrent download directories are having rw access for "debian-transmission" user.
sudo usermod -a -G pi debian-transmission

Step 4
Configure Transmission
While most of the parameters are self explanatory in the conf file, you can use the file given below, except for modify the parameters download-dir, incomplete-dir, rpc-username, rpc-password 
Note: rpc-password will automatically converted to hashstring on saving the file
sudo nano /etc/transmission-daemon/settings.json

{
"alt-speed-down": 15,
"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": 15,
"bind-address-ipv4": "0.0.0.0",
"bind-address-ipv6": "::",
"blocklist-enabled": true,
"blocklist-url": "http://list.iblocklist.com/?list=ydxerpxkpcfqjaybcssw&fileformat=p2p&archiveformat=gz",
"cache-size-mb": 4,
"dht-enabled": true,
"download-dir": "/media/NASDRIVE/Torrent_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": "/media/NASDRIVE/Torrent_inprogress",
"incomplete-dir-enabled": true,
"lpd-enabled": false,
"max-peers-global": 200,
"message-level": 2,
"peer-congestion-algorithm": "",
"peer-limit-global": 240,
"peer-limit-per-torrent": 60,
"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": true,
"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": "{46949fbf39bfeec6dc9d4bff9f40c3f52219a4260yk9yGNo",
"rpc-port": 9091,
"rpc-url": "/transmission/",
"rpc-username": "transmission",
"rpc-whitelist": "127.0.0.1",
"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": 100,
"speed-limit-down-enabled": false,
"speed-limit-up": 100,
"speed-limit-up-enabled": false,
"start-added-torrents": true,
"trash-original-torrent-files": true,
"umask": 7,
"upload-limit": 100,
"upload-limit-enabled": 0,
"upload-slots-per-torrent": 14,
"utp-enabled": true
}
view raw settings.json hosted with ❤ by GitHub

Step 5
Reload Transmission
Do not restart, It overwrites the configuration file in that case
sudo service transmission-daemon reload

Step 6
Open web browser and hit http://your_raspberry_pi_IP:9091
Enter the user id and password you've configured, and viola!

39 comments:

  1. your tutorial is incomplete, in the settings you should add a new whitelist rule and I can't find any default password on this page..

    ReplyDelete
    Replies
    1. If you can't figure that out on your own you probably shouldn't be doing this anyway honestly.

      Delete
    2. LOL. Only morons could say this tutorial is incomplete.

      Delete
  2. Step 3 is the best part! Thanks

    ReplyDelete
    Replies
    1. I much preferred step 7.5 to be honest

      Delete
  3. Is it possible to install an older version of transmission? The private tracker I use only allows version 2.03.

    ReplyDelete
    Replies
    1. It's an older stable version, you can find it here and probably have to compile and install it manually from here https://packages.debian.org/squeeze/transmission

      Delete
  4. nice tutorial. it rocks. have you tried the watch dir commands? i do need to have a folder where to put all the .torrent files and start automatically in transmission. unfortunatelly when i put the commands, transmission fails to start.

    ReplyDelete
  5. As soon as I try to start a torrent it downloads like 100Kb and then says: "Error: Permission denied /PATH/TO/DOWNLOADED/FILE.iso"
    Any Idea why that happens?

    ReplyDelete
    Replies
    1. Your permissions are not set correctly

      Delete
  6. Do this:
    'sudo nano /etc/ini.d/transmission-daemon'
    and change the user to 'root'

    ReplyDelete
  7. Default username and password is in the above config:

    "rpc-password": "",
    "rpc-username": "transmission",

    ReplyDelete
  8. Hey there;
    First of all thanks for this instruction, trying to learn how to install Transmission on raspbian. I got a question and will be pleased if somebody help. Please keep in your mind that I dont have any idea about linux commands and other things.
    So at Step 2, I want to create folders in a usb drive which has 16GB space as trial.
    I formatted it to ext4.
    When I write "mkdir -p /media/NASDRIVE/Torrent_inprogress" it gives me an error message:
    mkdir: cannot create directory /media/NASDRIVE/Torrent_inprogress : permission denied. How can I get this permission, please explain me step by step...

    ReplyDelete
    Replies
    1. Put "sudo" in front of it. "sudo" will give you admin privileges.

      Delete
    2. try
      sudo mkdir -p /media/NASDRIVE/Torrent_inprogress

      Delete
  9. Step 3 is fantasticly helpful - I followed a couple of other guides that never mentioned this bit and I had a whole host of issues - thank you!

    ReplyDelete
  10. Yunus,

    You have to type "sudo" before mkdir... in order to give yourself permissions. I'm not sure why that was left out of the guide.

    I keep getting the error "403: Forbidden" when trying to access transmission via the web browser. I'll keep trying.

    ReplyDelete
  11. transmission is not making /etc/transmission-daemon/settings.json. I have no idea what to do.

    ReplyDelete
  12. I did everything from this tutorial and it I'm still getting the permission denied error. I'm pretty new at linux but I'm trying to learn. Any help would be great. Thanks.

    ReplyDelete
  13. My password is still cleartext after saving file and reloading service

    ReplyDelete
  14. Hi Guys, just wondering how to make it autostart every time I start OSMC and how to make it so that debian-transmission doesn't keep overwriting the settings.json every time I do manually restart..

    ReplyDelete
  15. Hi Guys, just wondering how to make the transmission-daemon service start every time I restart OSMC.

    Also, how do I make debian-transmission NOT over write settings.json eveyr time to do this. Cheers, Mick.

    ReplyDelete
    Replies
    1. if you are using OSMC I recommend that you install it from the OSMC store instead.

      Delete
  16. Do we need to write the command to restart transmission each and every time after booting pi if yes than whet are the solution for this????

    ReplyDelete
    Replies
    1. Raspberry pi transmission startup on boot.

      "sudo nano /etc/init.d/transmissionboot.sh"

      Then type in:


      #!/bin/sh
      ### BEGIN INIT INFO
      # Provides: transmission-daemon-reload
      # Required-Start: $all
      # Required-Stop:
      # Default-Start: 2 3 4 5
      # Default-Stop: 0 1 6
      # Short-Description: Reload the transmission-daemon
      # Description: Reload the transmission-daemon at boot.
      ### END INIT INFO

      NAME=transmission-daemon-reload

      sleep 10
      service transmission-daemon reload


      Now press ctrl+o, enter, ctrl+x to save and exit.

      "sudo chmod +x /etc/init.d/transmissionboot.sh"
      "sudo update-rc.d transmissionboot.sh defaults"
      "sudo reboot"

      Delete
  17. good tutorial but I modified it a bit to download into the SD card rather than to download it outright on the NAS.

    unfortunately im getting bottlenecks with the network port, and even if I use a usb stick as a 'downloading' directory, the bandwidth is shared with the lan port.

    hope this helps the others.

    ReplyDelete
  18. this is amazing. thanks. although i had to call a friend because im not familiar with this thing. but it was a huge help.
    appreciated

    ReplyDelete
  19. I have to manually start it after every reboot, help?

    ReplyDelete
  20. guys, this uses systemd... so you need to edit the settings.json in this location:

    /var/lib/transmission-daemon/.config/transmission-daemon


    ok.. so try this on the PI..

    as root

    #make the dir
    mkdir -p /media/torrents

    #permissions... or you could 755 this. your call.
    chmod 777 /media/torrents


    #install transmission
    sudo apt-get install transmission-daemon

    #start it so it creates the standard config files
    systemctl start transmission-daemon.service
    systemctl stop transmission-daemon.service

    # take a peek at its logs
    systemctl status transmission-daemon.service -l

    #back up basic configuration
    cp -p /var/lib/transmission-daemon/.config/transmission-daemon/settings.json /var/lib/transmission-daemon/.config/transmission-daemon/settings.json.BACKUP

    #edit its config
    vi /var/lib/transmission-daemon/.config/transmission-daemon/settings.json


    #please focus on the below for the edits
    # insert your server's IP here
    "rpc-bind-address": "SERVER IP OR LOCALHOST",

    or tweak as needed...

    #then... start it up
    systemctl start transmission-daemon.service

    #is it running?
    systemctl status transmission-daemon.service -l
    ps -ef | grep -i trans

    #test from browser from another machine
    :9091


    - worked for me. I ran this all from command line.

    ReplyDelete
  21. Permissions are very simple to understand(just don't rush Guys).
    Also important key to a successful linux build.

    Nice guide, keep up !!!!!!

    ReplyDelete
  22. im not connecting to any peers right now :( sadly. this guide rocks, was the first one ever to make it work, now im stuck at 0 peers : ( sadly, but nice guide anyways.

    Could anyone help me out?

    ReplyDelete
  23. What are the benefits to running transmission on pi vs running it on Mac OS?

    ReplyDelete
  24. It seems that things have changed if you run a recent build of raspbian. Transmission won't start after boot anymore, have to start manually.

    Also, I couldn't get the permissions to work so just run it as root,

    adding USER=root to /etc/default/transmission-daemon

    Yeah, I know it's bad...

    ReplyDelete
  25. flawless, works like charm everytime..
    one more workaround thatwould be good is to make transmission run as pi user instead of debian-transmission

    ReplyDelete