Arch Linux BasedManjaro

How To Install Pi-hole on Manjaro

Install Pi-hole on Manjaro

In this tutorial, we will show you how to install Pi-hole on Manjaro. Pi-hole is a DNS sinkhole that blocks unwanted content, such as advertisements, trackers, and malware, before it even reaches your devices. By acting as a DNS server for your entire network, Pi-hole can protect all your connected devices, including computers, smartphones, tablets, and smart home devices, without the need for individual ad-blocking extensions or apps.

With Pi-hole, you’ll enjoy a cleaner, faster, and more secure browsing experience, free from annoying pop-ups, auto-play videos, and intrusive tracking. Additionally, Pi-hole can improve your network’s performance by reducing the amount of data transferred, resulting in faster load times and lower bandwidth consumption.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you the step-by-step installation of the Pi-hole on a Manjaro Linux.

Prerequisites

  • A server or desktop running one of the following operating systems: Manjaro, and other Arch-based distributions.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • SSH access to the server (or just open Terminal if you’re on a desktop).
  • A stable internet connection is crucial for downloading and installing packages. Verify your connection before proceeding.
  • Access to a Manjaro Linux system with a non-root sudo user or root user.

Install Pi-hole on Manjaro

Step 1. Before proceeding with the installation of Pi-hole, it is crucial to prepare your Manjaro system. Start by updating your system packages to the latest versions to ensure compatibility and security:

sudo pacman -Syu

This command updates the package database and upgrades all outdated packages, ensuring compatibility and security.

Step 2. Installing Pi-hole on Manjaro.

  • Installing Pi-hole from AUR

The Arch User Repository (AUR) is a community-driven repository for Arch-based distributions, including Manjaro. It provides a convenient way to install Pi-hole and its dependencies with a single command.

Before we can install the Pi-hole from AUR, we need to enable the AUR repository in Manjaro. Open the terminal and run the following command:

sudo pacman-mirrors --api --set-branch stable

With the AUR repository enabled, we can now install the Pi-hole package. In the terminal, run the following command:

sudo pacman -S pi-hole-server

After the installation is complete, you’ll need to configure Pi-hole to work with your network. First, edit the /etc/hosts file to point to the Pi-hole IP address:

sudo nano /etc/hosts

Add the following line at the end of the file, replacing 192.168.77.20 with your Pi-hole server’s IP address:

192.168.77.20 pi.hole

Next, you’ll need to configure your router’s DHCP settings to use Pi-hole as the DNS server. This process varies depending on your router’s make and model, so consult your router’s documentation or search online for specific instructions.

Once you’ve updated your router’s DHCP settings, you can access the Pi-hole web interface by visiting http://pi.hole/admin in your web browser. From here, you can customize Pi-hole’s settings, view logs, and manage blocklists.

  • Installing Pi-hole from Source

Before we can install the Pi-hole from the source, we need to ensure that all the required dependencies are installed. Open the terminal and run the following command:

sudo pacman -S dnsmasq php php-sqlite git

Next, we’ll download the Pi-hole installer script. You can either clone the Pi-hole repository using Git or download the installer script directly:

git clone --depth 1 https://github.com/pi-hole/pi-hole.git Pi-hole

Alternatively, you can download the installer script directly:

wget -O basic-install.sh https://install.pi-hole.net

Navigate to the directory where you downloaded or cloned the Pi-hole repository, and run the installer script:

cd Pi-hole
sudo bash basic-install.sh

After the installation is complete, you’ll need to configure Pi-hole in the same way as the AUR installation method. Edit the /etc/hosts file to point to the Pi-hole IP address and configure your router’s DHCP settings to use Pi-hole as the DNS server.

Finally, you’ll need to start and enable the required Pi-hole services. Run the following commands:

sudo systemctl start pihole-FTL.service
sudo systemctl enable pihole-FTL.service

Once you’ve successfully installed and configured Pi-hole, you can start enjoying its benefits immediately. The Pi-hole web interface is accessible at http://pi.hole/admin. From here, you can monitor and manage various aspects of Pi-hole, including:

  • Whitelisting and blacklisting domains
  • Viewing and filtering the query log
  • Updating blocklists
  • Configuring settings and customizations

In addition to the web interface, Pi-hole also provides a command-line interface (CLI) for advanced users. Here are some useful CLI commands:

  • pihole -g: Display the current Pi-hole status
  • pihole -a setdns: Set the upstream DNS server for Pi-hole
  • pihole -a blacklist and pihole -a whitelist: Add domains to the blacklist or whitelist
  • pihole -a clearCache: Clear the Pi-hole cache

Congratulations! You have successfully installed the Pi-hole. Thanks for using this tutorial to install the latest version of the Pi-hole on the Manjaro system. For additional help or useful information, we recommend you check the official Pi-hole website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!

r00t

r00t is an experienced Linux enthusiast and technical writer with a passion for open-source software. With years of hands-on experience in various Linux distributions, r00t has developed a deep understanding of the Linux ecosystem and its powerful tools. He holds certifications in SCE and has contributed to several open-source projects. r00t is dedicated to sharing her knowledge and expertise through well-researched and informative articles, helping others navigate the world of Linux with confidence.
Back to top button