Skip to content

Instantly share code, notes, and snippets.

@tazihad
Last active July 5, 2024 15:54
Show Gist options
  • Save tazihad/393efc134d59182c8817e7f5599854a1 to your computer and use it in GitHub Desktop.
Save tazihad/393efc134d59182c8817e7f5599854a1 to your computer and use it in GitHub Desktop.
setup aria2 using podman on linux with browser integration
  1. Install podman.
sudo dnf install podman # fedora
or 
sudo apt install podman # debian/ubuntu
  1. setup podman container.
mkdir -p ~/Downloads/aria2-pro-downloads
mkdir -p ~/.config/containers/systemd
mkdir -p ~/.config/aria2
touch ~/.config/containers/systemd/aria2-pro.container
nano ~/.config/containers/systemd/aria2-pro.container

copy paste the following:

[Unit]
Description=Podman Aria2-pro.service
Wants=network-online.target
After=network-online.target

[Service]
Restart=on-failure
TimeoutStartSec=900

[Container]
ContainerName=aria2-pro
Environment=PUID=1000 PGID=1000 UMASK_SET=022 RPC_SECRET=123456 RPC_PORT=6800 LISTEN_PORT=6888
Image=docker.io/p3terx/aria2-pro:latest
PodmanArgs=--log-opt 'max-size=1m'
AutoUpdate=registry
PublishPort=6800:6800
PublishPort=6888:6888
PublishPort=6888:6888/udp
Volume=%h/.config/aria2:/config:Z
Volume=%h/data/downloads/aria2-pro-downloads:/downloads:Z

[Install]
WantedBy=default.target
  1. Let's run the container using systemd.
systemctl --user daemon-reload
systemctl --user start aria2-pro.service
  1. Before we use the container. we have to fix some permissions. Enter the container and fix permissions.
podman exec -it aria2-pro /bin/sh
chown -R p3terx:p3terx /downloads
chmod 777 /downloads
  1. Install browser extension. We are going to use aria2-extension by @zluo01 Github page
    Chrome: https://chromewebstore.google.com/detail/aria2-integration-extensi/chehmbmmchaagpilhabnocngnmjllgfi?hl=en&authuser=0
    Firefox: https://addons.mozilla.org/en-US/firefox/addon/aria2-integration-extension/

  2. Open the extension 3 dot menu. Aria2NG UI will open up. Go to AriaNG settings -> RPC tab -> RPC protocol "websocket" -> RPC token = 123456.

This should connect with our podman container.

  1. Now let's enable the podman container at system startup.
systemctl --user enable aria2-pro.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment