January 9, 2012

Creating a Seedbox in CentOS 6

So you've decided that you want a seedbox, but the companies selling seedboxes are too expensive. It's actually very easy to make a seedbox yourself and cut out the middleman. All you need is a dedicated server or VPS running CentOS 6 and you can have a seedbox up and running in under 20 minutes. I recommend OVH's Kimsufi 2G dedicated server which is a great value -- 1TB of hard drive space for under $20/month. There are plenty of hosting companies out there, so find the one that's right for you. Alternatively, if you have an old computer lying around and a good internet connection, you can set up a seedbox in your own house. Just install CentOS 6 on the computer and follow the rest of the instructions in this tutorial.

Once your host sends you your server's details, you need to connect to your server. In Windows, download PuTTY and fill in the appropriate details. In OS X or *nix systems, open up a terminal and type the following to connect:
$ ssh root@[your server's ip]
I wrote an installation script to automate the installation of Transmission 2.51. The script takes the following steps:
  • Update the system and install packages required by Transmission
  • Create a new user which will run transmission
  • Install a firewall (CSF) to ensure that the ports required by Transmission are open and unneeded ports are closed
  • Compile libevent from source, since the version in the CentOS repositories is not recent enough for Transmission
  • Update ldconfig and pkg-config configurations so that libevent libraries can be located
  • Compile Transmission 2.51 from source
  • Download and install an init script for the Transmission daemon
  • Edit Transmission configuration so that you can access it remotely using the username and password of your choosing

Now you can install a seedbox in just three commands. First, download the install script to your server:
# wget -O install-transmission.sh http://pastie.org/pastes/3902096/download
Make the script executable and run it. Important: you must be using CentOS 6 and you must be root, otherwise this will not work. I am not responsible if this script damages your server. Use at your own risk.
# chmod u+x install-transmission.sh
# ./install-transmission.sh
Type in the username and password you desire, and then let the script run. It should take around 10-15 minutes if you are working from a base install since the script will install system updates and compile both Transmission and libevent (required to compile Transmission) from source. Be patient!

If everything went well, then you now have a functioning seedbox! If there was a problem, then do not hesitate to contact me. Here's how to use your seedbox.

Accessing the Transmission interface
  1. [Recommended] Use the remote GUI to access your seedbox. This client contains all of the features you would expect from a desktop client, while also running faster than the web interface. They have Windows, Mac OS X, and Linux versions. Download here. To set up the connection to your seedbox, put the server's IP under remote host, set the port to 9091 (default), and use the username and password you set when installing the seedbox.
    Transmission Remote GUI in Windows, screenshot from the project's wiki
  2. Alternatively you can use the web interface. It doesn't have as many features as the remote GUI, but you can access it from any computer, or even your smartphone! To access the web interface just go to this address in your browser:
    http://[Your server's IP]:9091
  3. From your (Android) phone I recommend using Transdroid, available from transdroid.org or by scanning the following QR code with your phone.

Test your new seedbox by downloading a torrent! Here's one:
https://www.archlinux.org/iso/2011.08.19/archlinux-2011.08.19-core-x86_64.iso.torrent
You don't even need to download the torrent; copying the torrent's URL and pasting it into your Transmission interface is sufficient.

Downloading files from your seedbox
To download and manage files on your seedbox you can use Filezilla, an FTP/SFTP client. First, download and install Filezilla. Then go to the site manager and fill in a new connection according to the screenshot below, obviously substituting the username your chose earlier for 'username'. Hit connect and you will now see files from your computer on one side, and files from your seedbox on the other. Download/upload by dragging and dropping.
That's all there is to it! I would like to thank moltar for his tutorial at diyseedbox.com. Parts of his tutorial were very helpful in writing my install script and these instructions. Please comment if you have any questions!

Update 05/12/12: Now updated to Transmission 2.51, added perl-Time-HiRes to allow the latest version of csf to install, updated libevent to 2.0.19, unblocked http and webmin on the firewall (TCP ports 80 and 10000), and added Transdroid as a method to access your seedbox.