Home > Network Management > aria2c

aria2c: A Multi-Protocol Download Utility

aria2c is a powerful command-line download utility that supports HTTP/HTTPS, FTP, SFTP, BitTorrent, and Metalink. It can significantly improve download speeds by downloading files from multiple sources and using multiple connections simultaneously.

Overview

aria2c is a versatile tool that allows for efficient file downloads across various protocols. It excels at optimizing download speeds by utilizing multiple connections concurrently.

Key Features

  • Multi-protocol support (HTTP, HTTPS, FTP, SFTP, BitTorrent, Metalink)
  • Increased speed through multi-connection/multi-source downloads
  • Download resuming capability
  • Batch downloads from a file list
  • BitTorrent/Metalink support

Key Options

The main options of aria2c allow for fine-grained control over download methods, speed, and output.

Download Control

BitTorrent/Metalink

Generated command:

Try combining the commands.

Description:

`aria2c` Executes the command.

Combine the above options to virtually execute commands with AI.

Usage Examples

Practical examples of using aria2c's various features.

Basic HTTP/HTTPS File Download

aria2c https://example.com/archive.zip

Downloads a file from the specified URL.

Download File with Maximum 5 Connections

aria2c -x 5 https://example.com/large_file.tar.gz

Uses 5 concurrent connections to a single server to increase download speed.

Save File with a Specific Name

aria2c -o my_document.pdf https://example.com/document.pdf

Saves the downloaded file as 'my_document.pdf'.

Download BitTorrent File and Seed Indefinitely

aria2c --enable-dht --seed-time=0 torrent_file.torrent

Downloads a torrent file and seeds it indefinitely after completion. DHT is enabled to find peers.

Batch Download from a File List

aria2c -i urls.txt

Downloads all URLs from the 'urls.txt' file, where each line contains a single URL.

Specify Download Directory

aria2c -d /home/user/downloads https://example.com/another_file.iso

Saves downloaded files to the '/home/user/downloads' directory.

Installation

aria2c is not included by default in most Linux distributions and must be installed via a package manager.

Debian/Ubuntu

sudo apt update && sudo apt install aria2

Installs aria2c using the APT package manager.

Fedora/CentOS/RHEL

sudo dnf install aria2

Installs aria2c using the DNF (or Yum) package manager.

Arch Linux

sudo pacman -S aria2

Installs aria2c using the Pacman package manager.

Tips & Precautions

Tips and points to consider for more effective use of aria2c.

Performance Optimization

  • Increasing the number of connections per server using the `-x` option can improve download speeds. However, too many connections may burden the server, so adjust accordingly.
  • The `-s` option allows you to manage system resource usage by adjusting the maximum number of concurrent downloads when downloading multiple files simultaneously.

When Using BitTorrent

  • Enabling DHT (Distributed Hash Table) and Local Peer Discovery using options like `--enable-dht` and `--bt-enable-lpd` can help find more peers and increase download efficiency.
  • The `--seed-time=0` option continues seeding indefinitely after the download is complete. While this benefits other users, it continuously uses system resources (upload bandwidth), so be mindful of this.

Utilizing Configuration Files

  • You can create a `~/.aria2/aria2.conf` file to pre-configure frequently used options. For example, you can specify default connection counts, download directories, etc.
  • You can also specify a particular configuration file using the command `aria2c --conf-path=/path/to/aria2.conf`.

Same category commands