Set Max Torrent Peers for aria2c on Ubuntu Linux
This guide explains how to limit or increase the maximum number of peers when downloading torrents using aria2c on Ubuntu. You will learn which command-line options and configuration file settings control peer connections to optimize bandwidth and stability.
To configure the peer limit temporarily, use the
--max-peers flag followed by an integer value when running
the command. A value of 0 sets the limit to unlimited.
aria2c --max-peers=100 "magnet_link_or_torrent_file"For a permanent configuration, edit the aria2 settings file located
at ~/.aria2/aria2.conf. If the directory or file does not
exist, create them using the mkdir and touch
commands.
mkdir -p ~/.aria2
nano ~/.aria2/aria2.confAdd the following line to the file to define the default maximum peers per torrent:
max-peers=100
Save the file and exit the editor. If you are running aria2c as a persistent service, restart it to apply changes. Otherwise, the new settings will apply to the next command you run.
systemctl restart aria2cAdjust the number based on your network capacity. Higher values may increase download speed but consume more resources.