[HowTo] Running Adguard Home on OpenWrt

Can you please guide me through this changes? I'm easily lost in linux.

Something like this:

sed -i -e "\$i (sleep 20; /etc/init.d/AdGuardHome restart) &" /etc/rc.local
1 Like

sed -i -e "$i (sleep 20; /etc/init.d/AdGuardHome restart) &" /etc/rc.local

Is the S99 move covered in this cmd? Forgive my ignorance.

I reading topic from GL-Inet and device with less than 256Mo seem difficult to execute AGH.

No, but it is not necessary since rc.local is called after all the SXX scripts.

1 Like

Still in snapshot ? Not available “as is” in release...

I’ve executed the cmd and restarted the router but unfortunately the AdGuardHome did not start. I had to start it manually.
Am I missing something?

Paste here the contents of rc.local to verify that it is correct.

I do not understand your comment.

The AdGuardHome package is not available in 19.07.4, but only in SNAPSHOT...

Ah. Yes, I had already said that in a previous comment.

У меня работает на 19.07.4. Правда никак не могу настроить , чтобы порно сайты полностью блокировал, и рекламу, и DNS-over-TLS работал.

Below is what I got on /etc/rc.local after executing the suggested "sed" cmd:

start-stop-daemon -S -b -x /mnt/sda1/AdGuardHome/AdGuardHome
(sleep 20; /etc/init.d/AdGuardHome restart) &
exit 0

I am using 19.07.4 and it is not available as an opkg package. For SNAPSHOT images it is available through opkg as @castillofrancodamian has said.

Is it possible to update Adguard Home after setting it up by manually installing it using wget?

Update is already supported by AdGuardHome itself

1 Like

Some observations after 1 week of using AdGuardHome (0.104-1) in R7800 with master build and AdGuardHome compiled in (not in external usb drive).

  1. My main target was easy DoH implementation using Cloudflare
  • Works very well and feels as snappy as DoT earlier (stubby+dnsmasq+Cloudflare)
  • For DNS duties, dnsmasq was replaced with AdGuardHome
  1. At the same time replaced earlier used Adblock package (including Luci interface)
  • Using the same block lists in AdGuardHome as in earlier adblock package
  • 300k block list in adblock <> 500k in AdGuardHome --> Beside different presentation, I assume AdGuardHome does not do any sorting and deletion of duplicates as adblock package does
  1. Memory footprint when AdGuardHome built in (R7800 with above 500k block list)
  • With default 24h Query log retention it killed my box in 1 day with Oom-reaper killing the AdGuardHome (one culprit was my Sony Android TV that is very "vocal" in terms of DNS queries even in stand-by) --> AdGuardHome service did not recover from this Oom incident (unlike dnsmasq in earlier oom-reaper kills) and dns resolution was gone (during the WFH).
  • Disabled log writings in AdGuardHome, pulled out the cable from Sony TV and clearing the query logs seem to help although memory usage is still way higher than with adblock package with the same block lists.
  1. System load
  • Based on just eyeballing Luci statistic it seems AdGuardHome is consuming less system resources than dnsmasq before the change

Beside initial hiccups I will continue to use AdGuardHome and most likely will move it to external USB drive to release more usable memory in my R7800.

Combining/sorting/removing duplicates from different blocks list in AdGuardHome could help in memory consumption in these regular consumer boxes supported by OpenWRT if AdGuardHome is built-in.

With the help from forum (thanks @erdoukki) and basic skills it was pretty easy to implement but requires manual config file changes.

PS: updates to initial message (@brokenpipe) could do some service if people are just copy/pasting the instructions as current version is 0.104.1 already

1 Like

I'm still struggling to get AdGuardHome starting on boot. Whenever the router reboots I've to start AdGuardHome manually.
The boot process fails to boot the script:

S95AdGuardHome -> ../init.d/AdGuardHome*

Nor the local script is started:

start-stop-daemon -S -b -x /mnt/sda1/AdGuardHome/AdGuardHome
(sleep 20; /etc/init.d/AdGuardHome restart) &
exit 0

I'm running out of options and I might have to revert the change uninstalling AdGuardHome.
Is there any other manual script I can use for the boot process?

[Update]: I've finally resolved the issue with AdGuardHome startup. There was an error with the mounted disk requiring a file system check. After firing the e2fsck cmd and fixing the errors, AdGuardHome was started as a service normally (S95AdGuardHome). No need to run the /etc/rc.local script.

I've cloned my root directory onto a USB 3.0 flash drive using extroot and whatever I do I can't seem to be able to get AdguardHome installed (Router - Newifi D2 OpenWrt 19.07.4 r11208-ce6496d796 / LuCI openwrt-19.07 branch git-20.341.57626-51f55b5).
Using the curl command on the ADH github page I get:

oot@OpenWrt:~# curl -sSL https://raw.githubusercontent.com/AdguardTeam/AdGuardH
ome/master/scripts/install.sh | sh -s edge
[info] Starting AdGuard Home installation script
[info] Channel edge
head: /bin/bash: No such file or directory
[info] Script called with root privileges
[info] AdGuard Home will be installed to /opt/AdGuardHome
[info] Downloading package from https://static.adguard.com/adguardhome/edge/AdGuardHome_linux_mips_softfloat.tar.gz -> AdGuardHome_linux_mips_softfloat.tar.gz
[info] Unpacking package from AdGuardHome_linux_mips_softfloat.tar.gz -> /opt
/opt/AdGuardHome/AdGuardHome: line 1: syntax error: unexpected "("
[error] Cannot install AdGuardHome as a service

And when trying to execute it in place I get a similar:

syntax error: unexpected "("

Any ideas what I'm doing wrong here?

1 Like

I recommend you update your topic to leave aside the manual installation.

Does anyone find this brakes the package manager?

Every time I enforce Adguard as the new DNS OpenWRT package manager is unable to update the list?