Pi-hole is an open-source and free solution for network-wide protectors and Adblockers. You can also block the malware and other malicious content from your network. By blocking unwanted content, it can help to boost the performance of the web pages. Pi-hole also provides admin access on the web to blacklist or whitelist the ads. In short, it provides an efficient way to enhance your browsings and also to improve your network security.
The main purpose of this write-up is to provide insight into the Pi-hole installation on Ubuntu.
How to Install Pi-hole Using Curl on Ubuntu?
The following procedural steps can be performed to install Pi-hole using the Curl command on Ubuntu 22.04.
Step 1: Update Ubuntu packages
The below-mentioned update command will keep your Ubuntu packages up to date:
sudo apt update
Step 2: Install Pi-hole Using Curl
After running the update command, now your Ubuntu machine is ready to install the Pi-hole package. Type the given below command or simply, copy the command into the CLI. This command will start installing the Pi-hole packages and dependencies:
curl -sSL https://install.pi-hole.net | bash
After running the command, the installation process will start, as shown in the above screenshot.
A few moments later, a GUI interface will display on your screen with the following instructions. Follow these instructions as per your requirements to complete the installation process:
Click the OK to contribute to Pi-hole through donations:
Now, it’s time to configure the static IP address. Click Continue button to move forward to the next step:
You can choose the DNS provider from the list below or customize by selecting Custom. Click the OK to proceed next:
To Blocklist the block ads. You can select No to add your own list or can select Yes to include the third-party list, such as StevenB’s Unified Host List:
If you want to install the Admin Web Interface, click the Yes option, as shown in the below screenshot:
Select the Yes option from the below option to install some required PHP modules for Admin Web Interface:
To enable query logging, select the Yes option:
There will be several options for privacy mode, choose one of the followings. For example, I will prefer the first option “Show everything”. Click Continue to proceed next:
Finally, the installation process is completed successfully. In the end, a message will be displayed on your Ubuntu 22.04 with Static IP address and Admin Password for webpage login:
In the above screenshot, the installation process of the Pi-hole is completed.
To display the current status of the Pi-hole, execute the command given below for your reference:
How to Uninstall the Pi-hole from Ubuntu 22.04?
Linux distribution including Ubuntu provides an easy way to uninstall the packages along with their required dependencies. Run the command mentioned below to uninstall the Pi-hole package:
Note: While removing package files and dependencies, you may choose Y for Yes or N for No according to your need.
Ubuntu 22.04 provides an easy way to install Pi-hole. For installing the Pi-hole package, you need to run the “curl -sSL https://install.pi-hole.net | bash” from the Ubuntu terminal. Furthermore, a single-line command such as “pihole uninstall” will remove the Pi-hole package. In this post, we have provided a detailed process of the installation, configuration, and uninstallation of Pi-hole on Ubuntu 22.04.