# Install Web Based Download Utility with AriaNg on Debian/Ubuntu

## Quick Setup

1. Log into the Linux device
2. Run the following commands in a terminal window
   # update software repositories
   sudo apt update
   # install available software updates
   sudo apt upgrade -y
   # install aria2
   sudo apt install aria2 -y
   # run the aria2 RPC server
   sudo aria2c --dir=/home/$USER/Downloads --enable-rpc=true --rpc-allow-origin-all=true --rpc-listen-all=true --rpc-listen-port=6800 --rpc-secret=SomethingSecure -D
3. Open a web browser and navigate to https://github.com/mayswind/AriaNg/releases
4. Download the latest AllInOne.zip release
5. Extract the AllInOne .zip file
6. Double click the extracted index.html to open it in the default web browser
7. Select AriaNg Settings from the left navigation menu
8. Select the automatically generated RPC connection in the top sub-navigation menu
9. Scroll down to the Aria2 RPC Secret Token field and paste the rpc-secret string, SomethingSecure in this example
10. Click the Reload AriaNg button on the notification popup
11. The AriaNg will now be able to communicate with aria2 over RPC

## Starting Aria2 on System Boot

1. Run the following commands in a terminal window
   # kill aria2 if it is running
   sudo killall aria2c
   # create aria2 conf directory
   sudo mkdir /etc/aria2 -p
   # create aria2.conf
   sudo nano /etc/aria2/aria2.conf
2. Paste the following into the aria2.conf file

   dir=/home/i12bretro/Downloads
   enable-rpc=true
   rpc-allow-origin-all=true
   rpc-listen-all=true
   rpc-listen-port=6800
   rpc-secret=SomethingSecure

3. Press CTRL+O, Enter, CTRL+X to write the changes to aria2.conf
4. Continue with the following commands in terminal
   # create the service file
   sudo nano /etc/systemd/system/aria2.service
5. Paste the following into the aria2.service file

   [Unit]
   Description=Aria2c
   Requires=network.target
   After=dhcpcd.service

   [Service]
   ExecStart=/usr/bin/aria2c --conf-path=/etc/aria2/aria2.conf

   [Install]
   WantedBy=default.target

6. Press CTRL+O, Enter, CTRL+X to write the changes to aria2.service
7. Continue with the following commands to start the new service on system boot
   # set the service to start on system boot
   sudo systemctl enable aria2
   # start the service now
   sudo systemctl start aria2
8. Reboot the system
9. Once the system comes back up, relaunch ariang in a web browser and verify it can connect to the aria2 RPC server