Setup Your Server as a Torrent Downloader

Author Avatar
Nathaniel Oct 15, 2016

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 the ones used by 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 cases for 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 US$ 5 per month from DigitalOcean or Vultr.

To bypass the P2P ban, we can first download whatever we need to a Linux server. After the download is completed, we can then easily transfer the files from the server to our local devices using FTP/SFTP/etc.

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

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, simply Google how to install aria2. There are bunch of resources.

Run Aria2 JSON-RPC Server in the Background

Start a screen session.

$ screen -S aria2

Now you can start the aria2 RPC server in the screen session.

$ 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 is.

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

Get YAAW

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 address of your server.

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