User Tools

Site Tools


pi-hole:setup_pi-hole_running_in_ubuntu

Pi-Hole - Setup Pi-Hole running in Ubuntu

It is recommended to have a dedicated Ubuntu instance for pi-hole.

This could be an actual physical machine, or a VM.

NOTE: The pi-hole is very lean and uses a minimal amount of system resources.

So you do not need to allocate a huge amount of memory to this Ubuntu instance; 8G should be sufficient.

20G of Hard disk space is also more than enough.


Update and Configure Ubuntu

On the Ubuntu instance where you want to run pi-hole, run updates:

sudo apt update

Next install the ssh server:

sudo apt install -y openssh-server

Now add a username other than the default. Just go through the dialogue and answer the prompts for the new user:

sudo adduser piuser

Now grant the new user privilege:

sudo usermod -aG sudo piuser

Ensure that you know the IP Address of this Ubuntu instance:

ip addr

NOTE: For this example, we assume the IP Address is 192.168.1.25


SSH into the Ubuntu

Open a terminal back on your desktop computer and “ssh” to the Ubuntu machine with the IP Address:

ssh piuser@192.168.1.25

Get root privileges in the command window:

sudo -i

Install “curl”:

sudo apt install curl

Now you can install pi-hole:

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

Select the defaults until the DNS screen and then choose Cloudflare as your DNS.

  • Accept all the rest of the defaults and be careful not to change them. This will assure that you get the admin web interface and that statistics are logged.
  • The installation will continue for a few minutes after you answer the prompts.
  • After your installation completes, you will receive a message telling you to set up the DHCP settings on your router to make the address of your Pi-Hole the primary DNS for your network.
    • That will insert the Pi-Hole as the “man-in-the-middle” to scrutinize all DNS names before they are either passed to the Internet or “Pi-Holed”.

When you return to the prompt in the “ssh” terminal session, enter the following command to set your Pi-hole password:

pihole -a -p

You can now close the “ssh” terminal session.

exit

Go to your Pi-Hole Website

Go to your web browser and enter the address of your Pi-Hole followed by /admin:

http://192.168.1.25/admin

Select the login option and you should be able to log in with the password you just set.

NOTE: Since this is running in a standard Ubuntu instance, you will be able to reboot without any problems and even upgrade Pi-Hole when new releases are available.

The pi-hole is also very lean and uses a minimal amount of system resources.

IMPORTANT: Don't forget to set the DNS settings for your DHCP server on your router because Pi-Hole will not be used by any of your network clients until that occurs.

A good practice is to make the Pi-Hole DNS 1 and then Cloudflare 1.1.1.1 as DNS 2.

That will assure DNS translation when your Pi-Hole is not running.


References

pi-hole/setup_pi-hole_running_in_ubuntu.txt · Last modified: 2020/11/16 16:26 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki