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

Router Linksys WRT1900ACS v2
Firmware Version Divested-WRT SNAPSHOT r20650+11-8b06e06832 / LuCI Master git-22.245.77360-10bcb22

@mercygroundabyss It is possible to install AdGuard Home on a memory stick, what would be the command for my example?

1 Like

But instead of mounting it as /mnt/sdxx you could just mount it as /opt and then use my guide without modification. Its easier that way.

1 Like

it is correct now, or only need /opt without /mnt/sda1?

mount it as /opt only

1 Like


I did not install AdGuard it on openwrt, as information, what is the installation script for AdGuard in /opt ?

#Stop AGH
/etc/init.d/AdGuardHome stop 

#Grab updated AGH from server and save to /tmp
wget https://static.adguard.com/adguardhome/edge/AdGuardHome_linux_mips_softfloat.tar.gz -P /tmp

#unzip updated file over top of AGH in /opt
tar x -vzf /tmp/AdGuardHome_linux_mips_softfloat.tar.gz -C /opt

#cleanup /tmp
rm /tmp/AdGuardHome_linux_mips_softfloat.tar.gz

#Restart AGH
/etc/init.d/AdGuardHome start
echo 'Updated'

that is the wrong script. follow the instructions in first post. you do NOT need that updater script. its HIGHLY specific and requires editing if u use it. AGH should auto update on a click in the web interface.

My AGH works great on my router (im using DoH), but i wanted to set up private DNS on my phone, so it uses cloud flare dns when im outside of my home network, but when i set it up (it uses DoT), and im connected to my home network, my phone seems to bypass AGH, and doesnt filter out ads, is there a way to force my phone to still use my AGH while on my home network, without disabling the private DNS option?

That exception would need to be configured on your phone, wherever you configured DoT. The purpose of all the encrypted/signed DNS variants is to prevent manipulation of DNS which is what DNS-based ad-blockers rely on.

I dont think thats possible, cause enabling private DNS seems to bypass everything completly, no matter which dns i use, i guess i could just maybe set up DoT on my AGH and then use it on my phone as the private DNS, that should work right?

1 Like

Yes, while you're home but then you'd need a way to (automatically) turn it back on on the device when you're on the road.

1 Like

There's a few ways to do this.

First is one listed near top of thread where they use external provider to do their blocking and dns. This combines with AGH at home as well.

Second is to use vpn back to your network and just use your AGH as dns.

Third is enable DoT interception that forces your phone to talk to AGH when on your home network. Currently its bypassing your AGH as it is going direct to Cloudflare’s. The wiki mentions plain dns interception but doesn't touch on encrypted dns blocking/interception. That will take some googling.

Or just use an app like blokada that does vpn/blocking on your phone instead

1 Like

Thank you, that is very helpful, i will probably use wireguard or blokada, cause i dont know im capable of googling all that stuff myself to make it work.

Hi community!:

First of all, thank you so much for this fantastic guide @mercygroundabyss, my setup is different than a "basic setup" (I got different VLANs for different purposses), but I've been able to make work AdGuardHome without problems, well, as a DNS resolver, but with DNS queries as plain text.

How can I make that AdGuardHome works like DoT and / or DoH DNS resolver?, at the dashboard, all the DNS queries are "DNS simple" (plain text), I'm using port 53 for AGH and 53535 for dnsmasq, the traffic is redirect from 192.168.x.0/24 port 53 to the port53 (DNS VLAN working as DNS resolver).

Thanks you so much in advance for your help and time guys, regards.

It does not make much sense to configure DNS encryption inside of your own local network. The purpose of securing your DNS traffic is to secure it from third-parties that might be analyzing or modifying it. For instance, from your ISP.

It means that you will need a server with a public dedicated IP address. There are plenty of cheap cloud servers providers: DigitalOcean, Vultr, Linode, etc. Just choose one, create a cloud server there, and install AdGuard Home on your server.

In short you need a publicly addressable server with a SSL Cert. it is possible to do internally on a home router but somewhat tricky and requires some googling.

1 Like

What are the storage space requirements when installing AdGuardHome via LuCi from the Software page (opkg)?

I installed AdGuard on my Linksys E8450 / Belkin RT3200. Do I need to worry about running out of storage space (when I upgrade in the future)? The wiki mentions the agh-backup folder and a 100MB free disk/flash space requirement. Does this apply when installing via opkg? Also seems like the filter lists are stored in RAM.

Similar question was asked on Reddit. Perhaps we can update the wiki regarding storage space requirements.

AGH itself is 35mb (I'm using 108 edge build but its been mostly stable at this size for while.)
Double that for the backup.
Then lists and your logs are the rest.

100mb should cover most setups. however if you wish to install large list sets you will need to ensure you have extra space.

My stats for space in the first post are still good. I've pared down my logging but its still 1.2mb for query logs (6hrs kept)
and 90days of stats is 27mb atm.

If you are worried about space. Mount a usbkey drive as /opt and then install AGH onto it.

1 Like

Thanks for replying. I prefer not to use USB storage if I don't have to.

Can someone who has installed AdGuard via opkg comment on the disk space required?

I think the storage space requirements are lower when installing via opkg as opposed to the manual installation method from the first post in this thread. For example, lists are stored in RAM and not on flash and I think there won't be a previous version backup stored when upgrading via opkg. But I'm not sure so curious if someone can confirm.

AGH is designed to be installed and updated as they patch things. Both the stable and edge branches require this. The opkg version is not my creation but its listed here to up its profile and due to collaboration between James and I in the progress of this project.

AGH is still fixing issues and hopefully we will be able to have a much better experience via opkg as we are in the end going to replace dnsmasq and dhcp with AGH completely and thus scripts etc won't be required.

However until the AGH team updates a few things this cannot happen.
They are also looking at reducing the size of the AGH binary. James has found that compressing it with UPX improves the size.

Further up in the thread is a list of issues that were filed. unfortunately it seems that most of them have been pushed to the 109 release schedule.

Until these are fixed/closed then the only real option we have is the edge install to keep AGH added to OpenWrt. In time opkg installs will be the way to go and I'll happily retire this thread.


Yes they are but its at the cost of ram. your lists, query logs, stats etc are saved in /tmp which is ram. This does reduce the size but also you loose those when you reset your router. Its a compromise. I'm not the dev for the opkg version. I'm unsure if the opkg version will let you update over the top or not.

Give it a go. worst case you reset back to defaults. (as long as you have a backup.)