-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Raspberry Pi
You can install AdGuard Home on your Raspberry Pi and use it to filter out ads. This also saves data traffic.
Afterwards you can use your AdGuard Home on any machine connected to the same local network.
This is different from browser-based ad blocking extension because it works not only in a browser but in other apps too.
There are many reasons to remove ads:
- They can be really annoying.
- They can be really intrusive.
- Sometimes they are laced with scripts for bitcoin mining.
- Bad people can extract sensitive information from your browser with a nasty malicious script.
- If you are on metered bandwidth, it can offer significant data savings when browsing the internet in Chrome, Firefox, Edge or Safari.
If you haven't already done so, set up your Raspberry Pi by preparing the SD card, then connecting keyboard, mouse and display/TV via HDMI, then connecting it to a power supply and booting it. An official guide to do that is here — https://projects.raspberrypi.org/en/projects/raspberry-pi-setting-up
You will not need a keyboard and mouse for very long, just to type a few commands and then write down the results.
Once you've booted into the desktop, you need to connect it to network:
- If you have a model that has built-in WiFi or you have USB WiFi dongle, follow this guide — https://www.raspberrypi.org/documentation/configuration/wireless/desktop.md
- If you have ethernet/LAN adapter and LAN connectivity, just plug it into your Pi.
Next, we will enable SSH, so you can comfortably access it from your main computer. Open Terminal on your Pi and type this:
sudo systemctl enable ssh
sudo systemctl start ssh
This should enable SSH, next up, we need to note down the IP address that has been assigned to your Pi.
Without closing Terminal, type this:
hostname -I|xargs -n1
It will output an IP address, if there are several, note down only first one, rest you can keep just in case.
For illustration purposes, I will use 192.168.10.20
in examples — don't forget to substitute it with the one you've noted down.
Switch back to your main computer, but keep your Pi running, and launch an ssh client:
- On Windows, we recommend PuTTY and then connect it to your Raspberry Pi's IP address (which is
192.168.10.20
in my network) with usernamepi
and your Pi's password (which israspberry
unless you've changed it already). - On Linux or MacOS, just open Terminal and type
ssh [email protected]
, then type your Pi's password (which israspberry
unless you've changed it already).
Once you're done and everything went successfully, you will be greeted by Raspberry Pi's command line interface and you're ready to start installing your own AdGuard Home!
Go to AdGuard Home page and download binaries for Raspberry Pi.
At the time of writing this guide, the latest version is v0.93.
Let's download AdGuard Home and unpack it:
cd $HOME
wget https://github.com/AdguardTeam/AdGuardHome/releases/download/v0.93/AdGuardHome_v0.93_linux_arm.tar.gz
tar xvf AdGuardHome_v0.93_linux_arm.tar.gz
It will unpack into a new directory called AdGuardHome
.
All you have to do is simply type this command to the Terminal:
sudo ./AdGuardHome -s install
Here are the other commands you might need to control the service.
-
AdGuardHome -s uninstall
- uninstalls the AdGuard Home service. -
AdGuardHome -s start
- starts the service. -
AdGuardHome -s stop
- stops the service. -
AdGuardHome -s restart
- restarts the service. -
AdGuardHome -s status
- shows the current service status.
Once it's up and running, you can access your AdGuard Home web interface on port 3000 by typing this in your browser — http://192.168.10.20:3000/
Don't forget to substitute 192.168.10.20
with IP of your Pi.
You can verify that it's working properly by running this on your Pi:
host doubleclick.net 127.0.0.1
If everything works correctly, you will get this output:
Using domain server:
Name: 127.0.0.1
Address: 127.0.0.1#53
Aliases:
Host doubleclick.net not found: 3(NXDOMAIN)
Now, once we've established that AdGuard Home works on our Raspberry Pi, you can use it on other computers in your network by changing their system DNS settings to use Pi's IP address (which is 192.168.10.20
in our case).
You have an option to password-protect your AdGuard Home's web interface so only you can access it.
To do so, stop it first:
sudo systemctl stop adguard-home
Then edit the configuration file:
sudo nano /home/pi/AdGuardHome/AdGuardHome.yaml
Find lines containing auth_name: ""
and auth_pass: ""
and replace them with username and password:
auth_name: "your-secret-name"
auth_pass: "your-secret-password"
Substitute name and password with your own, of course.
After you're done editing, save the file and start your AdGuard Home again:
sudo systemctl start adguard-home
After that, visiting web interface in a browser will ask for username and password.