Setup Your Server as a Torrent Downloader

Disclaimer: this article does NOT encourage illegal P2P file sharing. NEVER share a file that you do not own.

Background

It is pretty annoying that some ISPs, like local universities here in Singapore, completely ban P2P traffic on their networks. Despite the stigma around P2P content, there are actually a lot of perfectly legal use of P2P file sharing.

At the same time, people like you and me may have access to a handful of servers. If not, you can get a virtual server for as cheap as USD 5 per month from DigitalOcean.

To bypass the P2P ban, we can download whatever we need to a Linux server first, then transfer the files to our local devices either using FTP or SFTP.

In this tutorial, we are going to use Aria2 together with YAAW.

Just Do It

Install Aria2

Before we start, make sure the server:

  1. Is running Linux
  2. Can be accesed remotely via SSH
  3. Have screen installed (If not, install it by something like apt-get or yum)

Now we can ssh to the server, and do the following:

$ sudo apt-get update
$ sudo apt-get install aria2

The commands above only work for Ubuntu. If you are on a different operating system, just do whatever it takes to install aria2.

Run Aria2 JSON-RPC Server in the Background

Start a screen session:

$ screen -S aria2

Now you can start the aria2 RPC server by:

$ aria2c --enable-rpc --rpc-listen-all=true --rpc-allow-origin-all --rpc-secret=<secret>

The <secret> is a random long string. This is to ensure that only you can access the JSON RPC server, since others cannot guess what the long (40+ characters) random string might be.

Then, detach the current screen by pressing ctrl + d.

YAAW, The Client

Now that we have finished configuring the server, we need to download the GUI for the downloader, Yaaw, from its official website.

Unzip the downloaded file, and open index.html in your favorite browser.

Click the settings button in the top right corner, and replace whatever is in JSON-RPC Path to the following:

http://token:<secret>@<hostname>:6800/jsonrpc

The <secret> is the same as introduced above, and <hostname> is the IP of your server.

Now it’s all ready. You can add download jobs using the GUI and monitor the download progress.