userdoc:guest_lxc_container_pihole

This is an old revision of the document!


Pi-hole DNS Blocking

The Pi-hole project is a “DNS sinkhole” that protects your devices from unwanted content, without installing any client-side software.

Pi-hole is a perfect example to use with AstLinux within a LXC.

Resource Usage: (minimum)

  • Memory: 50 MB
  • Storage: 0.8 GB


First, it is assumed the lxcbr0 interface is setup per the Quick Start Guide → Enable LXC Support.

Then from the CLI:

lxc-create -t download -n pi-hole -- -d debian -r buster -a amd64 --no-validate
service lxc restart
lxc-attach pi-hole
  passwd
  apt update
  apt install openssh-server iputils-ping curl
  ...
  exit

Tip -> Optionally you may want to also…

  apt install sudo nano

Tip -> Set PermitRootLogin yes for sshd and restart sshd. Type exit to leave the container and do the rest via ssh.


Install Pi-hole:

Either with lxc-attach pi-hole or ssh root@pi-hole_ip_address

curl -sSL https://install.pi-hole.net -o pihole.sh
# Comment out the "set -e" in pihole.sh, then
bash pihole.sh

Follow the dialogs and answer the questions.

Change Pi-hole WebGUI password:

/usr/local/bin/pihole -a -p


Tip -> If lighttpd is not started after the Pi-hole installation (⇒ netstat -tlp):

apt remove lighttpd
bash pihole.sh
# choose "Update"


Related Info -> LXC container in AstLinux

  • userdoc/guest_lxc_container_pihole.1591027169.txt.gz
  • Last modified: 2020/06/01 10:59
  • by abelbeck