Fix: OpenClaw in Docker — Connection Refused, Port Mapping, and Network Issues
Running OpenClaw in Docker and getting connection refused? Common issues with port mapping, bind addresses, DNS resolution, and WebSocket upgrades explained with fixes.
I stared at my Vercel dashboard this morning and saw something painful: every single deployment — Error. A wall of red dots. And when I tried to create a new deployment manually, Vercel hit me with:
Resource is limited - try again in 25 minutes (more than 100, code: “api-deployments-free-per-day”).
100 deployments in one day. On the free tier. For copypastelearn.com.
How did I get here? Let me walk you through it so you don’t make the same mistakes.
Every push to any branch in your connected GitHub repo triggers a deployment. That includes:
main (production)I was debugging multiple issues across several branches:
fix/force-dynamic-all-db-pages → 4b75df2
001-mvp-platform → 03236e7
fix/dashboard-dynamic → multiple commits
fix/sitemap-sort-order → adb5a7cEach fix-commit-push cycle burned a deployment. With 6+ branches and rapid iteration, I hit 100 before lunch.
Branches active: 6
Average commits per branch: 8-10
Rebases/force-pushes: ~15
Vercel preview deploys: 1 per push per branch
Total: 6 × 10 + 15 = ~75 deploys
Plus main branch merges: ~25
Grand total: ~100 deploys 💥In your vercel.json:
{
"git": {
"deploymentEnabled": {
"main": true,
"001-mvp-platform": false,
"fix/*": false
}
}
}Or in the Vercel dashboard: Settings → Git → Ignored Build Step. Add a script that skips builds on branches you don’t need previews for.
Create a script that Vercel runs before building. If it exits with 0, the build proceeds. If it exits with 1, it’s skipped:
#!/bin/bash
# vercel-ignore-build.sh
# Only build on main or staging
if [[ "$VERCEL_GIT_COMMIT_REF" == "main" || "$VERCEL_GIT_COMMIT_REF" == "staging" ]]; then
echo "✅ Building: $VERCEL_GIT_COMMIT_REF"
exit 1 # Proceed with build
fi
echo "🚫 Skipping: $VERCEL_GIT_COMMIT_REF"
exit 0 # Skip buildSet this in Settings → General → Build & Development Settings → Ignored Build Step.
Instead of push-per-fix:
# Don't do this
git commit -m "fix typo" && git push
git commit -m "fix another typo" && git push
git commit -m "actually fix it" && git push
# = 3 deployments
# Do this instead
git commit -m "fix typo"
git commit -m "fix another typo"
git commit -m "actually fix it"
git push
# = 1 deploymentThis seems obvious, but when you’re debugging Prisma/auth issues that only manifest on Vercel’s serverless runtime, you’re tempted to “just push and see.” Resist. Use vercel dev locally:
# Run Vercel's serverless environment locally
npx vercel devIt’s not perfect parity, but it catches 80% of issues without burning deployments.
Vercel Pro gives you 6,000 deployments/month ($20/month). If you’re consistently hitting free tier limits, the math works out: your time is worth more than $20.
For context, here’s what drove the deployment frenzy on copypastelearn.com:
Prisma/auth pages need force-dynamic — statically prerendered pages that use database queries crash at build time. Every auth-protected page needs export const dynamic = 'force-dynamic'.
Sitemap using wrong sort field — sortOrder vs order for lessons. One commit, one push, one deployment to verify.
Stripe client lazy-init — the Stripe client was initializing at import time, crashing builds when STRIPE_SECRET_KEY wasn’t available during static generation.
Each fix was small. But each required a Vercel deployment to verify because the issues were specific to the serverless environment.
vercel dev is your friend. Use it before pushing.The wall of red errors on my dashboard was a learning moment. Now my deployment hygiene is much better — and copypastelearn.com is running smoothly.
# Current deployment count today: 3
# Branches with auto-deploy: main only
# Feeling: much calmerAI & Cloud Advisor with 18+ years experience. Author of 8 technical books, creator of Ansible Pilot, and instructor at CopyPasteLearn Academy. Speaker at KubeCon EU & Red Hat Summit 2026.
Running OpenClaw in Docker and getting connection refused? Common issues with port mapping, bind addresses, DNS resolution, and WebSocket upgrades explained with fixes.
Getting the allowedorigins error when starting your OpenClaw gateway? Here is exactly how to fix it, with step-by-step configuration for local network, VPS, and reverse proxy setups.
Troubleshoot OpenClaw API key issues across OpenAI, Anthropic, and GitHub Copilot. Covers 401 errors, invalid key formats, rate limits, and model fallback configuration.