Setting up AdguardHome with Reverse-Proxy & Cloudflare, Let’s Encrypt SSL, DDNS on Freenas 11.3-U5Jail

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.

More advanced information in our GitHub repository.

“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 This record needs to be DNS Only. For example, my adguard service might have a CNAME as

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:

Multiple domains

“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 Add.

Make sure to select DHCP and then setup a static IP through your router. I named my Jail as adguard.

SSH into the box and type:

iocage list

You should see adguard in the list.

Just run:

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 | 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

[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
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.

Step 3 – Point your Reverse-Proxy to AdguardHome IP:

Please go here to find out how to setup reverse proxy.

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.

That’s it!

Leave a Reply

Close Menu