Skip to content

Instantly share code, notes, and snippets.

@StrixROX
Last active March 8, 2026 19:06
Show Gist options
  • Select an option

  • Save StrixROX/eb3c50a11826f1fcf0892c28f6d63ee2 to your computer and use it in GitHub Desktop.

Select an option

Save StrixROX/eb3c50a11826f1fcf0892c28f6d63ee2 to your computer and use it in GitHub Desktop.
Installing Tailscale and Pi-hole on Pi Zero 2 W (Jan 26)

Preface

So after killing my Pi Zero W and wrestling with the environment way too many times I have now acquired and Pi Zero 2 W... and life has never been better.

Tailscale

As for the Tailscale part, I have the thing figured out pretty well on Pi Zero W. The issues I get on Zero W are just not there in Zero 2 W.

To install Taiscale on Zero 2 W, simply do:

curl -fsSL https://tailscale.com/install.sh | sh

Then add it to your tailnet using

sudo tailscale up

OR if using it with Pi-hole

sudo tailscale up --accept-dns=false

Done! 🥳

Pi-hole

There is some issue with Pi-hole's automated install script. It just doesn't run on either Zero W or Zero 2 W; it always ends up breaking apt. So, the workaround is to use Pi-hole with Docker.

First, install docker

curl -fsSL https://get.docker.com | sh

Then, install a Pi-hole container (Documentation)

mkdir -p ~/pihole
cd ~/pihole
nano docker-compose.yml

Sample docker-compose.yml

# More info at https://github.com/pi-hole/docker-pi-hole/ and https://docs.pi-hole.net/
services:
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    ports:
      # DNS Ports
      - "53:53/tcp"
      - "53:53/udp"
      # Default HTTP Port
      - "80:80/tcp"
      # Default HTTPs Port. FTL will generate a self-signed certificate
      - "443:443/tcp"
      # Uncomment the line below if you are using Pi-hole as your DHCP server
      #- "67:67/udp"
      # Uncomment the line below if you are using Pi-hole as your NTP server
      #- "123:123/udp"
    environment:
      # Set the appropriate timezone for your location (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones), e.g:
      TZ: 'Europe/London'
      # Set a password to access the web interface. Not setting one will result in a random password being assigned
      FTLCONF_webserver_api_password: 'correct horse battery staple'
      # If using Docker's default `bridge` network setting the dns listening mode should be set to 'ALL'
      FTLCONF_dns_listeningMode: 'ALL'
    # Volumes store your data between container upgrades
    volumes:
      # For persisting Pi-hole's databases and common configuration file
      - './etc-pihole:/etc/pihole'
      # Uncomment the below if you have custom dnsmasq config files that you want to persist. Not needed for most starting fresh with Pi-hole v6. If you're upgrading from v5 you and have used this directory before, you should keep it enabled for the first v6 container start to allow for a complete migration. It can be removed afterwards. Needs environment variable FTLCONF_misc_etc_dnsmasq_d: 'true'
      #- './etc-dnsmasq.d:/etc/dnsmasq.d'
    cap_add:
      # See https://github.com/pi-hole/docker-pi-hole#note-on-capabilities
      # Required if you are using Pi-hole as your DHCP server, else not needed
      - NET_ADMIN
      # Required if you are using Pi-hole as your NTP client to be able to set the host's system time
      - SYS_TIME
      # Optional, if Pi-hole should get some more processing time
      - SYS_NICE
    restart: unless-stopped

Note that the value of the FTLCONF_webserver_api_password environment variable is the admin login password. You can change it here before first boot of the container.

Then, start the service using docker compose up -d.

If you want to change the password again later, do docker compose down, change the password, then do docker compose up -d again.

The admin console should be accessible at pizerohostname.local/admin OR pizerotailscaleip/admin with the password you set in FTLCONF_webserver_api_password environment variable.

@StrixROX

StrixROX commented Mar 8, 2026

Copy link
Copy Markdown
Author

Apparently it didn't exactly die, after re-flashing the OS to the Pi Zero W, and waiting for 2 minutes, it did turn on. Everything works fine. The only issue is that if I use SanDisk Ultra 32GB cards without the overlayfs, every power outage would corrupt the card.

@StrixROX

StrixROX commented Mar 8, 2026

Copy link
Copy Markdown
Author

So we got a free Pi Zero W now...

To turn on overlay file system (overlayfs)

Just do sudo raspi-config and enable it under "Performance ..." option.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment