Error While deploying n8n Docker

I am using below Docker Image
https://hub.docker.com/r/n8nio/n8n#start-n8n-in-docker
to Build and tring to connect with external Postgres DB
here are my params

  DB_TYPE: "postgresdb"
  DB_POSTGRESDB_DATABASE: "n8n"
  DB_POSTGRESDB_HOST: "co.clswme2q-1.rds.amazonaws.com"
  DB_POSTGRESDB_PORT: "5432"
  DB_POSTGRESDB_USER: "postgres"
  DB_POSTGRESDB_PASSWORD: "sect"

and getting below error

no pg_hba.conf entry for host “172.31.46.212”, user “postgres”, database “n8n”, no encryption

It looks like your topic is missing some important information. Could you provide the following if applicable.

  • n8n version:
  • Database (default: SQLite):
  • n8n EXECUTIONS_PROCESS setting (default: own, main):
  • Running n8n via (Docker, npm, n8n cloud, desktop app):
  • Operating system:

hi @Ganesh_Wankhede

Based on the error message you’re receiving, it appears that there might be a configuration issue related to SSL connections. Here are a few suggestions to help resolve this:

  1. Enable SSL for the database connection:
    Try adding the following environment variable to your Docker configuration:
DB_POSTGRESDB_SSL_ENABLED: "true"

This setting is mentioned in the Environment variables reference | n8n Docs.

  1. If the above doesn’t work, you may need to disable SSL rejection:
    Add this environment variable:
DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED: "false"

This is suggested in a similar case in the n8n community forum.

  1. Ensure that your RDS instance is configured to allow connections from your Docker container’s IP address. The error message mentions an IP (172.31.46.212) which might be your container’s IP. Make sure this IP is allowed in your RDS security group.
  2. Double-check your RDS endpoint. The host you provided (co.clswme2q-1.rds.amazonaws.com) seems unusual for an RDS endpoint. Typically, RDS endpoints are in the format: <instance-name>.<random-string>.<region>.rds.amazonaws.com. Verify that you’re using the correct endpoint.

Remember to restart your n8n container after making these changes to the environment variables.

Hope this helps!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.