Where Does aria2 Look for Its Config File on Linux?
The lightweight, multi-protocol command-line download utility
aria2 relies on a specific initialization file,
typically named aria2.conf, to load user-defined download
preferences, speed limits, and session settings automatically. On a
Linux system, aria2 searches for this default configuration file in a
strict, predefined hierarchy of directories, primarily looking within
the user’s home folder under standard XDG Base Directory layouts before
falling back to global system paths. Understanding these exact locations
allows users to easily customize their download environment without
needing to pass repetitive command-line flags during every
execution.
Default Search Paths for aria2.conf
When you launch aria2 without specifying a configuration file via the
--conf-path flag, the utility scans the following locations
in order. It will apply the settings from the first file it successfully
finds and ignores the rest.
$XDG_CONFIG_HOME/aria2/aria2.confThis is the modern standard location. If the$XDG_CONFIG_HOMEenvironment variable is not explicitly set, it defaults to~/.config/aria2/aria2.conf.$HOME/.aria2/aria2.confThis is the legacy location. If you created your configuration file here in older versions of aria2, the utility still checks this path for backwards compatibility.
Note: By default, aria2 does not automatically create this file upon installation. If the directories and the
aria2.conffile do not exist in your home directory, you must create them manually using a text editor or terminal commands.
Creating the Configuration File
If you want to set up your default configurations, you can quickly generate the directory and file in the preferred XDG path by running the following commands in your Linux terminal:
mkdir -p ~/.config/aria2
touch ~/.config/aria2/aria2.confOnce created, you can populate this file with your favorite
persistent settings, such as max-concurrent-downloads=5 or
continue=true, ensuring aria2 always behaves exactly how
you want upon startup.