How to set password in Pi-hole 6 Docker container

You can run commands inside the docker image. Same problem, webpassword variable doesn't work.

run

sudo docker ps -a

or

sudo docker container ls

get the container ID and then run

sudo docker exec -it "ContainerID" pihole setpassword

image

If you value your time and sanity, I'd advise staying as far away as possible from docker.

For setting a password for a Pi-hole v6 container, use FTLCONF_webserver_api_password, see Upgrading from v5.x - Pi-hole documentation.