Hi there, I want to share a very easy way to use your Raspberry Pi as a download web server with the help of Aria2 download tool. According to Aria2 Official Website: “aria2 is a lightweight multi-protocol & multi-source command-line download utility. It supports HTTP/HTTPS, FTP, SFTP, BitTorrent and Metalink. aria2 can be manipulated via built-in JSON-RPC and XML-RPC interfaces“. As you can see, this is a very flexible download tool available for Linux, Windows and Android. Today I want to show you how to use Aria2 through a Web User Interface.
Step #1: Installing the Web Server
You can install Aria2 on Raspbian / Ubuntu / CentOS / Fedora just search for “aria2” on your OS package manager. I’m using Raspberry Pi OS lite (Bullseye – 2022.04.04) via Berryboot to setup the download server, this will also work on its Standalone version (as well on any single board computer that runs Debian / Ubuntu / CentOS). Perform a full upgrade on the system by executing:
sudo apt update -y; sudo apt upgrade -y; sudo apt dist-upgrade -y; sudo apt autoremove -y
Once the upgrade is completed, reboot your Raspberry Pi by executing:
sudo shutdown -r now
Install the web server and requeried tools by executing:
sudo apt install lighttpd aria2 screen -y
Now remove the index.html file from the web server default directory and make a new directory for aria2, you can do that by executing:
sudo rm -f /var/www/html/index*.html; sudo mkdir /var/www/html/aria2
Enable Lighttpd autoindex module by editing its config file:
sudo nano /etc/lighttpd/lighttpd.conf
Add these follwing lines at the end of the file:
dir-listing.activate = "enable" $HTTP["url"] =~ "^/*($|/)" { dir-listing.activate = "enable" }
Lastly, restart Lighttpd by executing:
sudo systemctl restart lighttpd
Step #2: Downloading AriaNg
AriaNg is “a modern web frontend making aria2 easier to use”. To download the latest version (AllInOne) go to the GitHub Releases Page. You can do that in Raspbian by executing:
wget https://github.com/mayswind/AriaNg/releases/download/1.2.3/AriaNg-1.2.3-AllInOne.zip; sudo unzip AriaNg*.zip -d /var/www/html/aria2
Aria2 will take default settings from a file, let’s create it in case you need it in the future:
sudo mkdir $HOME/.aria2; sudo touch $HOME/.aria2/aria2.conf
It also require to start Aria2 as RPC-server as a background task, to do that you can use “screen” and “crontab“. Now I’ll use “screen” to start Aria2 as RPC-server in the background at every reboot, you can do that by executing:
crontab -e
I use nano to add/modify crontab tasks. Add the following command line:
@reboot screen -d -m -S AriaRPC bash -c 'aria2c --enable-rpc --rpc-listen-all --rpc-allow-origin-all=true'
Once that is done, press Ctrl+O to save the task, press enter and press Ctrl+X to exit nano. Reboot your device with:
sudo shutdown -r now
Step #3: Finding Your Local IP Address
You can find what IP is using your Raspberry Pi by executing this command:
sudo ifconfig
You will see something like:
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet 192.168.1.105 netmask 255.255.255.0 broadcast 255.255.255.255 inet6 fe80::ba27:ebff:fe21:1233 prefixlen 64 scopeid 0x20<link> ether b8:27:eb:21:12:33 txqueuelen 1000 (Ethernet) RX packets 14738 bytes 4049731 (3.8 MiB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 11846 bytes 3295441 (3.1 MiB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
My Raspberry Pi is using: 192.168.1.105 at my end.
Step #4: Starting to Download Files
Once you know your Raspberry Pi local address, type it in your browser plus the aria2 directory, example:
192.168.1.105/aria2
You will see something like:
Step #5: Installing JDownloader
As you may know, JDownloader is a very popular download manager that have a huge community of developers and users, now you can install JDownloader on your Raspberry Pi and manage your JDownloader downloads through My JD website. You will need an account there in order to use this service. Now install a minimal Java runtime by executing this command line:
sudo apt install openjdk-8-jre-headless -y
Once that’s completed, download and install JDownloader by executing this single line:
sudo mkdir /media/jdownloader && sudo wget -O /media/jdownloader/JDownloader.jar http://installer.jdownloader.org/JDownloader.jar
Now start JDownloader service by executing this command line:
sudo java -Djava.awt.headless=true -jar /media/jdownloader/JDownloader.jar
Now JDownloader will start and will update itself, wait for that to complete, after that, reboot your Raspberry Pi. Once again, start JDownload service again and now it will ask for your login details (email and password – same as My JD website), once the login is completed, you can now manage your JDownloader downloads through My JD.
Quick suggestion: to start JDownloader service at every boot, you can add this line to crontab:
@reboot java -Djava.awt.headless=true -jar /media/jdownloader/JDownloader.jar
Also it’s a good idea to change the default download directory, do that through My JD website > Settings > Default Download Folder, click the directory icon next to it and click: “Choose another folder“, the ideal path should be: “/var/www/html“.
Step #6: Installing Plowshare
Plowshare is a quite useful tool to download files from several cloud-storage severs. According to its official GitHub page: “Plowshare is a set of command-line tools (written entirely in Bash shell script) designed for managing file-sharing websites (aka Hosters).” This can be a good alternative to JDownloader. The only way to get this work is by installing it from its source, do by executing:
sudo apt install git build-essential nodejs -y; sudo git clone https://github.com/mcrapet/plowshare.git; cd plowshare; sudo make install; cd ../; sudo rm -rf plowshare; sudo plowmod --install
Use plowdown to download a file, example:
cd /var/www/html; sudo plowdown https://www1.zippyshare.com/v/x/file.html
Here is current hosters support list.
Conclusion
Now you can download as many file as you want from all over the internet, just be sure to have enough space on your SD card or USB drive.
Any suggestion? Leave a comment.
Looks good, this actually is the only post that includes these tools all at once but it is outdated, please update it. Keep the good work.
Loved the guide, easy to follow up.
As someone that arrived here looking for an alternative to jdownloader isn’t clear to me (still) if I’m able to use plugins in Aria for services like nitroflare.
An improvement to this guide would be a crontab entrance for jdownloader using screen or explaining the meaning of the screen options selected for Aria.
Anyway, thank you for the guide.
Apreciate it
Hi there, I’ve updated the post and now include the tool: plowshare, this may work with nitroflare. Let me know any question.
[…] [Raspberry Pi] Aria2 Web UI [Updated June 2020] […]
Yes, that’s happen on my end too. Quick workaround: http://magnet2torrent.com/
If you copy/paste the commands the — part turn into one solid dash inside crontab. jfyi
Hi Jimmy, thanks for report the issue, is now solved.
Hi!
Good article and a very good guide for installation.
But actually I’m not able to access pi hole admin site. I only get that content of the pi hole website not the website itself.
Sorry for the maybe stupid question, but I’m very new to Raspberry and Linux and configuration.
Thanks for your help.
Hi there, I haven’t tested Pi-Hole but I use these adblocker DNS. I think AdGuard Home is much better than Pi-Hole, take a look here.
Hey don’t use apache, please use nginx which is more faster…
Hi Alexander, I have install AriaNG, but now I see there is v1.1.6 version that is more recent, v1.1.1 is 1year old. how to update?
and second I have follow guide for jdownloader but when finish on terminal it don’t ask me nothing for insert myjdownloader credential.
Please help.
Hi Stephen, to update AriaNG is quite easy, just follow the first command line in the: Step #2: Download AriaNg and confirm to overwrite the files. About jDownloader, can you see any error code or error message? Can you send me an screenshot?
Hi Alexander, I have tried to repeat all passages, in fact changed number of version and downloaded 1.1.6 but ariang remain always 1.1.1,also after several reboot
Hi Stephen, be sure to download the 1.1.6 zip file, if the issue is still present, that seems a browser cache issue at your end, try to refresh the AriaNG page by pressing ctrl+r.
ok I have solved in alternative using it on docker, now I have 1.1.6, but there is a same problem like standalone app about after a reboot all setting that I have changed on ariang are lost (example: max connection per file, prealloc, falloc etc.) all return to default.
Instead for jdownload I don’t have any error, I’m on headless mode so I use putty and after I have this, what do after? https://1drv.ms/u/s!Am-E9cNGrpCX9SE6rEAjZwt9m3lt?e=8rnUwe
Hi Stephen, to save settings in AriaNG you must create a file named “aria2.conf” as I describe it in the second line command at Step #2: Download AriaNg This a good example of what settings that file should have. About jDownloader, I see that it made a regular update, what you need to do is start it again by executing
java -Djava.awt.headless=true -jar /media/jdownloader/JDownloader.jar
, after that it should ask the login details. Let me know if your issues get resolved.Hey can you include jdownloader? Please
Hi Victor, that sounds great. Thanks for the suggestion.
Hi Victor, done, now you can manage JDownloader downloads through MY JD.
Really easy ! Thank you!
THANK YOU!!!