Your .env.local has a Neon PostgreSQL database configured:
DATABASE_URL=postgresql://neondb_owner:npg_***@ep-quiet-frost-***-pooler.us-east-1.aws.neon.tech/neondb?sslmode=require&channel_binding=require
This is excellent for deployment! 🎉
The database is in us-east-1 AWS region but your connection is being blocked. Possible causes:
- Neon project not active - Check Neon dashboard
- Network/Firewall blocking - Neon has IP whitelist
- SSL/TLS issues - Neon requires SSL
- Service not running - Restart Neon compute
- Go to https://console.neon.tech
- Check your project status
- Make sure database is Active (green status)
# Test with psql
psql "postgresql://neondb_owner:npg_a9FErQ7ImPid@ep-***-pooler.us-east-1.aws.neon.tech/neondb?sslmode=require"
# Or with Node.js
node -e "
const { Pool } = require('pg');
const pool = new Pool({ connectionString: process.env.DATABASE_URL });
pool.query('SELECT NOW()', (err, res) => {
if (err) console.error('Error:', err.message);
else console.log('Connected:', res.rows[0]);
process.exit();
});
"- Neon Dashboard → Project Settings
- IP Whitelist → Add your IP or allow all (0.0.0.0/0)
Use local PostgreSQL instead:
# .env.local
DATABASE_URL="postgresql://postgres:ayush@2004@localhost:5432/k8s"Then restart: npm run dev
Your Neon setup is already production-ready! Just:
- Vercel → Add
.env.localto project settings - Railway → Existing DATABASE_URL will work
- Docker → Pass DATABASE_URL as environment variable
# Docker example
docker run -e DATABASE_URL="postgresql://..." my-appOption A: Use Local PostgreSQL
# Install and start PostgreSQL
brew services start postgresql # macOS
sudo systemctl start postgresql # Linux
# Create database
createdb k8s
# Update .env.local
DATABASE_URL="postgresql://postgres:ayush@2004@localhost:5432/k8s"
# Start app
npm run devOption B: Fix Neon Connection
- Login to Neon console
- Verify database is active
- Check IP whitelist settings
- Restart your app:
npm run dev
Once database works, you can deploy to:
- ✅ Vercel (easiest for Next.js)
- ✅ Railway
- ✅ Docker/Kubernetes
- ✅ AWS, Google Cloud, etc.
All you need is to set the DATABASE_URL env variable!