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.
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
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.
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 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.