If you don’t have a server yet, don’t worry. Unless you are a very heavy-duty user, you probably won’t need a dedicated server. If you are unsure, go with a VPS. I don’t have any service provider recommendations at the moment, but I assure you there are plenty. Just do some research on torrent-friendly ones.
I assume that you have obtained your server credentials (username and password) by now. Login to your server using the SSH client.
First we are going to install a bunch of prerequisite software packages that we will need during the course of this tutorial. Issue the following command:
yum -y install wget bzip2 which gcc gcc-c++ make openssl-devel pkgconfig curl-devel perl-XML-Parser perl-libwww-perl gettext yum -y upgrade
This installation might take a minute or two, depending on your server specs and connection speed.
CentOS intltool package is out of date and a recent version is not available through the package manager. We must compile it from source. Don’t quit now. This isn’t as scary as it sounds.
cd /usr/local/src wget -q http://ftp.gnome.org/pub/gnome/sources/intltool/0.40/intltool-0.40.6.tar.gz tar zxf intltool-*.tar.gz cd intltool-* ./configure --prefix=/usr && make -s && make -s install
CentOS libevent package is out of date, just like
intltool, so we resort to installing the latest version by hand.
cd /usr/local/src wget -q --no-check-certificate https://github.com/downloads/libevent/libevent/libevent-2.0.17-stable.tar.gz tar zxf libevent-*-stable.tar.gz cd libevent-*-stable ./configure --prefix=/usr && make -s && make -s install && ldconfig
Transmission is the actual torrent application that you will be using. Again, just copy paste the commands into the SSH client window.
cd /usr/local/src wget -q http://download.transmissionbt.com/files/transmission-2.50.tar.bz2 tar xjf transmission-*.tar.bz2 cd transmission-* ./configure --prefix=/usr LIBEVENT_CFLAGS=-I/usr/include LIBEVENT_LIBS="-L/usr/lib -levent" make -s && make -s install
Add a user account for running the Transmission daemon application. You will be prompted to create a password. You will use that password to login and obtain the files that have been downloaded. Try to remember the password or write it down.
useradd -m transmission && passwd transmission
Create init script for starting the daemon. Adapted from Jason Friedland’s implementation.
wget --no-check-certificate -q -O /etc/init.d/transmissiond https://gist.github.com/moltar/5187393/raw/ chmod 755 /etc/init.d/transmissiond
Set the Transmission daemon to start automatically when the server is restarted:
chkconfig --add transmissiond chkconfig --level 345 transmissiond on
Start and stop the Transmission daemon. You must do this before proceeding to the next step. This ensures that everything up to now has been installed properly. Most important, this creates a default configuration file that we will be editing later on. You should see two green [OK] outputs after the completion.
service transmissiond start && service transmissiond stop
Now we need to modify the Transmission configuration file. Replace the bold/underlined portion of the last two commands with your own username and password combination. You’ll use this to login to Transmission application.
cd /home/transmission/.config/transmission/ sed -i 's/^.*rpc-whitelist-enabled.*/"rpc-whitelist-enabled": false,/' settings.json sed -i 's/^.*rpc-authentication-required.*/"rpc-authentication-required": true,/' settings.json sed -i 's/^.*rpc-username.*/"rpc-username": "username",/' settings.json sed -i 's/^.*rpc-password.*/"rpc-password": "password",/' settings.json
Create a directory for storing downloads:
mkdir -p /home/transmission/Downloads/ chown -R transmission.transmission /home/transmission/Downloads/ chmod g+w /home/transmission/Downloads/
Finally start the Transmission daemon for good:
service transmissiond start
We are also going to install a ConfigServer Security & Firewall application. This application will help your server to stay secure and also ensure that the necessary ports are open for Transmission to function properly. This is an important step, please do not skip it. Hosting providers have different configurations of the default CentOS install and may block certain ports. This installation will ensure that the necessary ports are open and unnecessary ones remain closed.
cd /usr/local/src wget -q http://www.configserver.com/free/csf.tgz tar zxf csf.tgz rm -f csf.tgz cd csf ./install.generic.sh
Now that we have CSF installed, we’ll issue a few commands to “doctor” the configuration file and open/close some ports.
cd /etc/csf sed -i 's/^TESTING =.*/TESTING = "0"/' csf.conf sed -i 's/^TCP_IN =.*/TCP_IN = "21,22,9091,51413,30000:35000"/' csf.conf sed -i 's/^TCP_OUT =.*/TCP_OUT = "1:65535"/' csf.conf sed -i 's/^UDP_IN =.*/UDP_IN = "20,21,51413"/' csf.conf sed -i 's/^UDP_OUT =.*/UDP_OUT = "1:65535"/' csf.conf service csf restart
By now you should have the Transmission daemon running. Let’s go play!
Open the following URL in a new browser tab/window:
You will be prompted to enter a username and password. Use the same username and password you have created during the Transmission installation (the second one). Once logged in, you should see a Transmission web interface. Click “Open” and copy-paste the following URL to test the download functionality and speed:
You should now see the download status bar increasing.
Download, install and open FileZilla. Go to File -> Site Manager. Click “New Site“. Give it a good name. Under “Host” field put the server name (if you have one), or simply the IP of the server. Choose SFTP under “Server Type“. “Logon Type” set to “Normal”. Set the user to “transmission” and the password you have created during Transmission installation (the first one). Now click “Connect“, you should see FileZilla establishing the connection and then finally listing remote directories in the right hand side part of the window. You should see “Downloads” directory, this is where all of the download files will be stored.
This is my favourite part about this whole setup. Not only you get a nice and fast web based client, but you can also set this up to be used with the desktop application! If you are migrating from µTorrent, then you’ll love this!
Once you have it open:
Your desktop software should now be “talking” to your server. Note that this software only shows the status of the downloads, but you can’t actually access files through that UI. You still need to use the FTP client to download the completed torrents.
All credits go to Seeboxr from DIYseedbox.com