AdguardHome with Reverse Proxy on Freenas 11.3
Block tracking, Ads and malicios links at Network Level!
By Fahad Usman
What is a Adguard Home?
AdGuard Home is a network-wide software for blocking ads & tracking. You just set it up and any device that connects to your network will be covered, and you don’t need any client-side software for that. With the rise of Internet-Of-Things and connected devices, it becomes more and more important to be able to control your whole network.
“Block Ads and tracking on all connected devices on your network”
In this guide, I will take you through step by step how to set it up and reverse proxy using nginx.
How to setup reverse-proxy, please go here.
Step 0 – setup CNAME/subdomain on Cloudflare:
You will now need to create a
CNAME record in cloudflare that will point to
myserver.duckdns.org. This record needs to be
DNS Only. For example, my adguard service might have a
CNAME as adguard.example.com
If you want to expose multiple services then you will need to create multiple sub-domains and point them to the duck dns server via CNAME DNS ONLY as show below:
“DuckDNS will help us to keep track of our WAN IP address.”
Step 1 – Create a jail:
I created it using
FreeNas GUI. Just
Login and goto
Jails and Click
Make sure to select
DHCP and then setup a
static IP through your router. I named my Jail as
SSH into the box and type:
You should see adguard in the list.
iocage console adguard
To get into the jail console and run:
pkg update pkg upgrade
Step 2 – Install AdguardHome:
Installing the packages are a piece of cake. Just run:
[email protected]:~ # cd / && curl -s https://api.github.com/repos/AdguardTeam/AdGuardHome/releases/latest | grep "AdGuardHome_freebsd_amd64.tar.gz" | cut -d : -f 2,3 | tr -d \" | wget -qi -
The above command will download the latest version of adguardHome from the GitHub repo.
Now run the following to unzip the files and install AdguardHome
This will do the magic and set everything up. Once done. Open up your favourite Internet Browser and goto adguard jail’s IP address to finish the simple configuration. This configuration will allow you to setup the username/password for adguardHome.
[email protected]:~ # tar -xvzf AdGuardHome*.tar.gz -C /root [email protected]:~ # rm AdGuardHome*.tar.gz [email protected]:~ # cd /root/ [email protected]:~ # cd AdGuardHome/ [email protected]:~/AdGuardHome # ./AdGuardHome -s install
Step 4 – Setup DNS Server in your Router:
This step is different for all the routers. So You need to check where to set DNS servers in your router so that your router uses this adguard jail as a DNS server instead of your ISP.
Now when you connect any device to your network. It will use adguardHome by default and you don’t need to setup anything else.