Using Caddy instead of lighttpd with Pi-Hole

You can use Caddy + php-fpm to access Pi Hole’s web interface without lighttpd.

This guide assumes you already have Caddy installed and running.

Security note: This guide does not cover best security practices. It is just a basic “here’s what you need to make it work” guide. It is up to you to secure your installation properly.

If installed, stop lighttpd:

service lighttpd stop

Install php-fpm and enable it:

apt install php8.0-fpm   # change this to use the latest version
systemctl enable php8.0-fpm
systemctl start php8.0-fpm

Make your Caddyfile:

192.168.0.1:5555  # replace with your site address

root * /var/www/html
php_fastcgi unix//run/php/php8.0-fpm.sock
file_server

Reload the new config (this is just an example if you have a caddy service running):

systemctl reload caddy

Note: As of May 2020, the Pi Hole project is moving toward not requiring any external web server or interpreter, but as of PiHole 5.0 it is still needed. In the future, using a web server will apparently not be necessary unless you want to reverse proxy to it.

4 Likes