Commands.page Logo

How to Download Torrents with aria2c on Ubuntu

This article provides the exact command syntax for downloading torrent files using aria2c on Ubuntu. It outlines the necessary installation steps and demonstrates the primary terminal command required to initiate downloads via magnet links or torrent files.

To begin, ensure aria2 is installed on your system by running sudo apt update && sudo apt install aria2. Once installed, the basic syntax to download a torrent is straightforward. You simply need to pass the torrent file path or the magnet link directly to the aria2c command.

The core command structure is:

aria2c [options] <torrent-file-or-magnet-link>

For a standard download using a magnet link, execute the following in your terminal:

aria2c "magnet:?xt=urn:btih:HASH"

If you have a torrent file saved locally, use the file path instead:

aria2c /path/to/your/file.torrent

You can optimize download speeds by specifying the number of connections per server and the maximum number of download tasks. A common optimized command looks like this:

aria2c -x 16 -s 16 "magnet:?xt=urn:btih:HASH"

In this example, -x 16 sets the maximum number of connections to one server, and -s 16 sets the number of split connections. The download will start immediately in the current directory. To see a list of active downloads and their status, you can use the command aria2c --show-console-readout=true.