Start the official installer, and select No when asked if you want to install lighttpd and php modules.

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

If you haven’t done so already, install caddy:

sudo apt install -y debian-keyring debian-archive-keyring apt-transport-https
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/gpg.key' | sudo gpg --dearmor -o /usr/share/keyrings/caddy-stable-archive-keyring.gpg
curl -1sLf 'https://dl.cloudsmith.io/public/caddy/stable/debian.deb.txt' | sudo tee /etc/apt/sources.list.d/caddy-stable.list
sudo apt update
sudo apt install caddy

Now install php, php-fpm and some modules:

sudo apt-get install ca-certificates apt-transport-https software-properties-common -y
echo "deb https://packages.sury.org/php/ $(lsb_release -sc) main" | sudo tee /etc/apt/sources.list.d/sury-php.list
wget -qO - https://packages.sury.org/php/apt.gpg | apt-key add -
sudo apt update
sudo apt install php8.0-fpm php8.0-cli
sudo apt install php8.0-intl php8.0-xml php8.0-sqlite3

Give the webserver user permission for group pihole:

sudo adduser www-data pihole

Finally change caddys config to serve the webinterface:

:80 {
    # Set this path to your site's directory.
    root * /var/www/html/admin
 
    # Serve a PHP site through php-fpm:
    php_fastcgi unix//run/php/php-fpm.sock {
		env SERVER_ADDR {host}
	}
}