TickYouOff
Back

Deploying Next.js to Vercel

Medium 17 items · 45 min
testuser's avatar
testuser Published 1 month ago

This checklist guides frontend and full-stack developers through a reliable Next.js deployment to Vercel. It covers build settings, environment variables, domain and DNS setup, ISR and Edge configuration, and monitoring.

Progress
0 / 17
  1. Connect Git repository to Vercel — Link GitHub/GitLab/Bitbucket to enable automatic deploys from branches.
  2. Set the production branch in Vercel — Choose the branch Vercel will treat as production (e.g., main or master).
  3. Configure project build settings — Confirm framework preset, build command (next build) and output directory.
  4. Add environment variables in Vercel — Create distinct Production and Preview environments in the Vercel UI or CLI.
  5. Add production environment variables — Store secrets (API keys, DB URLs) as Production vars and mark them as protected.
  6. Add preview environment variables for PRs — Provide safe test keys for Preview deployments; avoid exposing prod secrets.
  7. Allow image domains in next.config.js — Add domains or remotePatterns to images.domains to avoid optimizer errors.
  8. Set ISR revalidate times and cache-control — Configure getStaticProps revalidate or headers for optimal ISR behavior.
  9. Select Edge Function regions in Vercel — Choose regions closest to users for lower latency on Edge Functions.
  10. Add a custom domain to the Vercel project — Enter your domain in Vercel's Domains settings to begin verification.
  11. Verify domain and update DNS records — Add required A/CNAME/TXT records at your registrar and confirm verification.
  12. Configure redirects, rewrites and headers — Implement redirects/rewrites in next.config.js or vercel.json for routing and headers.
  13. Enable Preview Deployments and branch protections — Turn on preview deploys for PRs and protect main to prevent accidental merges.
  14. Integrate analytics (Vercel or third-party) — Enable Vercel Analytics or add GA/Snowplow and set required env keys.
  15. Set up logging and error monitoring — Connect Sentry, Logflare or Vercel logs for runtime error tracking.
  16. Test production build and run smoke tests after deploy — Run next build locally, deploy to production, then check key pages and APIs.
  17. Document rollback and alias strategy — Record how to rollback (revert commit, restore alias) and who owns it.
Sign in to save
📝 My Notes