Deployment Basics
Vercel supports two deployment methods: automatic git-based deployments and manual deployments via the CLI. Both produce optimized builds on Vercel's edge network.
Git-Based Deployments
The most common workflow. Connect your repository and Vercel deploys on every push.
Setup
- Go to vercel.com/new
- Select your GitHub, GitLab, or Bitbucket repository
- Vercel detects the framework and applies default build settings
- Click Deploy to trigger the first production build
Branch Behavior
| Branch | Deployment Type | URL |
|---|---|---|
main / master | Production | your-app.vercel.app |
| Any other branch | Preview | your-app-git-branch-name.vercel.app |
| Pull request | Preview | your-app-pr-123.vercel.app |
Manual Deployments with the CLI
Deploy directly from your terminal without a git push:
# Deploy to preview
vercel
# Deploy to production
vercel --prod
This is useful for quick tests or when your project is not connected to a Git provider.
Build Configuration
Vercel auto-detects Next.js, but you can customize the build in the project settings
or in a vercel.json file:
{
"buildCommand": "npm run build",
"outputDirectory": ".next",
"installCommand": "npm install",
"framework": "nextjs"
}
Common Build Settings
| Setting | Default (Next.js) | Override When |
|---|---|---|
| Build Command | next build | Custom build steps needed |
| Output Directory | .next | Using a monorepo with custom output |
| Install Command | npm install | Using pnpm, yarn, or bun |
| Root Directory | / | Project is in a subdirectory |
Custom Domains
Add a custom domain in your project settings:
# Via CLI
vercel domains add example.com
Vercel automatically provisions SSL certificates and configures DNS if you use Vercel's nameservers.
Deployment Protection
Protect preview deployments from public access:
- Vercel Authentication — Require login with a Vercel account
- Password Protection — Set a shared password for team reviews
- Trusted IPs — Restrict access to specific IP ranges (Enterprise)
Production deployments are always public by default. Use Vercel Authentication on preview deployments to keep work-in-progress private.