Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Aria2c systemd service
continue
dir=/var/www/downloads
file-allocation=trunc
max-connection-per-server=4
max-concurrent-downloads=2
max-overall-download-limit=0
min-split-size=25M
[Unit]
Description=Aria2c download manager
After=network.target
[Service]
Type=simple
User=www-data
ExecStart=/usr/bin/aria2c --console-log-level=warn --enable-rpc --rpc-listen-all --conf-path=/etc/aria2.daemon
[Install]
WantedBy=multi-user.target
@minherc

This comment has been minimized.

Copy link

@minherc minherc commented Jan 29, 2021

it's worked !
)

more to aria2.daemon:

##files
dir=/user/downloads
file-allocation=falloc
continue=true
daemon=true
disk-cache=32M

##logging
log=/user/aria2/aria2.log
console-log-level=warn
log-level=notice

##downloads
max-concurrent-downloads=5
max-connection-per-server=5
min-split-size=20M
split=4
disable-ipv6=true

##sessions
force-save=true
input-file=/user/aria2/ses/aria2.session
save-session=/user/aria2/ses/aria2.session
save-session-interval=10

##security
http-auth-challenge=true
check-certificate=false
enable-rpc=true
rpc-listen-all=true
rpc-secret=*YOUR TOKEN*

#rpc-secure=true	
#rpc-allow-origin-all=true
#rpc-certificate=/user/aria2/cet/aria2.pfx

##ports
rpc-listen-port=6800

##others
summary-interval=120
enable-dht=true

##times
timeout=600
retry-wait=30
max-tries=50
```
@Pound-Hash

This comment has been minimized.

Copy link

@Pound-Hash Pound-Hash commented Nov 22, 2021

Thanks guys.

I couldn't set User=www-data. It wouldn't work with this user, and if I omitted the setting, then all the saved files were owned by root. So I changed this to User={myusername}. There's also no need to run the arguments after the aria2c binary since the daemon can pass those same arguments anyhow (i.e., --console-log-level=warn --enable-rpc --rpc-listen-all). Lastly, the documentation states that file-allocation=falloc is best for newer file systems, e.g., ext4. I think that's what most Linux users have, especially newbies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment