Deploy a Next.js App to Vercel
Connect a GitHub repo to Vercel, configure environment variables, and ship your Next.js app with automatic preview deployments.
Requirements
- A Next.js project pushed to GitHub. Follow our guide →
- A Vercel account
Import the project
From the Vercel dashboard, choose Add New → Project, then select your GitHub repository. Vercel detects the Next.js framework automatically and pre-fills the build settings — you shouldn't need to change them.
Add environment variables
Under Project Settings → Environment Variables, add each variable your app needs, choosing which environments it applies to — Production, Preview, and/or Development.
Important
Only variables prefixed with NEXT_PUBLIC_ are exposed to browser code. Everything else stays server-only — don't add that prefix to secrets like API keys or database URLs.
Deploy
Click Deploy for the first build, or just push to your main branch — Vercel builds and deploys automatically on every push. Every pull request also gets its own preview URL.
Verify the deployment
Open the generated *.vercel.app URL. If the build failed, check Deployments → [your deployment] → Build Logs for the exact error.
Success
Your app is live, and every future push to main will redeploy it automatically.
Troubleshooting
Vercel's build runs on a case-sensitive Linux filesystem. An import like `import Button from './Button'` that actually points to `button.tsx` can pass on macOS/Windows (case-insensitive) and fail on Vercel.
Check the exact filenames referenced in the failing import against the files on disk, including capitalization.