Skip to content

Deployment Checklist

Before deploying your Next.js application to production, verify these items. This checklist helps prevent common deployment issues.

  • npm run build completes without errors
  • No TypeScript errors (npx tsc --noEmit)
  • No lint warnings (npm run lint)
  • Bundle size is within acceptable limits
  • All required environment variables are set on the deployment platform
  • Secrets are not committed to version control
  • NEXT_PUBLIC_ prefix is used correctly for client variables
  • Production database URL is configured
  • HTTPS is enforced (automatic on Vercel)
  • Security headers are configured
  • Authentication secrets are strong and unique
  • API routes are protected where needed
  • Images use next/image with proper dimensions
  • Fonts use next/font (no external font requests)
  • Analytics scripts use next/script with afterInteractive
  • Critical pages have been tested with Lighthouse
  • Metadata is set on all pages
  • robots.txt is configured
  • Sitemap is generated
  • Canonical URLs are set
  • App loads successfully at the production URL
  • Login/authentication flow works end-to-end
  • API routes return correct responses
  • Database connections are working
  • Environment variables are accessible
  • Custom domain works with SSL
  • Analytics are receiving data
  • Error monitoring is active

Before deploying, know how to roll back:

Vercel: Go to Deployments → click the three dots on a previous deployment → “Promote to Production”

Self-hosted: Keep the previous Docker image tagged and ready:

Terminal window
docker pull myapp:previous-tag
docker stop myapp
docker run -d --name myapp-rollback myapp:previous-tag
  • Deploying on a Friday afternoon — If something breaks, you’ll be debugging over the weekend.
  • Not testing the production build locally — Run npm run build && npm start locally before deploying.
  • Missing runtime environment variables — Build may succeed but the app crashes on first request.

Use the deployment checklist before and after every deployment. Test the production build locally, verify all environment variables are set, and have a rollback plan ready. Monitor the app closely after deployment.