Setup your Pi-hole
Tags: opensource, raspberrypi, pihole, privacy
Published: 2018-08-14 23:09:05

---
title: Setup your Pi-hole
published: true
description: Setup and protect your data !
tags: opensource, raspberrypi, pihole, privacy
cover_image: https://dev-to-uploads.s3.amazonaws.com/i/n5x6tg7n4eyw7tsbr90t.png
series: RaspberryPi
---

## Table Of Contents
 * [Introduction](#introduction)
 * [Raspbian installation](#raspbian)
 * [Install Pi-hole](#install)
 * [Web panel and end](#webpanel)
 * [Links](#links)

____

▪ **Introduction** <a name="introduction"></a>

This post shows how to install Pi-hole on a raspberry Pi 3 B.

Pi-hole is used to block unwanted queries and URLs that you do not want to load on the network. it protects you from trackers and optimizes the traffic of your network.


▪ **Raspbian installation and update/upgrade packages** <a name="raspbian"></a>

First, flash your disk SD from [Etcher](https://etcher.io/) or other app.

![Etcher](https://thepracticaldev.s3.amazonaws.com/i/tzwcx8mxw8gpgigo3qzo.png)

*Here is Raspbian Stretch 2017-09-07 Lite*
Wait minutes.. and is complete ! 

![Etcher complete](https://thepracticaldev.s3.amazonaws.com/i/bzddfqqq98353whzdzfa.png)

Connect your setup for update and install new packages.

```bash
sudo apt update -y && sudo apt upgrade -y
```

Wait good minutes .. during this time drink a good cappuccino.

Install **curl** :
```bash
sudo apt install curl
```

▪ **Install Pi-hole** <a name="install"></a>

You can [clone from the repo of Pi-hole](https://github.com/pi-hole/pi-hole) or directly curl with this command : 

```bash
curl -sSL https://install.pi-hole.net | bash
```

When ask you if you want install on your raspberry and put in static IP, check yes.

![Pi-hole need Static IP](https://thepracticaldev.s3.amazonaws.com/i/y8vycumsgj71q439r894.png)
Then choose your preferred DNS. *You can then change it and put several.*

![Choice your prefered DNS](https://thepracticaldev.s3.amazonaws.com/i/zqt86061tsssjs1kcgrd.png)

You can select blocklists ads : 

![List of Block ads per default](https://thepracticaldev.s3.amazonaws.com/i/7q0ca1x7g91ogowrghnp.png)

It will also ask you if you want a **web panel**, I strongly **recommend** you to leave validated so that you can from anywhere in the local network connect to the raspberry with a password and manage your DNS/blacklist and have your statistics.
 

▪ **Web panel and end** <a name="webpanel"></a>

As soon as you finish installing Pi-hole, it will give you the localhost address and the password generated.

For edit the password :
```bash
sudo pihole -a -p 
```

This is a preview of the panel when you are connected 🎉
The dark theme is edited by me, you can found at [this repository](https://github.com/thomasbnt/Night_Pihole).


![Preview](https://thepracticaldev.s3.amazonaws.com/i/1qv4wm9gsc2plp8209fx.png)



▪ **Links** <a name="links"></a>

[Repository of Pi-hole](https://github.com/pi-hole/pi-hole)


___
|☕|Check my [Twitter account](https://twitter.com/thomasbnt_). You can see many projects and updates. You can also [support me on Buy Me a Coffee, Stripe or GitHub Sponsors](https://thomasbnt.dev/donate). Thanks for read my post ! 🤩|
|---|---|