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 127.0.0.1.

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

Any solution !!!

Thanks.

Hi @rajesh-kumar, localhost or the 127.0.0.1 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.

Thanks.

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