Pull request: Raspberry-Pi: imp, upd
Updates AdguardTeam/AdGuardHome#2795. Squashed commit of the following: commit 9df26510d6c4118695cb2c45716668b3e8546133 Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Mon Oct 25 19:20:01 2021 +0300 Raspberry-Pi: imp wording commit 2429f25a047ef688be0e1b8ea3c98600730750bb Author: Ainar Garipov <A.Garipov@AdGuard.COM> Date: Mon Oct 25 18:08:49 2021 +0300 Raspberry-Pi: imp, upd
parent
48f3db3adf
commit
38fc9a4e01
157
Raspberry-Pi.md
157
Raspberry-Pi.md
|
@ -1,96 +1,100 @@
|
|||
# How to Install and Run AdGuard Home on a Raspberry Pi
|
||||
# How To Install And Run AdGuard Home On A Raspberry Pi
|
||||
|
||||
You can install AdGuard Home on your [Raspberry Pi](https://www.raspberrypi.org) and use it to filter out ads. This also saves data traffic.
|
||||
You can install AdGuard Home on your [Raspberry Pi][pi] and use it to filter ads
|
||||
and save traffic. Once it is installed, you can use your AdGuard Home on any
|
||||
machine connected to the same local network.
|
||||
|
||||
Afterwards you can use your AdGuard Home on any machine connected to the same local network.
|
||||
* [Prepare Your Pi](#prepare)
|
||||
* [Install AdGuard Home](#install)
|
||||
* [Check The Filtering](#check)
|
||||
* [Configure Your Devices](#devices)
|
||||
|
||||
This is different from browser-based ad blocking extension because it works not only in a browser but in other apps too.
|
||||
[pi]: https://www.raspberrypi.org
|
||||
|
||||
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](https://arstechnica.com/information-technology/2018/01/now-even-youtube-serves-ads-with-cpu-draining-cryptocurrency-miners/).
|
||||
* Bad people can [extract sensitive information](https://www.theverge.com/2017/12/30/16829804/browser-password-manager-adthink-princeton-research) 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.
|
||||
|
||||
## Prepare Raspberry Pi
|
||||
## <a href="#prepare" id="prepare" name="prepare">Prepare Your Pi</a>
|
||||
|
||||
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'll need a Raspberry Pi with network access and [SSH enabled][ssh]. Connect
|
||||
it to a display and a keyboard, boot it, and write down the IP address that has
|
||||
been assigned to your Pi:
|
||||
|
||||
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:
|
||||
```bash
|
||||
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:
|
||||
```bash
|
||||
```sh
|
||||
hostname -I | xargs -n 1
|
||||
```
|
||||
|
||||
It will output an IP address, if there are several, note down only first one, rest you can keep just in case.
|
||||
If there are several IP addresses, write down the first one. Switch back to
|
||||
your main computer, but keep your Pi running, and launch an ssh client. On
|
||||
Windows, you can use [PuTTY][putty], while on Linux, macOS, and other Unix-like
|
||||
OSes, you can just use your preferred terminal emulator.
|
||||
|
||||
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.
|
||||
Type:
|
||||
|
||||
Switch back to your main computer, but keep your Pi running, and launch an ssh client:
|
||||
```sh
|
||||
ssh pi@192.168.10.20
|
||||
```
|
||||
|
||||
* On Windows, we recommend [PuTTY](https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html) and then connect it to your Raspberry Pi's IP address (which is `192.168.10.20` in my network) with username `pi` and your Pi's password (which is `raspberry` unless you've changed it already).
|
||||
* On Linux or MacOS, just open Terminal and type `ssh pi@192.168.10.20`, then type your Pi's password (which is `raspberry` 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!
|
||||
(where `192.168.10.20` is the IP you've written down) and then type your Pi's
|
||||
password (which is `raspberry` unless you've changed it already). Once you're
|
||||
done, you will be greeted by the command line interface. Now you're ready to
|
||||
install your own AdGuard Home!
|
||||
|
||||
![wcmbkfejpl](https://user-images.githubusercontent.com/739119/46160233-d931e000-c28a-11e8-84c0-a2721b9d6b98.png)
|
||||
|
||||
## Installing AdGuard Home on Pi
|
||||
[ssh]: https://www.raspberrypi.com/documentation/computers/remote-access.html
|
||||
[setup]: https://projects.raspberrypi.org/en/projects/raspberry-pi-setting-up
|
||||
[wifi]: https://www.raspberrypi.org/documentation/configuration/wireless/desktop.md
|
||||
[putty]: https://www.chiark.greenend.org.uk/~sgtatham/putty/latest.html
|
||||
|
||||
Go to [AdGuard Home page](https://github.com/AdguardTeam/AdGuardHome#installation) and download binaries for Raspberry Pi.
|
||||
|
||||
Let's download AdGuard Home and unpack it:
|
||||
```bash
|
||||
cd $HOME
|
||||
wget https://static.adguard.com/adguardhome/release/AdGuardHome_linux_armv6.tar.gz
|
||||
tar xvf AdGuardHome_linux_armv6.tar.gz
|
||||
|
||||
## <a href="#install" id="install" name="install">Install AdGuard Home</a>
|
||||
|
||||
Go to [AdGuard Home page][inst] and download binaries for Raspberry Pi:
|
||||
|
||||
```sh
|
||||
cd
|
||||
wget 'https://static.adguard.com/adguardhome/release/AdGuardHome_linux_armv6.tar.gz'
|
||||
tar -f AdGuardHome_linux_armv6.tar.gz -x -v
|
||||
```
|
||||
It will unpack into a new directory called `AdGuardHome`.
|
||||
|
||||
All you have to do is simply type this command to the Terminal:
|
||||
(Replace `armv6` with the ARM version that is best supported by your Pi.)
|
||||
|
||||
```bash
|
||||
cd AdGuardHome
|
||||
That command unpacks the necessary data into a new directory called
|
||||
`AdGuardHome`. Run this command to install AdGuard Home as a service:
|
||||
|
||||
```sh
|
||||
cd ./AdGuardHome/
|
||||
sudo ./AdGuardHome -s install
|
||||
```
|
||||
|
||||
Here are the other commands you might need to control the service.
|
||||
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.
|
||||
* `AdGuardHome -s uninstall`: uninstall the AdGuard Home service.
|
||||
|
||||
## Visit the web interface
|
||||
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/`
|
||||
* `AdGuardHome -s start`: start the service.
|
||||
|
||||
Don't forget to substitute `192.168.10.20` with IP of your Pi.
|
||||
* `AdGuardHome -s stop`: stop the service.
|
||||
|
||||
* `AdGuardHome -s restart`: restart the service.
|
||||
|
||||
* `AdGuardHome -s status`: show the current service status.
|
||||
|
||||
[inst]: https://github.com/AdguardTeam/AdGuardHome#installation
|
||||
|
||||
|
||||
|
||||
## <a href="#check" id="check" name="check">Check The Filtering</a>
|
||||
|
||||
## Verify DNS filtering
|
||||
You can verify that it's working properly by running this on your Pi:
|
||||
```bash
|
||||
|
||||
```sh
|
||||
host doubleclick.net 127.0.0.1
|
||||
```
|
||||
|
||||
If everything works correctly, you will get this output:
|
||||
```bash
|
||||
|
||||
```sh
|
||||
Using domain server:
|
||||
Name: 127.0.0.1
|
||||
Address: 127.0.0.1#53
|
||||
|
@ -99,37 +103,12 @@ Aliases:
|
|||
Host doubleclick.net not found: 3(NXDOMAIN)
|
||||
```
|
||||
|
||||
## Configure your devices to use your AdGuard Home
|
||||
|
||||
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).
|
||||
|
||||
<!-- TODO: link to guides or provide a short guide here -->
|
||||
## <a href="#devices" id="devices" name="devices">Configure Your Devices</a>
|
||||
|
||||
## (Optionally) password-protect web interface
|
||||
Once it is confirmed 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
|
||||
the Pi's IP address.
|
||||
|
||||
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:
|
||||
```bash
|
||||
sudo ./AdGuardHome -s stop
|
||||
```
|
||||
|
||||
Then edit the configuration file:
|
||||
```bash
|
||||
sudo nano /home/pi/AdGuardHome/AdGuardHome.yaml
|
||||
```
|
||||
|
||||
Find lines containing `auth_name: ""` and `auth_pass: ""` and replace them with username and password:
|
||||
```ini
|
||||
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:
|
||||
```bash
|
||||
sudo ./AdGuardHome -s start
|
||||
```
|
||||
|
||||
After that, visiting web interface in a browser will ask for username and password.
|
||||
Go to the “Setup Guide” page in the web interface and follow the instructions.
|
||||
|
|
Loading…
Reference in New Issue