Why

I Need a better downloader that is on a server somewhere, it should have segmented downloads, It can have mutliple connections to a single download file that can maximize download speeds, The second problem to solve is that the media server if something has to be downloaded and watched, it has to be a torrent file, if its a direct file, the server, currently I have to login to a server and download with wget or aria2 via terminal.

Finding the right solution to selfhost.

I know of https://github.com/aria2/aria2 existence, I used to use this long ago when downloading things directly to server. it has a lot of features that I looked for and on top of that even more.

  • Command-line interface
  • Download files through HTTP(S)/FTP/SFTP/BitTorrent
  • Segmented downloading
  • and believe me there are lots more, check the official github repo link.. i’ve provided.

The frontend

My thought process is this, this is a command line utility, how will I use it with gui..? there are already similar projects which are called frontends for an already existing terminal utilites. so a quick google search, lead me to this project. https://github.com/mayswind/AriaNg?tab=readme-ov-file , I liked the ui and it proviced all the configs and how it can configured.

Iimage showing aria2 initial configuration notice the port of the service, its 443, since im running on https and behind reverse proxy. Notice the secret token, this is important, without this, the FE will fail to connect.

Need a way to run it,

I was ready to spend hours on this to configure, figure out how to integrate these too separate programs.. but then since it has a lot of popularity.. 10k+ starts on github, I searched for any existing solutions, that it might already have, which lead me to the finding of this project: https://github.com/hurlenko/aria2-ariang-docker, Now I have an existing project that I can self host. I just need to run it on my server with custom configurations and reverse proxy it on my existing server which has nginx running. at some point I have to check out and configure caddy.. but thats for another day.

image showing aria2 download options

Configurations

I use podman to run all the services instead of docker, so based on the docker image, I came up with the following command to run it on my server.

Docker/ Podman

podman run -d \
  --name=aria2-ui-idm \
  -e ARIA2RPCPORT=6800 \
  -e RPC_SECRET=<REDACTED> \
  -p 5050:8080 \
  -p 6800:6800 \
  -v /mnt/torrents:/aria2/data \
  -v /var/oled/aria2/config:/aria2/conf \
  --restart unless-stopped \
  docker.io/hurlenko/aria2-ariang:latest

Next comes the nginx config, I use the following nginx configuration to reverse proxy the requests to the aria2 container. Port 5050 is the web ui port.

    # Proxy requests to the Ariang Web UI
    location / {
        proxy_pass http://127.0.0.1:5050;
        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;
        proxy_read_timeout 999999999;
    }

Now the frontend has to connect to the aria2 rpc service, which is exposed on port 6800 on the container, so we are proxying that too.

    # Proxy WebSocket requests to the Aria2 RPC service
    location /jsonrpc {
        proxy_pass http://127.0.0.1:6800/jsonrpc;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection "upgrade";
        proxy_set_header Host $host;
        
        # Set a long timeout for the RPC connection
        proxy_read_timeout 999999999;
    }
}

I also configured ssl on the server, but ignoring it here on explanations.

How it works

The FE layer connect with the terminal utility through post request or websocket, we have to configure the first time we land on the Frontend UI, these requests have to be authenticated and have a secret token, that must be configured on the server.

image showing download options

image showing segmented download

Summary

In combination with media server, torrent and downloader, Its easier for me to get anyting on the media server/ download anything that I need, I’ve also configured copy party on my server, so Its easy to manage, download/ uplaod files on my server now, I’ll write about it someday. A long waiting requirement that I’ve been putting off..is finally done.

Personal updates

I thought of holding off marriage, due to recent events, I think its best that I didn’t rush through marriage and take decisions drastically (I’ve updated this section on oct 15’th 2025). As for my counter part, she agreed on the same, though I initially asked her to wait, she also thinks waiting for now is the best way forward.. for people who dont’ follow or in some weird case.. if I dont follow.. read back the previous posts.

I want to look back to this one day in the future and add comments/ updates and see how I feel.