All projects

Infrastructure · Implementation notes

Self-hosted n8n with PostgreSQL

Moving workflow data from a local database to managed PostgreSQL, and resolving an IPv4/IPv6 connection problem along the way.

  • n8n
  • Docker
  • Google Cloud
  • Supabase
  • PostgreSQL
  • Nginx

My role

I configured the Docker deployment and database connection, investigated startup failures and documented the working setup. n8n provides the workflow engine; Supabase provides managed PostgreSQL.

The problem

My n8n installation needed a database outside the application container. During setup, the direct database connection failed because the available network path did not support the IPv6 endpoint. Limited memory on the virtual machine also caused startup problems.

How it works

  1. HTTPS request reaches Nginx

  2. Nginx forwards it to n8n in Docker

  3. n8n executes the workflow

  4. Workflow data is stored in PostgreSQL through the session pooler

Technical decisions

Separate the workflow engine from its database

I deployed n8n in Docker on Google Cloud and connected it to PostgreSQL in Supabase. This separated application operation from database hosting and replaced the local SQLite setup.

Check the network path before changing credentials

The ENETUNREACH error pointed to connectivity. For this deployment, I used the IPv4-compatible session pooler instead of the direct IPv6 database endpoint. The choice followed the available network path and connection requirements.

Investigate resources as a separate problem

Connection settings did not explain every failure. Increasing the virtual machine’s memory allowed startup and database migrations to complete. I checked the application logs as well as the database configuration.

Outcome and limitations

The installation started successfully with PostgreSQL and activated the AI Websearch workflow. The useful result was a working, documented deployment and a clearer way to distinguish database, network and resource failures.

This describes my May 2026 deployment, not a universal sizing guide. A separate database does not replace backups, restore tests or monitoring. Resource requirements will depend on the workflows and their load.

Contact

Let’s discuss your project

Tell me what you want to build and where you need help.

mobonacci@gmail.com

Opens your email app. You choose when to send your message.