Linux

How to Install WebUI-aria2 on Ubuntu Server Latest

How to Install WebUI-aria2 on Ubuntu Server Latest

If you’re looking for a powerful and user-friendly way to manage your downloads on Ubuntu Server, installing WebUI-aria2 is an excellent choice. aria2 is a lightweight multi-protocol & multi-source command-line download utility, and when combined with a web interface, it becomes even more powerful and accessible. In this comprehensive guide, we will walk you through the installation process of WebUI-aria2 on the latest version of Ubuntu Server, along with some tips on how to use it effectively.

What is WebUI-aria2?

WebUI-aria2 is a web-based user interface for aria2, allowing users to manage downloads easily from any web browser. It offers features such as drag-and-drop support, a clean user interface, and the ability to monitor and control downloads from a remote location. By installing WebUI-aria2, you can leverage the full capabilities of aria2 in a convenient and accessible format.

Step 1: Update Your Server

Before you begin the installation, it’s crucial to update your package list to ensure that you have access to the latest software versions. Open your terminal and run:

sudo apt update && sudo apt upgrade -y

This command refreshes your package index and upgrades any outdated packages on your server.

Step 2: Install Required Packages

To use WebUI-aria2, you need to install aria2 and a web server. We will use Nginx for this purpose, but you can choose another web server if you prefer. To install aria2 and Nginx, run the following command:

sudo apt install aria2 nginx -y

This command installs both aria2 and Nginx on your Ubuntu Server.

Step 3: Configure aria2

After installing aria2, you need to create a configuration file to customize its settings. Create a new directory for aria2 and then create a configuration file:

mkdir -p ~/.aria2
nano ~/.aria2/aria2.conf

Add the following configuration to the aria2.conf file:

# Basic configuration
dir=/var/www/html/downloads
file-allocation=prealloc

# Enable RPC
enable-rpc=true
rpc-listen-all=true
rpc-allow-origin-all=true

# Set up RPC authentication
rpc-user=your_username
rpc-passwd=your_password

# Optional settings
max-connections-per-server=4
split=4
Make sure to replace your_username and your_password with your preferred username and password for RPC authentication. Save the file and exit.

Step 4: Create a Downloads Directory

Now, create the downloads directory that aria2 will use to store downloaded files:

sudo mkdir -p /var/www/html/downloads
sudo chown -R $USER:$USER /var/www/html/downloads

This directory will serve as the storage location for all your downloads initiated through WebUI-aria2.

Step 5: Start aria2

You can now start aria2 with the following command:

aria2c –conf-path=~/.aria2/aria2.conf

This command launches aria2 using the configuration file you just created. To keep it running in the background, you can use screen or tmux, or you can create a systemd service.

Step 6: Set Up a Systemd Service (Optional)

If you want aria2 to start automatically on boot, you can create a systemd service file. Create a new service file:

sudo nano /etc/systemd/system/aria2.service

Add the following content to the file:

[Unit]
Description=aria2c daemon
After=network.target

[Service]
User=your_username
ExecStart=/usr/bin/aria2c –conf-path=/home/your_username/.aria2/aria2.conf
Restart=always

[Install]
WantedBy=multi-user.target
Make sure to replace your_username with your actual username. Save the file and exit.

Enable and start the service with the following commands:

sudo systemctl enable aria2.service
sudo systemctl start aria2.service

Step 7: Install WebUI-aria2

Now that aria2 is set up, you can download and install WebUI-aria2. Navigate to the Nginx web root directory and clone the WebUI-aria2 repository:

cd /var/www/html
sudo git clone https://github.com/ziahamza/webui-aria2.git

Next, you need to set the proper permissions for the cloned directory:

sudo chown -R www-data:www-data webui-aria2
sudo chmod -R 755 webui-aria2

Step 8: Configure Nginx

You need to configure Nginx to serve the WebUI-aria2 files. Create a new configuration file:

sudo nano /etc/nginx/sites-available/aria2

Add the following configuration to the file:

server {
listen 80;
server_name your_server_ip_or_domain;

location / {
root /var/www/html/webui-aria2;
index index.html;
}

location /downloads {
alias /var/www/html/downloads;
}

location /rpc {
proxy_pass http://localhost:6800/rpc;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Replace your_server_ip_or_domain with your server’s IP address or domain name. Save the file and exit.

Enable the new site configuration by creating a symbolic link:


sudo ln -s /etc/nginx/sites-available/aria2 /etc/nginx/sites-enabled/

Finally, test your Nginx configuration for errors and restart the service:

sudo nginx -t
sudo systemctl restart nginx

Step 9: Access WebUI-aria2

You can now access the WebUI-aria2 interface by navigating to http://your_server_ip_or_domain in your web browser. Log in using the username and password you configured in the aria2.conf file.

From the WebUI, you can start adding downloads, manage your tasks, and monitor the progress of your downloads easily.

Conclusion

Installing WebUI-aria2 on your Ubuntu Server is a great way to manage your downloads efficiently. With the combination of aria2 and a web interface, you gain powerful capabilities for handling multiple downloads simultaneously, all while enjoying a user-friendly experience.

By following the steps outlined in this guide, you should now have a fully functional setup of WebUI-aria2 on your Ubuntu Server. Whether you’re downloading files for personal use or managing large data sets, this setup will streamline your downloading process and improve your overall productivity. Enjoy your new download manager!

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button