RPC Connection
The application connects to aria2 via its JSON-RPC interface. Configure the connection in your.env file:
The host URL of the aria2 RPC server.Example:
http://localhost, http://192.168.1.100The port number aria2 RPC is listening on. Must match
rpc-listen-port in aria2.conf.RPC secret token for authentication. Must match
rpc-secret in aria2.conf.Root directory for downloaded files. Must match the
dir setting in aria2.conf.Example RPC Configuration
.env
Aria2 Configuration File
Thearia2.conf file contains aria2’s download and RPC settings. Default location: ./aria2.conf
Basic Settings
Directory to store downloaded files.
Path to session file for resuming downloads after restart.
Save error/unfinished downloads to this file on exit.
Save session every N seconds. Set to 0 to save only on exit.
Maximum number of parallel downloads.
Increase this value if you have high bandwidth and want to download multiple files simultaneously.
Continue downloading partially downloaded files.
Maximum overall download speed in bytes/sec.
0 means unrestricted.Example: 1M (1 MB/s), 512K (512 KB/s)Maximum download speed per download in bytes/sec.
0 means unrestricted.Suppress console output from aria2.
Advanced Settings
Restart download from scratch if control file doesn’t exist.
Allow downloads to proceed even if piece length differs from control file.
Always try to resume downloads. Abort if resume is not possible.
Enable asynchronous DNS resolution.
Automatically rename files if the same filename exists.
Handle Content-Disposition header as UTF-8 instead of ISO-8859-1.
Disk cache size. Data is cached in memory up to this size.Example:
16M, 64M, 128MLarger cache can improve performance but uses more memory.
File allocation method.Options:
none- No pre-allocationprealloc- Pre-allocate before download (slow)falloc- Fast allocation (recommended for ext4, btrfs, xfs, NTFS)trunc- Use ftruncate() system call
Don’t allocate space for files smaller than this size.
RPC Settings
Enable JSON-RPC/XML-RPC server.
Add Access-Control-Allow-Origin header with value
* to RPC responses.Listen on all network interfaces. Set to
false to listen only on localhost.Port for JSON-RPC/XML-RPC server. Must match
ARIA2_RPC_PORT in .env.Range: 1024-65535RPC secret authorization token. Must match
ARIA2_RPC_SECRET in .env.Enable SSL/TLS encryption for RPC. Requires
rpc-certificate and rpc-private-key.HTTP/FTP Settings
Maximum connections to a single server per download.
Higher values can increase download speed but may be throttled by some servers.
Minimum size to split downloads into chunks.Range:
1M - 1024MDownload files using N connections. Limited by
max-connection-per-server.User agent string for HTTP(S) downloads.
Set to mimic a BitTorrent client to avoid throttling from some sources.
BitTorrent Settings
TCP port range for BitTorrent downloads.Example:
6881-6999, 50101-50109Seed completed torrents until this share ratio is reached.
0.0 means unlimited.Seeding time in minutes.
0 disables seeding after download.Enable IPv4 DHT functionality and UDP tracker support.
Enable IPv6 DHT functionality.
UDP port range for DHT and UDP tracker.
Entry point to IPv4 DHT network.
Entry point to IPv6 DHT network.
Enable Peer Exchange (PEX) extension.
Prefix for peer ID. Mimics Transmission 2.77.
Client version string for BitTorrent extended handshake.
Comma-separated list of additional BitTorrent tracker announce URIs.
The default configuration includes a comprehensive list of public trackers for better peer discovery.
Starting Aria2
Start aria2 with the configuration file:Example Configuration
aria2.conf