[HowTo] Running Adguard Home on OpenWrt

Hi,

I have a Linksys WRT3200ACM running OpenWRT 19.07.2.

I'd like to install Adguard Home on this router to filter ads/trackers so that I can remove the Adguard Desktop client I'm using on each of my PC's and mobile phones. However, I'm still scratching my head trying to figure just how to even get things installed? I've read over this guide and visited many other sites for instructions on how to do this but, I will admit I'm still confused. I take it I do not have to install anything on my Windows 10 computer? Obviously I need to use my computer to download the files needed to install them on my router in the Luci OpenWRT interface, but I don't know what steps I need to take to achieve this? Many official guides are not very clear.

I will admit... I am lost but eager to learn. I'd love to dump the desktop Adguard clients if I can get this working on my WRT3200ACM.

Thanks for any advise/help that may be given here.

Is this thread dead?
Still would like some help with this. :slight_smile:

No, the thread isn't dead yet. Where are you stuck?

1 Like

I just wanted to make a quick reply on this point above (and will I will later with help for your main question). I had been using AdGuard For Windows (desktop client) as a lifetime licence user for many years. Once I got AGH up and running and finally uninstalled the desktop client, browsing is now light-years faster. I had never realized how much the desktop client had been slowing down my overall browsing experience. The difference was night and day. Crazy.

I'm going to look over my setup and try to put together some notes that may help you get up and running with AGH. I'm hoping to have some time later tonight. If all goes well, I will post that later to help you out and/or brokenpipe likely can assist as well.

1 Like

Hi, thanks for the reply! :slight_smile:

I'll be perfectly honest, I just don't know where to start?
I'm running Windows 10 1909 64-bit with a Linksys WRT3200ACM router that has been flashed with OpenWrt 19.07.2 with more or less stock settings. My goal is to get Adguard Home up and running on my WRT3200ACM so I can control ADguard filtering on all connected devices without having to rely on the Adguard Desktop client that runs on Windows. I realize I could just use the Adguard DNS servers, but that is too basic, and I want the granular control that Adguard Home is offering with filter lists and customized settings.

Bottom line is for someone who is new to Adguard Home, has a lot of experience with Windows and computer hardware, but little to no experience with Linux, the instructions provided in the beginning of the thread are not detailed or comprehensive enough for a newbie to follow. That is my fault, but I don't know where to go or whom to ask for assistance from square one.

I don't know what I need to install on Windows (if anything? hopefully little to nothing), or how to install Adguard Home on my router so that I don't need to install anything on my computer. I need install and configuration steps.

I'm looking for a clear step by step guide on how to achieve what you and others are already clearly benefiting from with Adguard Home on OpenWrt.

I just need some help on where to start.
There are no guides I could find that are clear enough yet for me. :frowning:

Hey WildByDesign:

Your first paragraph is exactly what I wish to achieve on my computer and other home connected devices on my network. Since my computer is many years old, I know that if I place the burden of filtering on my router, everything in terms of web browsing should speed up significantly on my connected devices.

As I mentioned above, I am quite familiar with Windows computers, but little to no experience with Linux. I am pretty tech savvy, but this is a little beyond my level of understanding in trying to set things up from square one.

An clear step by step instruction guide is what I'm looking for. And if there is anything you can add here to help me and others to achieve this, I would be very grateful for any assistance given.

I just don't know what the first step is?

Thanks again!
Sincerely,
Dustyn

@Dustyn69 I apologize, but I don't have enough time right now at the end of the day to do a full step by step. It's something that I am happy to do but lately time and energy is something that I've been lacking unfortunately.

I do want to give a first step though. I am also using a WRC3200ACM, running OpenWrt 19.07.2, and also mainly use Windows. My first recommendation, when using Windows to make file system changes and issue commands to Linux on your router, is to use WinSCP (https://winscp.net/eng/downloads.php). I just use the portable version and use that for any of the nitty gritty stuff. To log in, you need to use the IP address of your router, your password you set for OpenWrt, the user is root, and you need to choose SCP as the protocol.

Once in, you can familiarize yourself with the layout of the file system and follow various tutorials for commands and such.

I've got to get some rest now but I will try my best to write some more tomorrow and hopefully put together some more detailed step by step instructions.

2 Likes

No worries at all!

I appreciate anything you may decide to share with me in trying to get this setup! :smiley:

I'll take a look at downloading and using WinSCP shortly. I've heard of this program before even though I've never used it. It appears on dslreports.com software forum every now and then (a site I frequent).

There is certainly no rush in assisting me with this, only if and when you feel like you have the time. I've had the time to try and look over all the official Adguard Home related instructions, checked out their github site, and continue to try and research how to set this up. Since the quarantine of covid-19 I thought I'd take advantage of self isolation to try and learn with guidance how to set this thing up.

Any help you or others may decide to give is greatly welcomed! :beer:

Cheers!
Dustyn

Looks like I was able to get WinSCP to work and I was able to login as root on the WRT3200ACM using the SCP protocol. Now I'm just reading over and over the installation instructions here to get an understanding of what to do: https://github.com/AdguardTeam/AdGuardHome/wiki/Getting-Started#installation

I haven't started anything yet, but it's small first step for me. :slight_smile:

Use Putty/SSH client to login in to your router

IP: Your Router's IP
User: root
Password: password you've set
Port: 22 (default)

Run these commands

opkg update
opkg install curl, wget, libmbedtls12, tar

# armv5 release from official repo
wget https://github.com/AdguardTeam/AdGuardHome/releases/download/v0.101.0/AdGuardHome_linux_armv5.tar.gz

# armv7 build with dark-theme, grab the release from my repo
# wget https://github.com/iganeshk/AdGuardHome/releases/download/v0.101.0-50-g1fa6/AdGuardHome_linux_armv7_v0.101.0-50-g1fa6-dirty-dark.tar.gz

mkdir /etc/AdguardHome
tar -xvf AdGuardHome_linux_armv7* --strip-components=1 -C /etc/AdguardHome/
/etc/AdguardHome/AdguardHome

You should be seeing something like below

root@wrt3200:~# /etc/AdguardHome/AdGuardHome 
2020/04/05 21:44:54 [error] Couldn't read config file /etc/AdguardHome/AdGuardHome.yaml: open /etc/AdguardHome/AdGuardHome.yaml: no such file or directory
2020/04/05 21:44:54 [info] AdGuard Home, version v0.101.0-50-g1fa6-dirty, channel release
, arch linux arm v7%!(EXTRA string=7)
2020/04/05 21:44:54 [info] This is the first launch of AdGuard Home, redirecting everything to /install.html 
2020/04/05 21:44:54 [info] AdGuard Home is available on the following addresses:
2020/04/05 21:44:54 [info] Go to http://127.0.0.1:3000
2020/04/05 21:44:54 [info] Go to http://192.168.1.1:3000

Now, goto http://[IP-ADDRESS-OF-YOUR-ROUTER]:3000/install.html

Setup example: run your adguardhome web server on port 8000 and dns server on port 5353
Install Luci-AdguardHome addon and follow OP's instructions for configuring it with dnsmasq
# install luci-adguardhome-app (execute this at router's terminal)
wget https://github.com/rufengsuixing/luci-app-adguardhome/releases/download/1.8-11/luci-app-adguardhome_1.8-11_all.ipk
opkg install luci-app-adguardhome_1.8-11_all.ipk

# configure the app with the directory you've extracted (here it's, /etc/AdGuardHome/)

Screenshot of addon configuration

3 Likes

Thank you very much for the very detailed response! :grin:
I do have a couple of questions:

# armv5 release from official repo
wget https://github.com/AdguardTeam/AdGuardHome/releases/download/v0.101.0/AdGuardHome_linux_armv5.tar.gz

# armv7 build with dark-theme, grab the release from my repo
# wget https://github.com/iganeshk/AdGuardHome/releases/download/v0.101.0-50-g1fa6/AdGuardHome_linux_armv7_v0.101.0-50-g1fa6-dirty-dark.tar.gz

Do I execute both of these packages .tar.gz packages? From my understanding the second package is for your mustard orange black interface correct? Otherwise it will be the default white and green interface? That mustard orange black gui looks awesome! I assume the WRT3200ACM will have enough storage space for these files?

The thing I am curious about is that after performing these installation steps, in order to obtain detailed monitoring of all connected devices to my router (hard wired and wi-fi), I would then need to follow the original posting guide in this thread to achieve this right? Or is there more I would need to do after?

I can't thank you enough so far for such detailed help so far! This is great info! I will be setting a chunk of time aside shortly to get started on setting things up. :smiley:

Cheers! :beer:
~Dustyn~

What's the benefit of this over the common adblock package??

1 Like

take the official package of AdguardHome.
i don't know how much internal flash memory the router has, after an update, the current binary file will be created as backup. so you must have at least 15mb internal memory.

1 Like

If you want the dark theme, just execute the second command. The file sizes are identical since the dark theme is just cosmetic revision of the original.

Regarding the space consumption, I've setup AGH with just basic filters (150k~ rules) and the following is the disk usage:

23.8M /etc/AdGuardHome/

If you're looking to monitor the clients/devices, you'll need to replace dnsmasq with AGH since DNS forwarding is not designed forward "source address", hence you'd be getting your router's IP in the query log.

no worries, just make sure to

  • reboot your router every time you make changes.
  • delete the archive rm -f /root/AdGuardHome_linux_armv7_v0.101.0-50-g1fa6-dirty-dark.tar.gz
1 Like

@Dustyn69 With the WRT3200ACM, you will have no issues with running out of space or memory with AdGuard Home. Even with 4-6 adblock lists, I haven't had any memory related issues with my WRT3200ACM with AGH or the other Adblock for OpenWrt.

For anyone that does have devices with less space/memory, that luci-app-adguardhome that @gnashk mentioned also has a built-in function to compress the AdGuardHome binary file with various options. Although I personally have not tried the compression because I haven't had any need for that.

The information provided by @gnashk is fantastic. Thank you for sharing those helpful commands. Super concise and great.

One question that I have, @Dustyn69, is whether you plan on having AGH issue DHCP instead of OpenWrt (dnsmasq) or just let dnsmasq handle that? It may be a good idea to continue testing for a few weeks to familiarize yourself with AGH and everything first, then consider the DHCP stuff once more comfortable. I recommend using AGH for DHCP and disabling dnsmasq, however, I also strongly consider getting everything familiar and stable first. The AGH DHCP stuff has the potential to cause issues on your network during the testing stages if certain settings and not done specifically. I had many instances with the DHCP function of AGH where multiple devices got the same IP addresses (conflicting IP) and other situations where AGH crashed and therefore shut down my entire home network. So DHCP, I would proceed with caution after some time.

1 Like

Added upx packed dark theme armv7 build to the repositories

compressing armv7 build with UPX
+ upx -1 -k AdGuardHome
                       Ultimate Packer for eXecutables
                          Copyright (C) 1996 - 2018
UPX 3.95        Markus Oberhumer, Laszlo Molnar & John Reiser   Aug 26th 2018

        File size         Ratio      Format      Name
   --------------------   ------   -----------   -----------
  13238272 ->   7414964   56.01%    linux/arm    AdGuardHome                   

Packed 1 file.

Download: https://github.com/iganeshk/AdGuardHome/releases/download/v0.101.0-50-g1fa6/AdGuardHome_linux_armv7_v0.101.0-50-g1fa6-dirty-dark_upX.tar.gz
Other Releases: https://github.com/iganeshk/AdGuardHome/releases/tag/v0.101.0-50-g1fa6

1 Like

luci-compat
was needed to run the luci-adguardhome-app
nice tutorial

2 Likes

Hi gnashk:

So I was able to execute all previous instructions successfully with what appeared to be an error about download location:

opkg update
opkg install curl, wget, libmbedtls12, tar

# armv7 build with dark-theme, grab the release from my repo
# wget https://github.com/iganeshk/AdGuardHome/releases/download/v0.101.0-50-g1fa6/AdGuardHome_linux_armv7_v0.101.0-50-g1fa6-dirty-dark.tar.gz

mkdir /etc/AdguardHome
tar -xvf AdGuardHome_linux_armv7* --strip-components=1 -C /etc/AdguardHome/
/etc/AdguardHome/AdguardHome

The command console window outputs the following info below, but does not appear go go any farther.

/root$ tar -xvf AdGuardHome_linux_armv7* --strip-components=1 -C /etc/AdguardHome/
AdGuardHome/AdGuardHome
AdGuardHome/README.md
AdGuardHome/LICENSE.txt

Did I execute a command incorrectly?
Clearly something isn't working...
:thinking:

Untitled
I tried to execute that last command again but, I received this message.

Since my knowledge on command console and linux commands are rather limited, I'm thinking this an input error?

Thanks again for the guidance! :slight_smile:

Sincerely,
~Dustyn

I am not sure where you're executing these commands but I suggest you download https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html

In bash script, if there's # in from the line, it won't be executed (comment line). So you'll have to remove # from the second wget line.

opkg update
opkg install curl wget libmbedtls12 tar luci-compat

wget https://github.com/iganeshk/AdGuardHome/releases/download/v0.101.0-50-g1fa6/AdGuardHome_linux_armv7_v0.101.0-50-g1fa6-dirty-dark.tar.gz

mkdir /etc/AdguardHome
tar -xvf AdGuardHome_linux_armv7_v0.101.0-50-g1fa6-dirty-dark.tar.gz --strip-components=1 -C /etc/AdguardHome/

# install luci-adguardhome-app 
wget https://github.com/rufengsuixing/luci-app-adguardhome/releases/download/1.8-11/luci-app-adguardhome_1.8-11_all.ipk
opkg install luci-app-adguardhome_1.8-11_all.ipk

Now goto OpenWRT -> Services -> Adguard Home and follow the image in my previous for configuring it. Enable -> Save & Apply