Deploy to Vercel
Step-by-step guide to deploying to Vercel
Deploy to Vercel
Vercel is the recommended deployment platform for Next.js applications.
Step 1: Push to GitHub
- Create a GitHub repository
- Push your code:
Step 2: Import to Vercel
- Go to vercel.com
- Sign in with your GitHub account
- Click "Add New Project"
- Import your repository
Step 3: Configure
Vercel will automatically detect Next.js. The default settings should work:
- Framework Preset: Next.js
- Build Command:
yarn build(ornpm run build) - Output Directory:
.next - Install Command:
yarn install(ornpm install)
Step 4: Deploy
- Click "Deploy"
- Wait for build to complete
- Your site is live!
Environment Variables
If you need environment variables:
- Go to Project Settings
- Click "Environment Variables"
- Add your variables
Custom Domain
To add a custom domain:
- Go to Project Settings
- Click "Domains"
- Add your domain
- Follow DNS instructions
Next Steps
- Deploy to Netlify - Alternative deployment option
- Static Export - Deploy as static files