Installing Aria2 and AriaNg on Linux for Web-Based Download Management
Installing Aria2 and AriaNg on Linux for Web-Based Download Management
Aria2 is a lightweight yet powerful command-line download utility that supports HTTP/HTTPS, FTP, SFTP, BitTorrent, and Metalink—all in one binary.
When paired with AriaNg, a modern web-based interface, you can turn any Linux server or VPS into a clean, fast, and fully remote-managed download center.
This guide covers how to install Aria2, configure RPC, deploy AriaNg, and manage everything through a browser.
1. Update Your System
Before installing anything, update your Linux environment:
sudo apt update && sudo apt upgrade -y(For CentOS/Rocky/AlmaLinux, use yum or dnf instead.)
2. Install Aria2
On Debian/Ubuntu:
sudo apt install aria2 -yOn CentOS/Rocky Linux/AlmaLinux:
sudo yum install epel-release -y
sudo yum install aria2 -yVerify installation:
aria2c -v3. Create Aria2 Configuration Directory
mkdir -p ~/.aria2Then create the main config file:
nano ~/.aria2/aria2.confPaste the recommended configuration:
dir=/downloads
enable-rpc=true
rpc-listen-port=6800
rpc-secret=yourpassword
continue=true
max-concurrent-downloads=5
split=16
min-split-size=10M
max-connection-per-server=16
input-file=/home/youruser/.aria2/aria2.session
save-session=/home/youruser/.aria2/aria2.session
save-session-interval=60
daemon=trueCreate session file:
touch ~/.aria2/aria2.session4. Create Downloads Directory
sudo mkdir -p /downloads
sudo chmod -R 777 /downloads5. Start Aria2 with Systemd
Create the service file:
sudo nano /etc/systemd/system/aria2.serviceInsert:
[Unit]
Description=Aria2c download manager
After=network.target
[Service]
Type=simple
User=youruser
ExecStart=/usr/bin/aria2c --conf-path=/home/youruser/.aria2/aria2.conf
Restart=on-abort
[Install]
WantedBy=multi-user.targetEnable and start service:
sudo systemctl daemon-reload
sudo systemctl enable aria2
sudo systemctl start aria2Check status:
sudo systemctl status aria26. Install AriaNg (Web UI)
AriaNg is a static HTML interface and works perfectly with Nginx.
Install Nginx:
sudo apt install nginx -yDownload AriaNg:
cd /var/www
sudo git clone https://github.com/mayswind/AriaNg.gitOr download release:
wget https://github.com/mayswind/AriaNg/releases/latest/download/AriaNg.zip
sudo unzip AriaNg.zip -d /var/www/ariang7. Configure Nginx for AriaNg
Create a new site:
sudo nano /etc/nginx/sites-available/ariangInsert:
server {
listen 80;
server_name _;
root /var/www/ariang;
index index.html;
}Enable:
sudo ln -s /etc/nginx/sites-available/ariang /etc/nginx/sites-enabled/
sudo systemctl restart nginxAccess AriaNg via browser:
http://your-server-ip/8. Connect AriaNg to Aria2
Inside the AriaNg interface:
Open Settings → RPC
RPC Address: http://your-server-ip:6800/jsonrpc
RPC Secret: the rpc-secret in your aria2.conf
Save and AriaNg will connect instantly.
9. (Optional) Enable HTTPS
For better security:
sudo apt install certbot python3-certbot-nginx -y
sudo certbot --nginxFAQ
- Why is AriaNg unable to connect to Aria2 RPC?
Most of the time it’s due to the firewall blocking port 6800. Open it with:
sudo ufw allow 6800Also verify that the rpc-secret matches in both Aria2 and AriaNg.
- Aria2 stops when I close the SSH session. How do I keep it running?
Make sure you are running Aria2 using systemd, not manually.
systemctl start aria2 keeps it running in the background.
- Can I set download speed limits?
Yes. Add the following to aria2.conf:
max-overall-download-limit=5M
max-download-limit=1MRestart Aria2 afterward.
- Does Aria2 support torrent or magnet links?
Yes. Aria2 handles both .torrent files and magnet links directly in AriaNg.
- How can I protect AriaNg from unauthorized access?
Enable HTTPS and optional Nginx password authentication:
sudo apt install apache2-utils
sudo htpasswd -c /etc/nginx/.htpasswd adminThen add to your server block:
auth_basic "Protected";
auth_basic_user_file /etc/nginx/.htpasswd;