Add a healthcheck to the n8n docker images by default utilizing n8n’s /healthz status endpoint (which must be enabled for this to work - since it is not enabled by default, that may be a point of contention here? Or maybe it’s not a big deal.)
My use case:
To allow for out of the box Docker health monitoring of n8n containers. With it enabled, docker can perform it’s own management steps if a container becomes unhealthy, the user can see that it’s health in docker ps output, etc.
I think it would be beneficial to add this because:
It may help people catch configuration mishaps that only show up during runtime, or resource issues/etc that cause the health endpoint to fail.
Along with setting QUEUE_HEALTH_CHECK_ACTIVE=true to enable the /healthz endpoint, I’m using the following command that works well for the healthcheck command in my docker-compose setup:
Thanks, yes it does work, and if you see above I basically am doing this in my own Docker compose configuration.
My proposal for a new feature was for this to be built in to the Dockerfile / docker image directly, so all users of the Docker image can benefit from healthchecks automatically.
Talking about healthchecks, mine has started failing when trying to use localhost. I exchanged it for 127.0.0.1 and it works again. This looks weird, any ideas?
I had this happen as well, along with use of the n8n API within n8n.
A recent Docker upgrade for Engine v26.0 changed how IPv6 resolution of hostnames, including localhost, is handled within containers, and I believe it is the cause for this - are you using Docker v26?
I’m not sure how to get n8n’s Docker image to listen on both IPv4 and IPv6 inside the container, but I think doing so would fix this.