[How-To-Updated 2021] Installing AdGuardHome on OpenWrt [Manual and opkg method]

you have a different error this time.

On your install you got path not found.
This time you got my error (because AGH is already installed and setup).

In theory that means that AGH service is installed and ready to go.

But my suspicion is their recent changes are using systemd service install methods that OpenWrt doesnt support. Hence the path error. I will do some more digging and file a bug report.


Issue filed. Lets see what they say.

1 Like

@directnupe @StrikerFX They released a new edge build which will drop to using init.d rather than update-rc. Can you try again and see if its ok now?

EugeneOne1 commented 3 hours ago

mercyground we've just pushed the newest edge build. It now should be able to successfully install itself as a service on OpenWrt. Could you please check if it works?


Thank you so much for all you do. Mercygroundabyss you are simply the absolute best. I will get back to you just as soon as I get the latest Edge version installed and configured.
Once again I express my sincere gratitude for all you do to develop, educate and maintain AdGuardHome on OpenWRT.



Confirmed. Clean install on the new OpenWrt 22.03.0-rc4 on a NanoPi R4S router.

starting AdGuard Home installation script
2022/06/20 16:55:55 [info] service: control action: install
2022/06/20 16:55:57 [info] service: started
2022/06/20 16:55:57 [info] Almost ready!
AdGuard Home is successfully installed and will automatically start on boot.
There are a few more things that must be configured before you can use it.
Click on the link below and follow the Installation Wizard steps to finish setup.
AdGuard Home is now available at the following addresses:

Well apparently Cloudflare is having a bad day.

For those of you with DNS issues?

Add in the following as alternate upstreams



Till cloudflare fixes their issues.

For those of you using cloudflare for your router dns. is Quad9's ip4 address is googles.

Add them as alternates till things get fixed.


Dear My Friend Mercy,
I was finally able to get AGH up, running with no issues. I changed to Quad9 for Bootstrap DNS. My main problem was that I was using too many and / or too aggressive DNS filters which would result in faulty connections.
Thanks for getting AGH fixed for all of us.


1 Like

Ok Folks. Bit of a tidyup.
Pinging a few people about my fixes. @jamesmacwhite @cah1982 @StrikerFX

Firstly the wiki : https://openwrt.org/docs/guide-user/services/dns/adguard-home

  • I've substantially re-edited the wiki to make it flow better.

  • A number of sections were moved and also edited so the Table of Contents now properly lists them as subsections.

  • Added an updated set of space requirements and example sizes.

  • Added in NFT tables replacement for IP Tables rule.

  • Added link to AGH page and their logo to the wiki.

  • Moved dnsmasq to port 54 to avoid clashing mDNS 5353 (new)


  • I've highlighted NTP / SSL warning and made it highly prominent as this has bitten a few people. However looping your router DNS through AGH is NOT a recommended configuration for that very reason that NTP lookups WILL fail if the date/time is incorrect. There is also a race condition with the opkg version due to start up values that is still being resolved. Thus it is HIGHLY preferable your router uses a separate unencrypted upstream DNS to avoid the NTP issue.

Fixes for my thread :

  • NTP warning enhanced and link to wiki entry.

  • I've replaced my PTR picture in my thread to use instead of local lookup. It was causing confusion and I've added a note to that too. Apparently I had fixed the wiki but not my thread. (Sorry @StrikerFX )

  • Added in NFT tables replacement for IP Tables rule and link to wiki.

  • Moved dnsmasq to port 54 to avoid clashing mDNS 5353 (new)


Part of me wants to maybe duplicate the wiki and make one that shows the full path for a manual edge install as the thread install is somewhat difficult to read. You can use my thread with the wiki to do a manual install but you would have to keep checking where the process diverges.

Yet at the same time I am reluctant to duplicate it as large portions would be the same. I need to think about it and maybe ask the admins what their opinion is.

Any opinions from those who have followed my thread/instructions? Feedback is welcome.

(edit) or would a few extra sections marked optional on the main wiki with the manual thread method be better or more confusing?

(edit2) port 54 fix. (26/06/22)


Consolidate it.
The post is somewhat hard to follow, though I did get it installed.

Without this thread, I wouldn't have installed it.

1 Like

Hi Mercy,

Maybe one of the more experienced folks around here would like to chime in about redirecting OpenWrt builtin dnsmasq port to 5353, as this is also the port used for DNS-SD on Apple products and Avahi on Debian and Ubuntu.
I'll admit upfront that I'm not experienced enough to advise either for or against the use of this port, but I'm afraid it could interfere with locating services, specifically for things (e.g network printers, network scanners, you name it...) under the .local domain.

Also, by default, OpenWrt dhcp settings set the search domain to .lan, but I'm not sure what impact would result if users would manually change the search domain to .local, as I was once tempted to do, but ended up deciding to leave unchanged.

EDIT: In my own AGH edge setup I decided to use port 53000 instead for OpenWrt's builtin dnsmasq port.

1 Like

you can choose any port number you wish. Just check for it being reserved. I wasnt aware 5353 was used for DNS-SD and repeating port numbers is a common trick when "proxying" other ports. eg 8080 for http. I perhaps should have checked that. I could make a note in the thread and wiki you can use a different port as an option?

As a rule regarding ports, ports under 1024 are considered privileged ports and usually reserved.

if you change the search domain name you just have to change the redirect to match. All it does is change the appended domain.

1 Like

Having had a bit to ponder I think I may just redo my instructions and make it so dnsmasq is pushed from 53 to port 54.

54, Assigned, Xerox Network Systems (XNS) Clearinghouse (Name Server). Despite this port being assigned by IANA, the service is meant to work on SPP (ancestor of IPX/SPX), instead of TCP/IP.

While this is an assigned port, its likelihood of being used is low.

mDNS on 5353 is much more likely to be used and thus really should be avoided.

5353 Assigned Yes Multicast DNS (mDNS)

Port 8080 for the web interface for AGH is acceptable as Luci runs on port 80 and SSL on 443. Unless anyone has modified their OpenWrt install, 8080 should be free. If they have, then the nginx reverse proxy method will make the AGH interface available instead.

I will also make it clearer in my instructions that ports can be changed if required but point out there are assigned ports you should avoid as they are either assigned services or reserved and as a rule you should not use ports that are actively used for other services.

(edit) My thread and wiki now updated with port 54 instead and updated pictures for rDNS as well as info about reserved ports.