From laptop to URL
Shipping is a two-command story you can rehearse locally:
next build # compile + prerender static pages + print the route table next start # run the production server
next build is the moment everything from Unit 7 happens: static pages render to HTML, generateStaticParams lists expand, and the route table prints with its static/dynamic markers. Read that table before every deploy. It is the truth about what you built.
In production you almost never run next start by hand. A hosting platform does it for you.
The Vercel-style workflow
Platforms like Vercel (made by the Next.js team), Netlify, and others all follow the same git-driven loop:
- Push to GitHub. Your repo is connected to the platform.
- The platform builds. It runs
next buildon its servers with the environment variables you configured in its dashboard, not your.env.local, which stays on your machine and out of git. - It deploys atomically. The new version goes live at your URL only when the build succeeds. Pull requests even get their own preview URLs.
Two habits that save real pain: set env vars in the platform dashboard before building (remember, NEXT_PUBLIC_* is inlined at build time), and never commit .env.local.
Quiz
You changed NEXT_PUBLIC_API_URL in your hosting dashboard, but the live site still uses the old value. What is the most likely fix?
Problem
Put these in order for a git-driven deploy: (A) platform runs next build, (B) push to GitHub, (C) new version goes live. Answer like: X, Y, Z