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
- Check DATABASE_URL in the environment Prisma reads (.env)
- Test with psql/mysql using the same values
- Allow the client IP
Detailed fix by platform
Node.js
npx prisma db pullquickly tests connectivity with the current DATABASE_URL
How to diagnose
- URL — Which host/port?
- 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.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026