# PostgreSQL error

**URL:** <https://community.n8n.io/t/postgresql-error/197106>\
**Category:** Questions\
**Tags:** deployment, postgres\
**Created:** [September 30, 2025, 2:02pm UTC](https://community.n8n.io/t/postgresql-error/197106 "2025-09-30T14:02:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![billy19991027](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/billy19991027/32/65214_2.png) [@billy19991027](https://community.n8n.io/u/billy19991027)\
**Post date:** [September 30, 2025, 2:02pm UTC](https://community.n8n.io/t/postgresql-error/197106/1 "2025-09-30T14:02:39Z")

</div>

## Describe the problem/error/question

I am trying to install n8n community edition and would like to use PostgreSQL database. My database is a managed database hosted with DigitalOcean. When I configure the settings in .env for the PostgreSQL, I get connectivity error

## What is the error message (if any)?

Sep 30 02:33:50 dl-prd-n8n-01 n8n[37920]: Initializing n8n process

Sep 30 02:33:50 dl-prd-n8n-01 n8n[37920]: There was an error initializing DB

Sep 30 02:33:50 dl-prd-n8n-01 n8n[37920]: no pg\_hba.conf entry for host “10.124.0.10”, user “n8n\_user”, database “n8n\_prd”, no encryption

## Please share your workflow

```auto
N.A.

```

## Share the output returned by the last node

## Information on your n8n setup

- **n8n version:** 1.113.3
- **Database (default: SQLite): PostgrSQL**
- **n8n EXECUTIONS\_PROCESS setting (default: own, main):**
- **Running n8n via (Docker, npm, n8n cloud, desktop app): Ubuntu Server**
- **Operating system: Ubintu**

Below are the settings in my .env file

DB\_TYPE=postgresdb

DB\_POSTGRESDB\_DATABASE=n8n\_prd

DB\_POSTGRESDB\_HOST=n8n\_db.ondigitalocean.com

DB\_POSTGRESDB\_PORT=25565

DB\_POSTGRESDB\_USER=n8n\_db\_user

DB\_POSTGRESDB\_PASSWORD=AVeryStrongPassword

DB\_POSTGRESDB\_SSL=true

I have also tried with the below settings and with these settings, n8n tries to connect to PostgreSQL on localhost and fails

DB\_TYPE=postgresdb

DB\_POSTGRESDB\_CONNECTION\_URL=postgresql://n8n\_db\_user:AVeryStrongPassword@n8n\_db.ondigitalocean.com:25565/n8n\_prd?sslmode=require

With the above setting, I get below error  
Sep 30 03:07:22 dl-prd-n8n-01 n8n[38431]: Initializing n8n process

Sep 30 03:07:23 dl-prd-n8n-01 n8n[38431]: There was an error initializing DB

Sep 30 03:07:23 dl-prd-n8n-01 n8n[38431]: connect ECONNREFUSED ::1:5432

What am I missing here? Any help is greatly appreciated.

---

<div class="post-metadata">

**Author:** ![billy19991027](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/billy19991027/32/65214_2.png) [@billy19991027](https://community.n8n.io/u/billy19991027)\
**Post date:** [September 30, 2025, 2:27pm UTC](https://community.n8n.io/t/postgresql-error/197106/3 "2025-09-30T14:27:06Z")

</div>

I tried to update the settings in .env to match from [this](http://community.n8n.io/t/n8n-with-sqlite-postgresql-or-supabase-three-installation-options-compared/118201) post and it still connects to the local SQLite database.

---

<div class="post-metadata">

**Author:** ![billy19991027](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/billy19991027/32/65214_2.png) [@billy19991027](https://community.n8n.io/u/billy19991027)\
**Post date:** [September 30, 2025, 2:53pm UTC](https://community.n8n.io/t/postgresql-error/197106/4 "2025-09-30T14:53:25Z")

</div>

[Found the solution.](http://community.n8n.io/t/heroku-deployment-with-n8nio-n8n-ai-beta-fails-with-pg-ssl-issue/33634/2)

I had to add below setting to my .env file and it worked after that.

`DB_POSTGRESDB_SSL_REJECT_UNAUTHORIZED=false`
