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.

beginner10 minallUpdated August 2026
#next.js#vercel#deployment#environment-variables

Requirements

0/4 steps · 0%
01

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.

02

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.

03

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.

04

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.