[HowTo] Running Adguard Home on OpenWrt

The issue is that the OpenWRT version is significantly behind AdGuard's. its v104 vs 107.
There are a number of critical patches that fix things but the major issue is that the DNS/DHCP in AdGuard is sorely lacking. I'm struggling to find some proper documentation and reading the issues on their github they acknowledge that it has issues and needs some clean up. Its acutally causing me enough problems that i may switch DHCP back to OpenWRT and just use AdGuard for DNS.

Its not unfixable but they are in need of some patching to ensure better compatability with OpenWRT and to improve their DHCP issues (v4 dhcp is fine. its v6 dhcp and addititional options that need work)

Issues like this (which is fixed now but is not fixed in the OpenWRT version) https://github.com/AdguardTeam/AdGuardHome/issues/3053 are kinda concerning as it is basic stuff that should have been in from the get go.

Additionally. You can define "Clients" via Adguard and they are saved in the yaml file. but DHCP lease reservations are saved in the dhcp file which lives on the /tmp partiton and is thus lost when you reboot your router. Now if you have a perment usb hosted /tmp its not an issue but for the bulk of OpenWRT routers this is an issue. There is an open issue for getting DHCP leases to be saved in the yaml file like the client tags but it is still outstanding from last year.

In theory it should be a simplish fix but its a key one as you essentially have to redo your reservations because of it. Also the db file they use is non standard and thus i dont think you can back it up and replace it? (i've not tried but i havent figured out how it all works). Its just... irritating and thus for now till issues like that are fixed i will redo my router so OpenWRT handles dhcp v4 and 6 and just use AdGuard for the dns. Its abit sad thou cos in disabling dhcp on openwrt and just using adguard i got a good chunk of router memory back. (i think about 20mb) which on a 128mb router is significant.

:edit: just to clarify this. It was a combination of switching from RC1 to RC3 and then disabling openwrts dnsmasq and ohdcp so there is most likely some other savings in there too.

Let me know how your experience goes. I'm drawn in by the expressed efforts to eventually block stuff like sponsored ads that aren't captured via the DNS sinkhole methodology which I don't see Adblock doing in the future, but if even stable is that unstable/buggy perhaps I'll stick with Adblock for a good while yet.

The potential is definatly there. Just needs some polishing and tweaking.
It is a major rip and replace to make AdGuard do both DNS and DHCP. It does the DNS fine its just the DHCP that has issues. I just wanted it "simple" and thus make the network management easier as you had additional config to do if OpenWRT was doing DHCP but you could mitigate that by putting the Client data in AdGuard. I figured that by swapping it all to AdGuard that it would remove the extra configuration issues. Regrettably that is not the case. In time improvements will make it possible but i would not recommend using it in this fashion at this time.

By all means use it for DNS blocking but be aware that the DHCP issues are a problem. It also crashes due to out of memory errors. (I suspect that trimming the query logging down to 24hrs may improve things. It takes about a week before things get unstable. A reboot clears things up but that isnt a good fix when you have to rebuild the config as those tmp files are purged)
:edit: i should make this clear that is with the 104 version. I have yet to move to the latest AdGuard release and its possible they have fixed some of the issues.

Plzz Help me I have same problem, and I spent 3 days but couldn't find a fix. Plzzz Help I really tired.

(:edit: I didnt realise TheHellSite had his issue solved. Edited to remove him)

@khang.nguyenan6868 How did you install Adguard? Are you using the opkg install or did you install via the script on the adguard page? Do you have the ca-certificates or ca-bundles installed?

What does wget 'https://dns.google/' return when you try from an SSH shell?

wget 'https://dns.google/'
Downloading 'https://dns.google/'
Connecting to 8.8.8.8:443
Writing to 'index.html'

Download completed (1383 bytes)

I installed on the operating system openwrt 19, I download sure from https://github.com/AdguardTeam/AdGuardHome/releases/tag/v0.107.0-b.4
then I used Winscp to copy the file to my Pi 3, and I proceeded to extract and run, before that I followed the instructions https://forum.openwrt.org/t/howto-running-adguard-home -on-openwrt/51678, when i log in i get the error


and when i add the purge feature i get this error.
2

i know i'm missing some certificate, but i tried to find a fix from google but i can't.Can you help me?

Thank you and very much appreciated

wait. So you have openwrt running on your router and want Adguard running on your pi?

Just run their install script on your Pi. Not on your router. Then u will just need to point your router DNS at the newly setup Adguard on your Pi.

But if your router is powerful enough you may be able to run Adguard directly on your router.

One part that was not covered is updates. Current version (AdGuard Home v0.107.0-b.5 is now available!) Can someone please share detailed instructions for this.
I have tried to copy:
cp -R /overlay/AdGuardHome/4UPDATES/AdGuardHome/AdGuardHome /overlay/AdGuardHome
And the restarted the router, but I'm still stuck with the previous version.
Updating from the web-interface does not work.
Thanks!

Did u install AdGuard via their script? Because updating via webinterface works fine for me. Pulls it down and restarts.

AdGuard Home v0.107.0-a.117+12db9823 is now available!

Mon Aug  2 16:18:43 2021 daemon.err AdGuardHome[5748]: 2021/08/02 15:18:43.800036 [info] Updating from v0.107.0-a.116+6fa11672 to v0.107.0-a.117+12db9823.  URL:https://static.adguard.com/adguardhome/edge/AdGuardHome_linux_mips_softfloat.tar.gz
Mon Aug  2 16:19:31 2021 daemon.err AdGuardHome[5748]: 2021/08/02 15:19:30.583103 [info] Stopping all tasks

Thank you. No, it was not with a script that I installed. I downloaded it from github, extracted and that was that. I have the latest version now, but can't seem to copy it over with that command, which is what they say I should do on githib, if the web interface fails. By the way, among the files in the folder, which is the "executable" which is what they asked is copied in manual updates?
Thanks a lot.

So is where they say how to update manually:

Thanks a lot.

No problem. Their early integration seemed to have some issues with OpenWRT. I definatly would not use the openWRT opkg'd version. That is version 104 and substantially behind the current 107 tree. Their script does seem to install ok on OpenWRT devices. It does require some knowledge of linux/ssh at least however.

:edit: this thread has some more info too. Adblock vs Adguard Home

What problems do you have with OpenWrt if I use the package from the repository?

in short? its installed to tmp so you have to reset it up if you reboot. thats the most serious issue. Also its had massive upgrades/fixes.

Honestly its just better to use their install script and have it installed to /opt

Commits ยท AdguardTeam/AdGuardHome (github.com) Just have a look down all the commits they have done between 104 and 107. Maybe an updated opkg may be better but given how active the AdGuard project is... i'd just go with their live script and auto-update.

1 Like

Oh and additionally? I'm still using the same filter lists that i originally set up with... However now it no longer has out of memory errors and crashes on my 128mb router. Thats was a major pain in ass.

As of today I am at Uptime 15d 2h 38m 49s
And have 26mb of ram out of 128mb free.

1 Like

The master version is 0.106.3. At 21.02 it is 0.104.3.

106 is the stable release version. I'm running Version: v0.107.0-a.121+d0772fda Edge

### Test unstable versions

There are two update channels that you can use:

* `beta` - beta version of AdGuard Home. More or less stable versions.
* `edge` - the newest version of AdGuard Home. New updates are pushed to this channel daily and it is the closest to the master branch you can get.

curl -s -S -L https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh | sh -s -- -c edge
that will get you the edge 107 builds.

or

curl -s -S -L https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh | sh -s -- -c beta

gets you the more stable beta channel. Not sure what that one is thou. Guessing mid 107 release?

I am talking about the versions that are in OpenWrt.

Dont use them. OpenWRT really needs to pull newer versions for opkg to use. Ideally the new 107 builds as there are major updates. They also should NOT install to the /tmp folder as this is wiped on router reset.

Until the opkg versions are on later builds my advice is use AdGuards install script to install manually and avoid the opkg versions.

:edit: just to add some detail. I believe they put some of the config files in /tmp to prevent root filesystem filling up. However in 107 they changed some settings to you can set the statistics and query logs to just 6 hrs or disable them which keeps the disk use minimal.

I just checked my data and filters folders.
I'm using 14mb in data (logs queries and stats) and about 4mb in filters.

1 Like