Transmission, the default torrent program on Ubuntu now, also has a command line version that can be run on a server. This combined with Clutch, the web user interface for transmission, makes a nice pair. The version that is available in the repositories still has Transmission and Clutch as separate downloads, therefore, I recommend downloading directly from the Transmission site or Transmission repository. The instructions below have some references to synaptic just in case you are doing this on the desktop version. Here's how to set it up:
1. Add the Transmission repository to /etc/apt/sources.list or through synaptic. For hard the deb line is:
deb http://ppa.launchpad.net/transmissionbt/ubuntu hardy main
If you are using intrepid, just replace intrepid for hardy in the line above. See the
download site for more explanation.
2. Add the GPG signing key with the following commands:
gpg --keyserver keyserver.ubuntu.com --recv 976b5901365c5ca1
gpg --export --armor 976b5901365c5ca1 | sudo apt-key add -
3. Now update and upgrade apt--you can do this with the following command or by hitting reload in synaptic:
sudo apt-get update && sudo apt-get upgrade
4. Now install transmission command line version with the following:
sudo apt-get install transmission-cli
5. After it is installed, type in the following command.
transmission-daemon
After you have executed it, it might be a good idea to restart after this is done. The purpose of starting the daemon is to make sure you get some folders and files in your home directory.
6. You now need to make some edits to the settings.json file. It is located at:
/home/username/.config/transmission-daemon/settings.json
It should look something like this to begin with:
"blocklist-enabled": 0,
"download-dir": "\/home\/anyone",
"download-limit": 100,
"download-limit-enabled": 0,
"encryption": 1,
"max-peers-global": 200,
"peer-port": 51422,
"pex-enabled": 1,
"port-forwarding-enabled": 0,
"rpc-authentication-required": 0,
"rpc-password": "",
"rpc-port": 9091,
"rpc-username": "",
"rpc-whitelist": "127.0.0.1",
"upload-limit": 100,
"upload-limit-enabled": 0
You want to change it so it looks something like this:
"blocklist-enabled": 1,
"download-dir": "\/home\/anyone",
"download-limit": 100,
"download-limit-enabled": 0,
"encryption": 1,
"max-peers-global": 200,
"peer-port": 51422,
"pex-enabled": 1,
"port-forwarding-enabled": 0,
"rpc-authentication-required": 0,
"rpc-password": "",
"rpc-port": 9091,
"rpc-username": "",
"rpc-whitelist": "127.0.0.1,198.168.1.*",
"upload-limit": 100,
"upload-limit-enabled": 0
As you can see, the first change is on the "blocklist-enabled" line. You are changing 0 to 1. This is obviously to enable blocklists. If you have something like moblock running, you can leave this as 0. I will discuss setting up blocklists further below. The second change is to the "rpc-whitelist" line. You basically need to add the ip address from which you will be accessing the server. The example listed above assumes your ip address will begin with 192.168.1. Throw in a * to cover everything else. To allow all ip addresses, you could probably add something like "*.*" although I have not tested this. In any even, change "192.168.1.*" to suit your individual ip address.
7. You now need to add a couple scripts to your system that the Transmission page provides for you. The first helps automate the startup of transmission when you boot. To do this, go to first to the
Transmission Initd Script page so that you are able to copy the text of the script listed.
8. After you have copied the text, create a new file in /etc/init.d/ with the following command (nano can be substituted with gedit if you like):
sudo nano /etc/init.d/transmission-daemon
When the blank file comes up, paste in the script you copied from the transmission web page and hit save.
9. You also need to make this file executable by running the following command:
sudo chmod +x /etc/init.d/transmission-daemon
10. Now that we have the initd file, we need to add it to the appropriate spots in the system so that it starts automatically. It may work to simply add the new file/command (/etc/init.d/transmission-daemon start) to /etc/rc.local, however, the proper level is to add it to the appropriate rc runtime folders in /etc. To do this, run the following command to make sure transmission-daemon starts on startup and stops on shutdown:
sudo update-rc.d FOO defaults
11. Finally, we need a script to update the blocklist if you want one. Once again, you must copy the text of the script from the
Transmission Blocklist Script page and paste it into a new file that you create. You can put this new file wherever you want, I suggest somewhere in your home directory. So you would create it with a command like this one:
sudo nano /home/yournamegoeshere/transmission-blocklist
Then paste in the text, save, and exit.
12. To automate this file, we simply need to add it to crontab. Do this with the following command:
crontab -e
Add the following line to have it update everyday at 1:00 a.m.:
00 01 * * * cd /home/yournamegoeshere && sh ./transmission-blocklist
13. Restart your system and you should have transmission running. You can access it by going to the following page:
http://serveripaddress:9091/transmission
If that doesn't work, try:
http://serveripaddress:9091/transmission/web/
Note also that you have the appropriate port open on your firewall. You shouldn't need the 9091 port open unless accessing the server from outside of your network, but you will need to open the peer port noted in your setting file described above. In that example, the port is 51422.
Sources:
TransmissionTransmission Initd ScriptTransmission Blocklist ScriptStartup Scripts DescriptionCrontab Explanation