port 5432 in use 🐘 PostgreSQL

LOG: could not bind IPv4 address "0.0.0.0": Address already in use — Is another postmaster already running on port 5432?

Another process (often a second PostgreSQL install or a container) already listens on 5432.

Seen on: PostgreSQL

Meaning

Homebrew + Postgres.app + Docker on the same machine commonly fight over 5432.

Common causes

  • Another PostgreSQL installation running
  • Docker container publishing 5432
  • Stale process

⚡ Quick fix

  1. Find the owner: lsof -i :5432
  2. Stop the other instance or change the port

Detailed fix by platform

Linux

  1. sudo lsof -i :5432

How to diagnose

  1. Owner — Which process holds 5432?
  2. Recent change — Did it start after a deploy, upgrade, or configuration change? Compare with the last working version.

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.