I am not able to connect postgres db as local through n8n docker?

Hi team,

I am not able to connect postgres db in postgres node.
showing ERROR: getaddrinfo ENOTFOUND

I am running n8n with docker
also tried with n8n with docker tunnel.

Any solution !!!


Hi @rajesh-kumar, localhost or the IP inside a docker container would refer to the container itself rather than the physical machine. Networking in general and in Docker specifically is a complex topic, so you might want to give the respective documentation a read.

As for your specific problem: If your n8n instance runs inside a docker container but your Postgres instance runs on bare metal, you could for example use host.docker.internal (on Windows + Mac) to reach your host machine from inside your docker container.

Hi @MutedJam, OK. I will check.


You are most welcome! If you run into trouble, it’d be great if you could describe how you have deployed Postgresql.