aria2 Complete Documentation
Building & Installation - The Ultra Fast Download Utility
aria2 is a free, open-source, multi-protocol CLI download tool written in C++ that supports HTTP, HTTPS, FTP, SFTP, BitTorrent, and Metalink. It downloads files up to 16× faster than wget or curl by opening up to 16 parallel connections simultaneously, while using only 4–9 MiB of RAM. Available for Windows, macOS, Linux, and Android — no GUI required.
Use this documentation to master installation on Windows, Linux, and macOS, configure advanced protocol engines, and integrate aria2 into your own automation pipelines.
Cross-compiling: aria2 uses mingw-config and android-config
wrappers for generating Windows (.exe) and Android binaries using MinGW and NDK toolchains respectively.
Basic HTTP & FTP Configuration
aria2 handles typical HTTP/FTP downloads brilliantly out of the box, but its real power lies in Protocol Hybridization. It can download a file from HTTP/FTP/SFTP and BitTorrent simultaneously, uploading data from the direct sources to the BitTorrent swarm to maximize efficiency.
Note: aria2 is purely a command-line program and RPC backend. If you use
-x 16 to open 16 connections, some servers may temporarily rate-limit your IP. Always
tune
your concurrent limits responsibly.
Batch Automations
For scraping, mirror synchronization, and batch operations, you can feed aria2 a raw text file containing
thousands of URLs. It will aggressively download them in parallel using the -i (input)
parameter.
BitTorrent Deep Dive
aria2 possesses fully-fledged BitTorrent client capabilities integrated directly into its core engine. It supports DHT routing tables, Local Peer Discovery (LPD), and Magnet URI resolution natively.
Note: aria2 is one of the only clients that inherently supports BitTorrent WebSeeding. You can link a standard HTTP mirror securely into a P2P swarm simultaneously!
Metalink Support
Metalinks are XML files containing URI lists, checksums, and metadata. aria2 uses these to automatically find the fastest mirror and verify file integrity simultaneously.
Resuming & Recovery
Unlike wget, aria2 has highly robust file-recovery capabilities. If your internet
disconnects
or your power fails during a huge file transfer, aria2 can seamlessly resume data verification using the
-c / --continue flag.
If you don't use -c and the file already exists, aria2 defaults to auto-renaming the new
download to mylinux.1.iso to prevent accidental overwrites.
Bandwidth Throttling
Prevent aria2 from monopolizing your home network when downloading in the background by setting strict throttle limits. Limits can be applied globally to the entire daemon, or individually per task.
Disk Allocation & High-Speed I/O
When downloading huge 50GB++ files via 16 parallel split connections, mechanical HDD disks (and basic SSDs) experience colossal filesystem fragmentation resulting in slowdowns.
Aria2's falloc engine instantly commands the operating system to pre-map block allocation
directly at the kernel level before the download even begins.
Checksums & Integrity
Ensure your downloads haven't been corrupted or tampered with by forcing aria2 to verify hash sums during or after the transfer.
Advanced Networking & IPv6
Fine-tune how aria2 binds to your local hardware interfaces, especially useful for multi-homed servers or VPN setups.
Proxy Configurations
aria2 natively supports HTTP and SOCKS5 proxy servers, SSL verification overriding, and explicit IPv6 bindings.
Security & Encryption
For BitTorrent transfers, you can force encryption to bypass ISP snooping or throttling. You can also define strict SSL certificate requirements for secure HTTP links.
Daemon Services
Run aria2 completely decoupled in the background. Essential for building VPS, Seedbox, and headless server environments.
RPC Subsystems (Remote Control)
The JSON-RPC interface allows you to send commands to aria2 from remote servers, mobile apps, or web GUIs like AriaNg.
| Method | Description |
|---|---|
aria2.addUri |
Adds a new HTTP/FTP/SFTP download. |
aria2.addTorrent |
Adds a BitTorrent download by uploading a .torrent file. |
aria2.tellStatus |
Returns progress/status for a specific GID. |
aria2.pauseAll |
Pauses all active downloads instantly. |
aria2.getOption |
Retrieves config flags for a specific GID. |
Event Hooks & Scripting
Trigger automated tasks using Aria2's built-in event listeners. You can parse variables like File Paths and GIDs into external bash environments.
The Perfect aria2.conf
Define rigid engine mechanics in your static configuration file (typically
~/.aria2/aria2.conf) to avoid manual flags.
Environment Variables
aria2 natively parses standard operating system proxy variables from your terminal profile.
| Variable | Description |
|---|---|
http_proxy |
Default proxy for HTTP requests. |
https_proxy |
Default proxy for HTTPS requests. |
all_proxy |
Global proxy server. |
no_proxy |
Domains to bypass proxy routing. |
Understanding Console Progress
Real-time snapshot strings provided by the console engine.
[#GID 123MB/456MB(27%) CN:16 DL:5.2MB UL:12KB ETA:1m45s]
- GID: Task unique identifier.
- CN: Active connections.
- DL / UL: Current speeds.
- ETA: Estimated time remaining.
Technical Files & Formats
Binary layouts and state files used under the hood.
| File | Purpose |
|---|---|
dht.dat |
Stores the DHT routing table (Binary). |
.netrc |
Automatic HTTP/FTP credentials. |
aria2.session |
Pause/resume session state. |
*.aria2 |
v1 Binary control files (Big Endian). |
machine example.com login user password password
Exit Status Codes
Parse $? in scripts to handle failures gracefully.
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | Unknown Error |
| 3 | 404 Not Found |
| 9 | Disk Full |
Power User Tips & Units
K/M: Decimal (1000)
- Ki/Mi: Binary (1024)
Infinity: Use
- or 0 for unlimited.
Developer Integration (libaria2)
Modern C++11 library interface.