[Attention!] I’ve started writing the original version of this tutorial in 2014, and back then I was cutting corners about the service user which should be running transmission-daemon, and some other settings as well. The below article is a major re-write of that article, which reflects my setup as of 2018, running on a Raspberry Pi 3B+ and Raspbian Stretch Lite (2018-06-27).
Here it goes…
Downloading (legal) content using torrents is very convenient, but if you plan to “seed” back the stuff, then you’ll need to keep your computer running 24/7 which won’t be good for your electricity bills. For this reason it’s a nice idea to use a Raspberry Pi as a “torrent server” a.k.a “seedbox” which will run day and night, as it’s power consumption is tiny compared to a laptop, let alone a desktop PC.
We’ll be using Transmission as a torrent client, which can be installed as a “daemon” running in the background all the time on the Raspberry Pi.
This guide assumes that you already have the following:
– You have wired up your Raspberry Pi (good quality power supply and USB power cable) and Ethernet (I don’t recommend WiFi for this)
– You have Raspbian Stretch Lite imaged with Etcher on your microSD card, which can boot up and log into the pi user
– You have assigned a static IP address to it, so we always access it on the same IP; either on your router or in the OS
When the above are ready, please SSH to your Raspberry Pi and install Transmission torrent client like this:
sudo apt-get update sudo apt-get upgrade sudo apt-get install transmission-daemon sudo usermod -a -G debian-transmission pi
Before we make all the changes we want, we should make sure the transmission-daemon isn’t running. Let’s check the status first. If it’s active and running, let’s stop it. Then check the status again to see if it’s really stopped.
sudo service transmission-daemon status sudo service transmission-daemon stop sudo service transmission-daemon status
Then we’ll have to edit the transmission-daemon to run in the name of the Raspbian’s user “pi”, instead of the user “debian-transmission” which is set by default in transmission-daemon.
sudo nano /etc/init.d/transmission-daemon
change this line:
so it looks like this:
Now we set the permissions on the folders transmission keeps the config files. If it can’t read and write the configs, it won’t run. As we’ll be running transmission-daemon as the “pi” user, the commands are the following:
sudo chown pi:debian-transmission -R /etc/transmission-daemon/ sudo chown pi -R /var/lib/transmission-daemon/
We need to make sure transmission-daemon will start by itself after every reboot.
sudo update-rc.d transmission-daemon defaults
Now comes the config file.
You can edit it in it’s original location (but it has a long path to enter and remember)
So you can also use a this symlink which points to it. It doesn’t matter which you choose, you’ll be editing the same file anyway.
If you’re looking for some inspiration, you can use my settings.json file which I keep here. Just make sure you change the username, password and other bits and pieces which are relevant to you.
Now let’s see if it starts :)
service transmission-daemon start
You don’t need to use sudo anymore, because we should be able to start it as the user “pi”.
If you use an NFS server to share the files downloaded with Transmission, restart all related services:
sudo exportfs -ra sudo service nfs-kernel-server restart service transmission-daemon restart
To test if the transmission-daemon starts OK after a reboot, we should test it.
After the Pi reboots, we can log back to it via SSH.
Transmission also has a web-based graphical user interface (GUI) which we can use to manage our torrents, it’s very handy. Open a browser on our laptop, and try if we can reach the web interface. Of course you’ll need to insert the static IP of your own Raspberry Pi there.
This should bring up a login box. The username and password are stored in Transmission’s settings.json we have set earlier.