How can I install Adguard Home on the RUTC50?

Hello,

I recently installed AdGuard on a RUTX10 and, while browsing the forum, I came across this topic. I wanted to point out some steps to those who may be interested.

  1. Download and install the package with each line per time:

    opkg update
    opkg -e /etc/opkg/openwrt/distfeeds.conf update
    opkg -e /etc/opkg/openwrt/distfeeds.conf install adguardhome
    
  2. If the above doesn’t work, try with wget and install with opkg:
    wget -P /usr/local/home/user https://downloads.openwrt.org/releases/21.02.0/packages/mi_24kc/packages/adguardhome_0.107.21-1_mipsel_24kc.ipk

  3. After downloading the file with wget, you should install it with the following command line:
    opkg install /usr/local/home/user/adguardhome_0.107.21-1_mipsel_24kc.ipk -V2

  4. After installation, edit the config file:
    vi /etc/init.d/adguardhome
    Substitute text after “PROG=” for
    “PROG=/usr/local/usr/bin/AdGuardHome”
    Also, add both lines indicated on topic Ad Blocking after Update to RUTX_R_00.07.06 - Networking Solutions - Teltonika Community
    The file should look like this:

#!/bin/sh /etc/rc.common
PROG=/usr/local/usr/bin/AdGuardHome

USE_PROCD=1

# starts just after network starts to avoid some network race conditions
START=25
# stops before networking stops
STOP=89

start_service() {
  config_load adguardhome
  config_get WORK_DIR config workdir

  [ -d "$WORK_DIR" ] || mkdir -m 0755 -p "$WORK_DIR"
  /bin/mkdir -p /tmp/var/adguardhome/data /opt/var/adguardhome/data/filters >/dev/null 2>&1
  /bin/ln -sf /opt/var/adguardhome/data/filters /tmp/var/adguardhome/data >/dev/null 2>&1
  procd_open_instance
  procd_set_param command "$PROG" -c /etc/adguardhome.yaml -w "$WORK_DIR" --no-check-update
  procd_set_param stdout 1
  procd_set_param stderr 1
  procd_close_instance
}
  1. Save the file by pressing “ESC” and then hitting “wq! + Enter” to save & quit
  2. You can check if the file is well edited with the following command line:
    cat /etc/init.d/adguardhome
  3. Reload the service with the following command line:
    /etc/init.d/adguardhome reload
    Then look if the service is running with the following command line:
    /etc/init.d/adguardhome status
    The result should “running”
  4. You can also check if the service is running with ps | grep adguard
  5. After this procedure, you should be able to go into AdGuard first configuration steps in port 3000, if you’re using 192.168.1.1 for your router then the address should 192.168.1.1:3000

IMPORTANT: Configure AdGuardHome access to a port other than 443 and 80, which are used by RUTOS itself for RUTX10 configuration. If you wish, you can keep it on port 3000.
Follow the program configuration instructions directly from the AdGuard Home configuration page: [OpenWrt Wiki] AdGuard Home

IMPORTANT: Don’t forget to make the configuration listed in the “Setup” item, described the OpenWRT page ([OpenWrt Wiki] AdGuard Home), to redirect DNS requests to AdGuardHome. In the initial configuration step, AdGuardHome itself warns that there is already a service running on port 53 (default DNS port).

If you’re having any issue installing anything after version 7.14, try to change “PROG=” in init.d files to a writeable folder, this also works with Zabbix Agent and other packages.

I hope this helps anyone searching for answers :slight_smile:
Best regards.