Install PiHole on ubuntu server 22.04 LTS
Back to Home / Back to Notes

Install PiHole on ubuntu server 22.04 LTS

Summary:

1 - Update the server

2 - Install PiHole

3 - Connecte to the dashboard

Tutorials used as reference:

None

1 - Update the server

Update the packages

First, as walways, we update the list of packages:

sudo apt update

Then, we upgrade the packages and add "-y" as upgrade always requires a confirmation or abortion with letters "y" or "n":

sudo apt upgrade -y

Create pihole user for the server:

We log in by SSH with our username but we will create a separate one specifically to run the server so we can use the main one for other tasks.

sudo adduser pihole

Add the user to the sudo group:

sudo usermod -aG sudo minecraft

change account:

su - pihole

Set static IP

In order to use PiHole, if we haven't done so, it is highly recommended to setup a static IP. If we don't do so, then our server with DHCP could be changing IPs and therefore our computers won't be able to us it for DNS queries.
In order to set a static IP, we will do so:

cd /etc/netplan/

Once in netplan folder, where our IPs are managed (for both Wifi & Ethernet) we will edit the file:

sudo nano 01-network-manager-all.yaml

Your file could have a different name if your are on Wifi.


        # This is the network config written by 'subiquity'
        network:
            ethernets:
                enp0s31f6:
                    dhcp4: false
                    addresses: [192.168.1.6/24]
                    gateway4: 192.168.1.1
                    nameservers:
                        addresses: [1.1.1.1,8.8.4.4]
                version: 2
        

2 - Install PiHole

Install PiHole:

In order to Install PiHole on a Debian based system (Ubuntu in this case) we can just do a Curl:

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

Validate the screens

After we validate the Curl command on the terminal, we will be present a graphical installation of PiHole with different options to validate

asdasd