How to set up a Linux VPS to be used as a seedbox

What is a seedbox?

A seedbox is a private server used for uploading and downloading digital files. Since VPSes are cheap and usually connected with speeds of 100mpbs and above they make great budget seedboxes.

What software and configuration is required?

The software installed with this guide will be rTorrent (a command-line torrent client), ruTorrent (a web interface for rTorrent), lighttpd (a webserver used to access ruTorrent), PHP (required by ruTorrent) and Screen (required for running rTorrent in the background)

Removing default apps and upgrading

Since we’re going to be using this VPS for torrents and will install lighttpd, we can remove the pre-installed webserver, mailserver, etc.

To do this, enter the following command and press enter

apt-get update && apt-get remove --purge -y apache2* bind9* sendmail* samba* && apt-get -y autoremove && apt-get -y upgrade

Sometimes, sendmail doesn’t get fully removed, so once that has finished, press the up arrow on your keyboard (which repeats the previous command, without submitting it) and then press enter and let it run again.

Installing and setting up the required apps

To install the apps we need, enter the following command and press enter

apt-get install -y screen rtorrent lighttpd php5-cgi php5-cli curl ffmpeg mediainfo unrar nano && lighty-enable-mod fastcgi-php auth

Setting up the folders

We need a folder for current torrents (session), a folder for ruTorrent to watch (watch) for new torrents, a folder for ruTorrent (/var/www/t) and a folder for the downloads (/var/www/d) so run the following command to create these folders

cd ~ && mkdir rtorrent && mkdir rtorrent/watch rtorrent/session /var/www/t /var/www/d

Installing ruTorrent

Run the following command to install ruTorrent into the /var/www/t folder

cd /var/www && wget https://github.com/Novik/ruTorrent/archive/master.zip && unzip master.zip && rm master.zip && mv ruTorrent-master/ t && chmod 0777 t/share/settings t/share/torrents

Starting rTorrent

We need to run rTorrent in a screen session so it will continue to run when the connection to the VPS is closed. Run the following command

cd ~ && screen -S rt

Then, you’ll have be in a screen session so type the following

rtorrent

Then, hold Ctrl + A and press D which will disconnect the screen session and leave it running in the background

Securing your webserver

Of course, we don’t want everyone accessing ruTorrent and our downloads, so we need to password protect the folders

Run the following command

cd /etc/lighttpd/conf-enabled && rm 05-auth.conf && wget ehwtf.com/seedbox/05-auth.conf && nano /etc/lighttpd/lighttpd.user && /etc/init.d/lighttpd restart

It will then bring up a blank white window

Head to this site and generate a htpasswd file (delete everything in the left hand box and type in admin (space) yourPasswordHere then click Generate htpasswd content)

Copy everything from the box on the right hand side (example: admin:$apr1$sgwrguwr$egrrrhr) and then go back to PuTTY, press Ctrl + X then type Y and then press enter

Now we just need to make sure we can see a list of files when we access the torrents folder. Enter the following command

echo ‘dir-listing.activate = “enable”‘ >> /etc/lighttpd/lighttpd.conf && /etc/init.d/lighttpd restart

Finished

To test it, access your webserver like this

http://YOURSERVERIP/t

It should ask you for a username and password. Use admin and the password you chose earlier. You should then be able to use ruTorrent. To see downloads, just go to the following address

http://YOURSERVERIP/d

If you find any problems, or it doesn’t ask for a username/password, please leave a comment and I will try to help.