Home Docker AdGuard Home: The Ultimate Ad-Blocking Solution

AdGuard Home: The Ultimate Ad-Blocking Solution

by Behrad
437 views

You know, I love browsing the web, but there’s something that often gets on my nerves – ads.

I mean, they’re a necessary evil, and I get that websites need them to make some dough, but sometimes it just feels like they’re taking over the entire screen. That’s why I decided to take matters into my own hands and find a way to make the web a little less ad-heavy, not just for myself but for everyone in my network. And guess what? I found the perfect solution – AdGuard Home running on my trusty Raspberry Pi.

All websites, including my blog, have some ads on them. To a certain extent, I’m okay with seeing ads; after all, they help generate some income. But sometimes, there are just too many of them. You know how it is when you’re trying to read an interesting article or catch up on the latest news, and bam! Ads pop up left, right, and center, blocking your view and making it hard to focus. It can be downright annoying.

Now, I’ve done what I can to block as many ads as possible on my own devices by installing some extensions on the browsers which I use or having Disconnect Pro on my Samsung devices, But I wanted to go a step further. I wanted to offer the same ad-free experience to every device in my network without having to go through the tedious process of configuring each one individually. That’s when I discovered AdGuard Home and realized it was the missing piece of the puzzle.

AdGuard Home

AdGuard Home is a game-changer. It’s an open-source network-wide ad and tracker blocking software that can make those intrusive ads vanish into thin air. Basically it operates as a DNS server that re-routes tracking domains to a “black hole”, thus preventing your devices from connecting to those servers. And the best part? I can run it on my Raspberry Pi!

There is a very good documentation available and the community behind it seems to be very active.

After doing some research and thinking about how to achieve my goal I found out that the best way to do is by creating a macVLAN. Say what? Yeah, macVLAN is:

a virtual LAN that you can use if you want to assign several IP addresses to the same network interface, basically splitting up the network interface into several sub-interfaces with their own IP addresses. You can then assign IP addresses based on the randomly generated MAC addresses.

The reason why I wanted to do is, has to do with the fact that I wanted to prevent any port conflicts AND I wanted AdGuard Home to be my main DHCP function within my network. By doing so, I don’t need to go through all the devices within my network, as this is the one and only DHCP/DNS server within my network. So simply joining the network would be the only requirement!

Additionally, this would offer me the possibility to view, remove, and add static IPs in the DHCP, as well as other DNS settings, all from a single interface!

1: Create macVLAN

The command to do this you can find here below. You could create this through Portainer as well, but I’ll cover that in a different post. Here I start with giving the entire range, followed by what my gateway is located at and last but not least, the IP adres the macVLAN should get. I choose .2 simply because I liked it so… 😉 You should note that this you need to change the IP adres to match your own!

sudo docker network create -d macvlan -o parent=eth0 --subnet=192.168.1.0/24 --gateway=192.168.1.1 --ip-range=192.168.1.2/32 AdGuard

2: Create the volumes

In order to have AdGuard work you need to create two folders called:

  1. work: This will be used for the data of AdGuard Home
  2. conf: This will be used for the configuration of AdGuard Home

3: Run the Docker Compose

Run the below Docker Compse in Portainer:

services:
  adguardhome:
    image: adguard/adguardhome
    container_name: adguardhome
    ports:
      - 53:53/tcp
      - 53:53/udp
      - 67:67/udp
      - 68:68/udp
      - 68:68/tcp
      - 3000:3000/tcp
      - 80:80/tcp
      - 443:443/tcp
    volumes:
      - /home/pi/Configs/AdGuard/Work:/opt/adguardhome/work
      - /home/pi/Configs/AdGuard/Conf:/opt/adguardhome/conf
    restart: unless-stopped
    networks:
      - Adguard

Open a new browser tab and go to http://your-server-address:3000 to do the configuration. Now, whenever I surf the web, AdGuard Home filters out all those annoying ads before they even have a chance to reach my devices. It’s like having a personal ad-blocking superhero, protecting me from the ad invasion. And the best part? It’s not just for me. Every device on my network gets to enjoy the same ad-free experience, thanks to AdGuard Home and my trusty Raspberry Pi.

Conclusion:

The battle against too many ads on websites is real, but with AdGuard Home running on my Raspberry Pi, I’ve found my secret weapon. No more distractions, no more cluttered screens, just pure browsing bliss. And you know what? You can have it too! With AdGuard Home and a little help from Docker, you’ll reclaim control over your browsing experience and bid farewell to those pesky ads. Trust me, once you experience the power of AdGuard Home, you’ll never want to go back to the ad-clogged days of old. Happy browsing!

You may also like

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

Discover more from ITB4X.com

Subscribe now to keep reading and get access to the full archive.

Continue reading