<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://lms.onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=Ubuntu%3A_Install_PiHole</id>
	<title>Ubuntu: Install PiHole - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://lms.onnocenter.or.id/wiki/index.php?action=history&amp;feed=atom&amp;title=Ubuntu%3A_Install_PiHole"/>
	<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=Ubuntu:_Install_PiHole&amp;action=history"/>
	<updated>2026-04-21T23:57:14Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://lms.onnocenter.or.id/wiki/index.php?title=Ubuntu:_Install_PiHole&amp;diff=65033&amp;oldid=prev</id>
		<title>Unknown user: Created page with &quot;How to Install &amp; Configure Pihole on Ubuntu 20.04 1. Installation – Run these commands:  # sudo apt-get install gamin -y sudo curl -sSL https://install.pi-hole.net | bash...&quot;</title>
		<link rel="alternate" type="text/html" href="https://lms.onnocenter.or.id/wiki/index.php?title=Ubuntu:_Install_PiHole&amp;diff=65033&amp;oldid=prev"/>
		<updated>2022-05-03T10:20:12Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;How to Install &amp;amp; Configure Pihole on Ubuntu 20.04 1. Installation – Run these commands:  # sudo apt-get install gamin -y sudo curl -sSL https://install.pi-hole.net | bash...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;How to Install &amp;amp; Configure Pihole on Ubuntu 20.04&lt;br /&gt;
1. Installation&lt;br /&gt;
– Run these commands:&lt;br /&gt;
&lt;br /&gt;
# sudo apt-get install gamin -y&lt;br /&gt;
sudo curl -sSL https://install.pi-hole.net | bash&lt;br /&gt;
– Possible problem: lighttpd service not running (when gamin has not been preinstalled)&lt;br /&gt;
– Fix: run these commands&lt;br /&gt;
&lt;br /&gt;
sudo pihole uninstall&lt;br /&gt;
rambo@pihole:~$ sudo pihole uninstall&lt;br /&gt;
[?] Are you sure you would like to remove Pi-hole? [y/N] y&lt;br /&gt;
[✓] Root user check&lt;br /&gt;
[✓] Update local cache of available packages&lt;br /&gt;
[i] Existing PHP installation detected : PHP version 7.4.3&lt;br /&gt;
[i] Be sure to confirm if any dependencies should not be removed&lt;br /&gt;
[i] The following dependencies may have been added by the Pi-hole install:&lt;br /&gt;
dhcpcd5 git iproute2 whiptail dnsutils cron curl iputils-ping lsof netcat psmisc sudo unzip wget idn2 sqlite3 libcap2-bin dns-root-data libcap2 lighttpd php7.4-common php7.4-cgi php7.4-sqlite3 php7.4-xml php7.4-json php7.4-intl &lt;br /&gt;
[?] Do you wish to go through each dependency for removal? (Choosing No will leave all dependencies installed) [Y/n] n&lt;br /&gt;
[✓] Removed Web Interface&lt;br /&gt;
[✓] Removed /etc/cron.d/pihole&lt;br /&gt;
[✓] Removed lighttpd configs&lt;br /&gt;
[✓] Removed config files&lt;br /&gt;
[i] Removing pihole-FTL...Failed to stop pihole-FTL.service: Unit pihole-FTL.service not loaded.&lt;br /&gt;
sudo apt-get update -y&lt;br /&gt;
sudo apt-get upgrade -y&lt;br /&gt;
sudo apt purge lighttpd -y&lt;br /&gt;
#sudo pihole -r &lt;br /&gt;
#useradd -G pihole pihole&lt;br /&gt;
sudo apt-get install gamin -y&lt;br /&gt;
curl -sSL install.pi-hole.net | sudo bash&lt;br /&gt;
2. Follow the wizard to complete the installation&lt;br /&gt;
Hint: simply by pressing enter or &amp;lt;ok &amp;gt;repeatedly until reaching this screen&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Configure firewall&lt;br /&gt;
# Adding firewall rules per pihole prerequites https://docs.pi-hole.net/main/prerequisites/&lt;br /&gt;
#sudo iptables -I INPUT -p tcp --dport 53 -j ACCEPT&lt;br /&gt;
#sudo iptables -I INPUT -p udp --dport 53 -j ACCEPT&lt;br /&gt;
#sudo iptables -I INPUT -p udp --dport 67 -j ACCEPT&lt;br /&gt;
sudo iptables -I INPUT -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
sudo iptables -I INPUT -p tcp --dport 4711 -j ACCEPT&lt;br /&gt;
sudo iptables -I INPUT -p tcp --dport 4712 -j ACCEPT&lt;br /&gt;
sudo iptables -I INPUT -p tcp --dport 4713 -j ACCEPT&lt;br /&gt;
sudo iptables -I INPUT -p tcp --dport 4714 -j ACCEPT&lt;br /&gt;
sudo iptables -I INPUT -p tcp --dport 4715 -j ACCEPT&lt;br /&gt;
sudo iptables -I INPUT -p tcp --dport 4716 -j ACCEPT&lt;br /&gt;
sudo iptables -I INPUT -p tcp --dport 4717 -j ACCEPT&lt;br /&gt;
sudo iptables -I INPUT -p tcp --dport 4718 -j ACCEPT&lt;br /&gt;
sudo iptables -I INPUT -p tcp --dport 4719 -j ACCEPT&lt;br /&gt;
sudo iptables -I INPUT -p tcp --dport 4720 -j ACCEPT&lt;br /&gt;
sudo ip6tables -I INPUT -p udp --dport 547 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
# DHCP Server:&lt;br /&gt;
sudo iptables -I INPUT -p tcp --dport 67 -j ACCEPT&lt;br /&gt;
sudo iptables -I INPUT -p udp --dport 67 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
# DHCP client/relay&lt;br /&gt;
sudo iptables -I INPUT -p tcp --dport 68 -j ACCEPT&lt;br /&gt;
sudo iptables -I INPUT -p udp --dport 68 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
# DHCP Failover partners&lt;br /&gt;
sudo iptables -I INPUT -p tcp --dport 647 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
# DNS&lt;br /&gt;
sudo iptables -I INPUT -p tcp --dport 53 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
# Grant Pihole TCP:53 access to localhost&lt;br /&gt;
sudo iptables -A INPUT -s 127.0.0.0/8 -p tcp -m tcp --dport 53 -j ACCEPT&lt;br /&gt;
&lt;br /&gt;
# Allowing a traffic from a certain subnet&lt;br /&gt;
iptables -A INPUT -s 10.10.10.0/22 -j ACCEPT&lt;br /&gt;
# iptables -D INPUT -s 10.10.10.0/22 -j ACCEPT # Reverse previous command&lt;br /&gt;
&lt;br /&gt;
# Save firewall rules&lt;br /&gt;
sudo sh -c &amp;quot;iptables-save &amp;gt; /etc/iptables/rules.v4&amp;quot;&lt;br /&gt;
sudo sh -c &amp;quot;ip6tables-save &amp;gt; /etc/iptables/rules.v6&amp;quot;&lt;br /&gt;
# Fixing startup conflicts between iptables &amp;amp; netfilter-persistent&lt;br /&gt;
# sudo systemctl edit netfilter-persistent.service&lt;br /&gt;
vim /etc/systemd/system/netfilter-persistent.service.d/iptables.conf&lt;br /&gt;
### Verify this content ###&lt;br /&gt;
[Unit]&lt;br /&gt;
Conflicts=iptables.service ip6tables.service&lt;br /&gt;
&lt;br /&gt;
### Modify content and save file ###&lt;br /&gt;
[Unit]&lt;br /&gt;
After=iptables.service ip6tables.service ufw.service&lt;br /&gt;
4. Check service status&lt;br /&gt;
rambo@pihole:~$ service lighttpd status&lt;br /&gt;
● lighttpd.service - Lighttpd Daemon&lt;br /&gt;
Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled; vendor preset: enabled)&lt;br /&gt;
Active: active (running) since Fri 2020-12-04 22:43:12 PST; 10min ago&lt;br /&gt;
Main PID: 32359 (lighttpd)&lt;br /&gt;
Tasks: 6 (limit: 4615)&lt;br /&gt;
Memory: 10.0M&lt;br /&gt;
CGroup: /system.slice/lighttpd.service&lt;br /&gt;
├─32359 /usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf&lt;br /&gt;
├─32393 /usr/bin/php-cgi&lt;br /&gt;
├─32396 /usr/bin/php-cgi&lt;br /&gt;
├─32397 /usr/bin/php-cgi&lt;br /&gt;
├─32398 /usr/bin/php-cgi&lt;br /&gt;
└─32399 /usr/bin/php-cgi&lt;br /&gt;
&lt;br /&gt;
Dec 04 22:43:12 pihole systemd[1]: Starting Lighttpd Daemon...&lt;br /&gt;
Dec 04 22:43:12 pihole systemd[1]: Started Lighttpd Daemon.&lt;br /&gt;
rambo@pihole:~$ service pihole* status&lt;br /&gt;
● pihole-FTL.service - LSB: pihole-FTL daemon&lt;br /&gt;
Loaded: loaded (/etc/init.d/pihole-FTL; generated)&lt;br /&gt;
Active: active (exited) since Fri 2020-12-04 22:43:14 PST; 18min ago&lt;br /&gt;
Docs: man:systemd-sysv-generator(8)&lt;br /&gt;
Process: 32518 ExecStart=/etc/init.d/pihole-FTL start (code=exited, status=0/SUCCESS)&lt;br /&gt;
&lt;br /&gt;
Dec 04 22:43:14 pihole systemd[1]: Starting LSB: pihole-FTL daemon...&lt;br /&gt;
Dec 04 22:43:14 pihole pihole-FTL[32518]: Not running&lt;br /&gt;
Dec 04 22:43:14 pihole su[32536]: (to pihole) root on none&lt;br /&gt;
Dec 04 22:43:14 pihole su[32536]: pam_unix(su:session): session opened for user pihole by (uid=0)&lt;br /&gt;
Dec 04 22:43:14 pihole su[32536]: pam_unix(su:session): session closed for user pihole&lt;br /&gt;
Dec 04 22:43:14 pihole systemd[1]: Started LSB: pihole-FTL daemon.&lt;br /&gt;
5. Configuration&lt;br /&gt;
Pihole Control Panel:&lt;br /&gt;
http://piholeServerIp/admin&lt;br /&gt;
Ad Lists:&lt;br /&gt;
https://firebog.net&lt;br /&gt;
https://hosts.oisd.nl&lt;br /&gt;
https://github.com/mmotti/pihole-regex/blob/master/regex.list&lt;br /&gt;
Test&lt;br /&gt;
dig @&amp;lt;piholeServerIp&amp;gt; blockedsite.com&lt;br /&gt;
Flush dns&lt;br /&gt;
sudo systemd-resolve --flush-caches # Ubuntu&lt;br /&gt;
service nscd restart # Redhat&lt;br /&gt;
ipconfig /flushdns # Windows&lt;br /&gt;
Blacklist – regex blocks&lt;br /&gt;
Youtube ads: .*sn-\S{4,}-\S{4,}\.googlevideo\.com&lt;br /&gt;
Youtube.com: (\.|^)(youtu\.?be.*|googlevideo\.com)$&lt;br /&gt;
Change admin password&lt;br /&gt;
sudo pihole -a -p&lt;br /&gt;
6. Troubleshooting&lt;br /&gt;
Issue: ‘DNS Service Not Running’&lt;br /&gt;
Resolution 1: pihole checkout master&lt;br /&gt;
Resolution 2: re-install pihole&lt;br /&gt;
  – Backup: pihole -a teleporter&lt;br /&gt;
  – Move backup file: copy the tar.gz file from current directory $(pwd)/*.tar.gz to desktop where Internet browser is available for the restoring step&lt;br /&gt;
  – Uninstall: pihole uninstall&lt;br /&gt;
  – Reinstall: sudo apt install pihole&lt;br /&gt;
  – Restore settings: Login into Pi-hole &amp;gt; Settings &amp;gt; Teleporter &amp;gt; Under Restore, click Choose File &amp;gt; pick the backup file in tar.gz format &amp;gt; open &amp;gt; click Restore &amp;gt; OK&lt;br /&gt;
Resolution 3: &lt;br /&gt;
 – Run debug: pihole -d&lt;br /&gt;
 – Grant Pihole TCP:53 access to localhost: sudo iptables -A INPUT -s 127.0.0.0/8 -p tcp -m tcp --dport 53 -j ACCEPT&lt;br /&gt;
Resolution 4: Set the watchservice script to ensure that pihole is running at all times&lt;br /&gt;
Issue: unable to reach server via port 80&lt;br /&gt;
Resolution: sudo iptables -I INPUT -p tcp --dport 80 -j ACCEPT&lt;br /&gt;
Issue: Pihole service crashes at random times&lt;br /&gt;
Resolution: create a service watcher script&lt;br /&gt;
7. How to create a Backup via command line:&lt;br /&gt;
cd ~/Desktop&lt;br /&gt;
pihole -a teleporter&lt;br /&gt;
ls ~/Desktop&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Referensi==&lt;br /&gt;
&lt;br /&gt;
* https://kimconnect.com/how-to-install-configure-pihole-on-ubuntu-20-04/&lt;/div&gt;</summary>
		<author><name>Unknown user</name></author>
	</entry>
</feed>