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.gzaria2c -o <filename> <url> — Download and save with a custom filename.
aria2c -o backup.tar.gz https://example.com/archive-v2.tar.gzaria2c -d <dir> <url> — Download to a specific directory.
aria2c -d ~/Downloads https://example.com/file.ziparia2c -c <url> — Resume a partially downloaded file.
aria2c -c https://example.com/large-file.isoaria2c -i <file> — Download URLs listed in a text file (one per line).
aria2c -i urls.txtMulti-Connection & Speed
aria2c -x <n> <url> — Use multiple connections per server (max per host).
aria2c -x 8 https://example.com/large-file.isoaria2c -s <n> <url> — Split download into N pieces across connections.
aria2c -s 16 https://example.com/large-file.isoaria2c -j <n> -i <file> — Download N files in parallel from a URL list.
aria2c -j 5 -i urls.txtaria2c --max-download-limit=<speed> <url> — Limit download speed (e.g., 500K, 2M).
aria2c --max-download-limit=1M https://example.com/file.isoaria2c --max-overall-download-limit=<speed> -i <file> — Limit total download speed across all downloads.
aria2c --max-overall-download-limit=5M -i urls.txtaria2c --min-split-size=<size> <url> — Set minimum size for each split piece.
aria2c -x 8 --min-split-size=10M https://example.com/file.isoMultiple 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.isoaria2c -M <metalink> — Download using a Metalink file (multiple mirrors + checksums).
aria2c -M download.metalinkaria2c --checksum=sha-256=<hash> <url> — Verify download integrity with a checksum.
aria2c --checksum=sha-256=abc123... https://example.com/file.isoBitTorrent
aria2c <torrent-file> — Download from a torrent file.
aria2c ubuntu-24.04-desktop-amd64.iso.torrentaria2c '<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.torrentaria2c --select-file=<indices> <torrent> — Download only specific files from a torrent.
aria2c --select-file=1,3,5 file.torrentaria2c -S <torrent> — Show files in a torrent without downloading.
aria2c -S file.torrentAuthentication & 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.ziparia2c --header='<header>' <url> — Add a custom HTTP header.
aria2c --header='Authorization: Bearer token123' https://api.example.com/exportaria2c --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.gzaria2c --all-proxy=<proxy> <url> — Use a proxy for downloads.
aria2c --all-proxy=http://proxy:8080 https://example.com/file.zipRPC & Daemon Mode
aria2c --enable-rpc — Start aria2 as a daemon with JSON-RPC interface.
aria2c --enable-rpc --rpc-listen-all=true --daemonaria2c --enable-rpc --rpc-secret=<token> — Start RPC daemon with authentication token.
aria2c --enable-rpc --rpc-secret=mysecret --daemonaria2c --conf-path=<file> — Use a custom configuration file.
aria2c --conf-path=~/.config/aria2/aria2.confaria2c --save-session=<file> --save-session-interval=60 — Save download session for later resume.
aria2c --save-session=session.txt --save-session-interval=60 -i urls.txtaria2c --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
- aria2 – official documentation – manual and RPC reference
- aria2c(1) – manual page – every option at a glance
- aria2 – Wikipedia – background and history