Downloading Torrents over the Web with cloud-torrent

BitTorrent is a peer to peer protocol for sharing files. There are many local clients that allow you to download files via torrents. However, there are times where you may need to download them over the web because you can’t use a local torrent client.

cloud-torrent is a web based torrent-client. It allows you to search torrent trackers, add torrent files and magnet links, and download them on your computer.

In this article we will look at installing cloud-torrent on a server running Linux. You can even run it on your own computer if it is publicly accessible with an IP address.

A word of caution though: if you’re planning to run torrent applications on your server, you may want to confirm whether your provider allows this.

Download and run cloud-torrent

Download the correct version of cloud-torrent from the releases page. Binaries are available for Intel 32- and 64-bit variants, as well as for ARM. In the example below, we have downloaded the 64-bit Linux version:

Now, visit http://your_server_name:3000/ with a browser. If you can see the web interface, that’s great! However, if it’s not working for you, check that:

You’re not blocking traffic on port 3000 – you need to change your firewall configuration in that case.

You’re not running an existing service on port 3000. If this is the case, cloud-torrent will exit with an error listen tcp 0.0.0.0:3000: bind: address already in use. You can run cloud-torrent on a different port, like so:

./cloud-torrent -p <custom_port_number>

The port number must be anywhere between 1025 and 65535.

To stop cloud-torrent, simply press Ctrl+C.

Setting up cloud-torrent

While cloud-torrent is already working, you probably want it to be started automatically on system startup like a regular system service. You can do this quite easily.

First, you need to set up a separate user for cloud-torrent to run. While it is not strictly necessary to do so, it is generally recommended for better security.

sudo useradd -rm cloud-torrent

Next, you have to move the cloud-torrent binary to the home directory of the new user.

sudo mv cloud-torrent /home/cloud-torrent/cloud-torrent

Now, you need to configure the system to start it automatically. In order to do so, you need to find out the init system that’s in use. To do this run (source):

Exploring cloud-torrent’s interface

If you have followed the steps above, cloud-torrent should be up and running! You can visit http://<your_server_IP>:3000/ to verify this. Now, you can download torrents by pasting magnet links or torrent file links in the text box. In addition, you can enter a search term to search for torrents on common torrenting websites.

You can configure seeding and encryption settings by clicking on the three bars icon. (See the screenshot below.)

Password protection

The current setup has a problem — anyone who visits it can use it. You can prevent this by setting a password by specifying an environment variable named AUTH.

If you’re using systemd, edit /etc/systemd/system/cloud-torrent.service and put this line in the [Service] section:

Environment="AUTH=username:password"

Then, restart the cloud-torrent service with:

sudo systemctl daemon-reload
sudo systemctl restart cloud-torrent

For sysvinit based systems, simply export the AUTH variable like you would do in a shell script:

# [previous part of shell script]DAEMONUSER=cloud-torrent
PIDFILE=/var/run/$NAME.pid
exportAUTH="username:password"# [rest of the shell script]

Replace username and password with your own values, and then restart with:

sudo service cloud-torrent restart

Configuring HTTPS

To protect your privacy, you may want to configure HTTPS on cloud-torrent.

First, you need to obtain a certificate. If you don’t have one, you can obtain one through Let’s Encrypt. In the segments below, you should replace /path/to/key.pem and /path/to/cert.pem with the correct paths. If you’re using Let’s Encrypt, you can find these files under the /etc/letsencrypt directory.

For systemd users this will be easy. In /etc/systemd/system/cloud-torrent.service, modify the line containing ExecStart= like so:

After making these changes, restart the cloud-torrent service as described above. At this point, cloud-torrent should be set up over HTTPS. For more configurable options, be sure to check out the --help switch.