aria2 — Multi-Connection Downloads from the Command Line

Practical guide to aria2c — HTTP/HTTPS/FTP/BitTorrent downloads with multiple simultaneous connections, resume support and a JSON-RPC daemon.

aria2 is a lightweight, multi-protocol download utility built for speed: the -x and -s flags split a single file into segments and fetch them over multiple connections simultaneously – making it significantly faster than single-connection tools. It handles HTTP/HTTPS, FTP, BitTorrent and Metalink in one command, resumes interrupted downloads seamlessly, and exposes a JSON-RPC interface so you can queue and control downloads remotely from frontends or scripts.

Basic Downloads

aria2c <url> — Download a file from a URL.

aria2c https://example.com/file.tar.gz

aria2c -o <filename> <url> — Download and save with a custom filename.

aria2c -o backup.tar.gz https://example.com/archive-v2.tar.gz

aria2c -d <dir> <url> — Download to a specific directory.

aria2c -d ~/Downloads https://example.com/file.zip

aria2c -c <url> — Resume a partially downloaded file.

aria2c -c https://example.com/large-file.iso

aria2c -i <file> — Download URLs listed in a text file (one per line).

aria2c -i urls.txt

Multi-Connection & Speed

aria2c -x <n> <url> — Use multiple connections per server (max per host).

aria2c -x 8 https://example.com/large-file.iso

aria2c -s <n> <url> — Split download into N pieces across connections.

aria2c -s 16 https://example.com/large-file.iso

aria2c -j <n> -i <file> — Download N files in parallel from a URL list.

aria2c -j 5 -i urls.txt

aria2c --max-download-limit=<speed> <url> — Limit download speed (e.g., 500K, 2M).

aria2c --max-download-limit=1M https://example.com/file.iso

aria2c --max-overall-download-limit=<speed> -i <file> — Limit total download speed across all downloads.

aria2c --max-overall-download-limit=5M -i urls.txt

aria2c --min-split-size=<size> <url> — Set minimum size for each split piece.

aria2c -x 8 --min-split-size=10M https://example.com/file.iso

Multiple Sources & Mirrors

aria2c <url1> <url2> <url3> — Download same file from multiple mirrors simultaneously.

aria2c https://mirror1.example.com/file.iso https://mirror2.example.com/file.iso

aria2c -M <metalink> — Download using a Metalink file (multiple mirrors + checksums).

aria2c -M download.metalink

aria2c --checksum=sha-256=<hash> <url> — Verify download integrity with a checksum.

aria2c --checksum=sha-256=abc123... https://example.com/file.iso

BitTorrent

aria2c <torrent-file> — Download from a torrent file.

aria2c ubuntu-24.04-desktop-amd64.iso.torrent

aria2c '<magnet-link>' — Download using a magnet link.

aria2c 'magnet:?xt=urn:btih:abc123...'

aria2c --seed-time=0 <torrent> — Download and exit immediately without seeding.

aria2c --seed-time=0 file.torrent

aria2c --select-file=<indices> <torrent> — Download only specific files from a torrent.

aria2c --select-file=1,3,5 file.torrent

aria2c -S <torrent> — Show files in a torrent without downloading.

aria2c -S file.torrent

Authentication & Headers

aria2c --http-user=<user> --http-passwd=<pass> <url> — Download with HTTP Basic Authentication.

aria2c --http-user=admin --http-passwd=secret https://private.example.com/file.zip

aria2c --header='<header>' <url> — Add a custom HTTP header.

aria2c --header='Authorization: Bearer token123' https://api.example.com/export

aria2c --ftp-user=<user> --ftp-passwd=<pass> <url> — Download from FTP with credentials.

aria2c --ftp-user=admin --ftp-passwd=secret ftp://ftp.example.com/backup.tar.gz

aria2c --all-proxy=<proxy> <url> — Use a proxy for downloads.

aria2c --all-proxy=http://proxy:8080 https://example.com/file.zip

RPC & Daemon Mode

aria2c --enable-rpc — Start aria2 as a daemon with JSON-RPC interface.

aria2c --enable-rpc --rpc-listen-all=true --daemon

aria2c --enable-rpc --rpc-secret=<token> — Start RPC daemon with authentication token.

aria2c --enable-rpc --rpc-secret=mysecret --daemon

aria2c --conf-path=<file> — Use a custom configuration file.

aria2c --conf-path=~/.config/aria2/aria2.conf

aria2c --save-session=<file> --save-session-interval=60 — Save download session for later resume.

aria2c --save-session=session.txt --save-session-interval=60 -i urls.txt

aria2c --input-file=<session-file> — Restore downloads from a saved session.

aria2c --input-file=session.txt

Conclusion

aria2 shines on large files and congested links: multiple connections and mirror support squeeze every bit of available bandwidth. For recurring download tasks, pair an aria2.conf with the RPC daemon – this lets you manage queues from frontends like Aria2 Web UI or browser extensions without opening a new terminal each time.

Further Reading

  • wget – download files and directory trees from servers
  • curl – HTTP requests, APIs and downloads on the command line
  • scp – transfer files securely over SSH