How to Limit Aria2 Download Speed on Ubuntu Linux
This article provides a step-by-step method to restrict the global download bandwidth for aria2 on Ubuntu. It covers both temporary command-line flags and persistent configuration file settings to ensure you maintain control over your network usage during downloads.
Install Aria2
If you have not already installed aria2, open your terminal and run the following command to install it from the Ubuntu repositories:
sudo apt update
sudo apt install aria2Limit Speed via Command Line
To set a global download limit for a single session, use the
--max-overall-download-limit option followed by your
desired speed. You can specify the size using K (kilobytes) or M
(megabytes).
For example, to limit the total download speed to 1 megabyte per second:
aria2c --max-overall-download-limit=1M [URL]To limit the speed to 500 kilobytes per second:
aria2c --max-overall-download-limit=500K [URL]Setting the value to 0 removes the limit entirely.
Limit Speed via Configuration File
To make the speed limit permanent for all future downloads, you
should edit the aria2 configuration file. Create or open the
configuration file located at ~/.aria2/aria2.conf. If the
directory or file does not exist, you can create them using the
following commands:
mkdir -p ~/.aria2
touch ~/.aria2/aria2.confOpen the file in a text editor such as nano:
nano ~/.aria2/aria2.confAdd or modify the following line to set your global download limit:
max-overall-download-limit=1M
Save the file and exit the editor. Any subsequent aria2 commands will now adhere to this limit automatically.
Verify the Settings
You can verify that the limit is active by starting a download and
observing the speed output in the terminal. If you are using aria2 with
the RPC interface, you can also change this setting on the fly without
restarting the service by using the
aria2.changeGlobalOption method with the
max-overall-download-limit parameter.