How to install WebUI-aria2 on nixOS Latest

This tutorial will guide you through the process of installing WebUI-aria2, a web interface for the Aria2 download utility, on nixOS Latest. The steps outlined below assume that you have administrative privileges and are familiar with basic terminal commands.

Step 1: Install Aria2

Before we can use WebUI-aria2, we need to install Aria2. Use the following command in your terminal to install Aria2 on your system:

sudo nix-env -i aria2

Step 2: Download and Extract WebUI-aria2

Next, we need to download and extract the WebUI-aria2 package from its Github repository. Navigate to the directory where you want to install WebUI-aria2 and use the following command to download and extract the package:

sudo curl -L -o webui-aria2.zip https://github.com/ziahamza/webui-aria2/archive/master.zip
sudo unzip webui-aria2.zip
sudo mv webui-aria2-master webui-aria2

Step 3: Configure Aria2 and WebUI-aria2

Now that we have both Aria2 and WebUI-aria2 installed, we need to configure them to work together.

First, create a new configuration file for Aria2 using the following command:

sudo nano /etc/aria2.conf

Add the following lines to the configuration file:

# File: /etc/aria2.conf

enable-rpc=true
rpc-allow-origin-all=true
rpc-listen-all=true

Save the configuration file and exit the editor.

Next, we need to configure WebUI-aria2 to use our Aria2 installation. Open the conf.js file located in the webui-aria2 directory using the following command:

sudo nano webui-aria2/conf.js

Find the following line in the conf.js file:

var rpc = new $.jsonRPCClient({url: '/jsonrpc'});

Replace it with the following line:

var rpc = new $.jsonRPCClient({url: '/rpc', username: 'username', password: 'password'});

Replace username and password with your desired login credentials.

Save the file and exit the editor.

Step 4: Serve WebUI-aria2 using Lighttpd

Finally, we need to serve the WebUI-aria2 files using a web server. In this tutorial, we'll be using Lighttpd. Install Lighttpd using the following command:

sudo nix-env -i lighttpd

Next, we need to create a new configuration file for Lighttpd. Use the following command to create and open the configuration file:

sudo nano /etc/lighttpd/lighttpd.conf

Add the following lines to the configuration file:

# File: /etc/lighttpd/lighttpd.conf

server.document-root = "/full/path/to/webui-aria2"
server.modules += ( "mod_alias" )
alias.url += ( "/rpc" => "/jsonrpc" )

Replace /full/path/to/webui-aria2 with the full path to your WebUI-aria2 installation directory.

Save the configuration file and exit the editor.

Finally, start the Lighttpd web server using the following command:

sudo lighttpd -f /etc/lighttpd/lighttpd.conf

Step 5: Access WebUI-aria2 in Your Web Browser

Open your web browser and navigate to http://localhost:5050. You should be prompted to log in with the credentials you set in Step 3. Once logged in, you'll be able to use the WebUI-aria2 interface to manage your Aria2 downloads.

Congratulations! You've successfully installed and configured WebUI-aria2 on nixOS Latest.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!