Prisma P1001 🟩 Node.js

Error: P1001: Can't reach database server at `host`:`5432`

Prisma couldn’t connect to the database in DATABASE_URL.

Seen on: Node.js

Meaning

The DB is down, the host/port is wrong, the network blocks it, or serverless databases are paused/sleeping.

Common causes

  • Wrong DATABASE_URL
  • Database not running / paused
  • Firewall or IP allow list
  • Docker host name mismatch

⚡ Quick fix

  1. Check DATABASE_URL in the environment Prisma reads (.env)
  2. Test with psql/mysql using the same values
  3. Allow the client IP

Detailed fix by platform

Node.js

  1. npx prisma db pull quickly tests connectivity with the current DATABASE_URL

How to diagnose

  1. URL — Which host/port?
  2. Reachable — From this machine?

🧠 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.