Hi @Tk8and15, this suggests your n8n docker container can’t talk to Postgres on port 5432. From looking at your screenshot it seems you are only launching n8n, so I am not sure whether you are running PostgreSQL also via docker or directly on your server.
The docker run command from your screenshot would use the default bridge networking mode unless I am missing something. This means that your containers are isolated from each other, but can talk to each other using the respective container name as the hostname. So if your Postgres container is called db, you’d need to use db as the hostname.
If Postgres runs on your host machine, you probably want to use a hostname of host.docker.internal to reach your host as described here in the Docker documentation.
You would run it in its own container. But since Postgres is already running you shouldn’t need to. Simply use host.docker.internal to reach your host from inside your container.
The IP shared by @jon will also work in most cases, but Docker suggests you avoid using it (as it can change):
The host has a changing IP address (or none if you have no network access). We recommend that you connect to the special DNS name host.docker.internal which resolves to the internal IP address used by the host. This is for development purpose and does not work in a production environment outside of Docker Desktop.
Hm, that seems odd. n8n being able to start would suggest it can talk to the database. Which database is your n8n instance using instead? Can you share the full log output?
This seems like the n8n application database connection is working fine. You should be able to see a bunch of n8n-created tables in the database already.
The warning appears to be related to the connection test for a Postgres node you’re using. I think this might have been caused by a bug which has been fixed in the meantime. If you’re having trouble using the Postgres node inside n8n, could you try running an updated version of n8n? For example by running n8nio/n8n:0.209.0 instead of just n8nio/n8n
Also make sure you update the hostname in the Postgresql credentials used by your nodes as well.
It seems you are still using localhost as a hostname in your credentials. As suggested above you need to change this to host.docker.internal, just like you did with the environment variable.
So this would suggest your credentials are wrong, just like the error message says.
You might want to simply delete your ~/.n8n folder if you don’t have any production data in n8n yet (as per this topic you’ve opened) and also clean the database you’re currently using, seeing you are using Postgres here rather than the SQLite database from your other thread. This would give you a fresh start.
Depending on which Windows version your are using and how your system is set up the ~/.n8n folder might live inside your WSL filesystem.
Alternatively you could use the CLI command to reset your credentials but this would have to be executed inside your docker container as documented here.
Going forward if you’re using n8n locally and are the only one using it you might want to skip setting a username & password, especially if you run several n8n instances using different databases rather then setting different credentials.
Why can’t the programming environment n8n built by myself be started?
Error:n8n’s port 5678 is already in use. Do you have another instance of n8n running already?