Installing Pi-Hole on Ubuntu 22.04
Before you start installing Pi-Hole, connect to your Ubuntu server.
I have used PowerShell 7 below, but you can use any of the SSH clients you are more comfortable with.
For more information on other SSH Clients, see article below:
Choosing an SSH Client
To connect to your server you will need your username, password and IP Address of the server you are connecting to, then connect using the command ‘username@IPaddress‘.
You will be asked for your password and to confirm that you want to continue the connection (if you are logging into the server for the first time).
Once connected, run the command ‘sudo -i‘, and enter your password again.
You are now logged in as root, with ‘superuser‘ permissions to the server. (you do not need to add ‘sudo‘ before each command that requires ‘su‘ permissions).
Next, check for and install any available updates for that server by running the below 2 commands;
apt-get update apt-get upgrade
Once the upgrade is complete, reboot your server and reconnect to it, then run ‘sudo -i‘.
Now run the below command to start the Pi-Hole installation;
curl -sSL https://install.pi-hole.net | bash
Most settings can remain by default, but you can customize the setup as you wish:
Once the installation is complete, save the login details shown on the last window.
If you do not save or forget the password displayed during configuration, you can change it by running the command below.
sudo pihole -a -p
Open your browser and login to your Admin portal as below.
Once your Pi-Hole is installed and configured, it is time to configure it as the DNS server to be used by your Router.
Use Pi-Hole from anywhere by staying connected to your network using OpenVPN, easy configuration via PiVPN.
See also how to Force Safe Search using Pi-Hole for Google, YouTube, Bing and DuckDuckGo.