Deploy to Vercel

Vercel is the easiest way to deploy your eziwiki with zero configuration.
Quick Deploy
Using Vercel CLI
# Install Vercel CLI
npm install -g vercel
# Deploy
vercelFollow the prompts and your site will be live in seconds!
Using Vercel Dashboard
- Go to vercel.com
- Click "New Project"
- Import your Git repository
- Click "Deploy"
That's it! Vercel automatically detects Next.js and configures everything.
Automatic Deployments
Production Deployments
Every push to your main branch triggers a production deployment:
git push origin mainYour site updates automatically at your-project.vercel.app
Preview Deployments
Every pull request gets a unique preview URL:
git checkout -b feature-branch
git push origin feature-branchCreate a PR and get a preview link like your-project-git-feature-branch.vercel.app
Custom Domain
1. Add Domain
In Vercel dashboard:
- Go to Project Settings → Domains
- Add your domain:
wiki.example.com - Follow DNS instructions
2. Configure DNS
Add DNS records provided by Vercel:
Type Name Value
A @ 76.76.21.21
CNAME www cname.vercel-dns.com3. Enable HTTPS
Vercel automatically provisions SSL certificates. HTTPS is enabled by default.
Environment Variables
Add Variables
In Vercel dashboard:
- Go to Project Settings → Environment Variables
- Add variables:
NEXT_PUBLIC_BASE_URL=https://wiki.example.comUse in Code
// payload/config.ts
global: {
baseUrl: process.env.NEXT_PUBLIC_BASE_URL || 'http://localhost:3000',
}Build Configuration
vercel.json
Create vercel.json for custom configuration:
{
"buildCommand": "npm run build",
"outputDirectory": "out",
"framework": "nextjs",
"regions": ["iad1"]
}Build Settings
In Vercel dashboard:
- Framework Preset: Next.js
- Build Command:
npm run build - Output Directory:
out - Install Command:
npm install
Performance Optimization
Edge Network
Vercel automatically deploys to a global edge network for fast loading worldwide.
Automatic Caching
Static assets are cached automatically:
- HTML: Cached with revalidation
- JS/CSS: Cached with long expiry
- Images: Optimized and cached
Analytics
Enable Vercel Analytics:
npm install @vercel/analytics// app/layout.tsx
import { Analytics } from '@vercel/analytics/react';
export default function RootLayout({ children }) {
return (
<html>
<body>
{children}
<Analytics />
</body>
</html>
);
}Deployment Workflow
Development
# Work locally
npm run dev
# Commit changes
git add .
git commit -m "Update content"Preview
# Create feature branch
git checkout -b new-feature
# Push to get preview
git push origin new-featureCreate PR to get preview URL.
Production
# Merge to main
git checkout main
git merge new-feature
git push origin mainAutomatic production deployment!
Rollback
Using Dashboard
- Go to Deployments
- Find previous deployment
- Click "Promote to Production"
Using CLI
# List deployments
vercel ls
# Rollback to specific deployment
vercel rollback [deployment-url]Monitoring
Deployment Logs
View logs in Vercel dashboard:
- Go to Deployments
- Click on a deployment
- View build and runtime logs
Real-time Logs
# Stream logs
vercel logsTeam Collaboration
Add Team Members
- Go to Project Settings → Team
- Invite members
- Set permissions (Viewer, Developer, Admin)
Protected Branches
Configure branch protection:
- Go to Git → Branch Protection
- Require reviews before merging
- Require status checks
Vercel Features
Instant Rollback
One-click rollback to any previous deployment.
Preview Comments
Comment on preview deployments directly in GitHub PRs.
Automatic HTTPS
Free SSL certificates for all domains.
Global CDN
Deploy to 100+ edge locations worldwide.
Zero Config
Works out of the box with Next.js.
Pricing
Hobby (Free)
- Unlimited deployments
- 100 GB bandwidth/month
- Automatic HTTPS
- Preview deployments
- Perfect for personal wikis
Pro ($20/month)
- 1 TB bandwidth/month
- Team collaboration
- Analytics
- Password protection
- Custom deployment regions
Troubleshooting
Build Fails
Check build logs in Vercel dashboard:
# Test build locally
npm run buildEnvironment Variables
Make sure all required variables are set in Vercel dashboard.
Domain Not Working
- Check DNS propagation:
dig wiki.example.com - Wait up to 48 hours for DNS propagation
- Verify DNS records match Vercel's instructions
Old Content Showing
Vercel caches aggressively. To force refresh:
- Make a change
- Push to trigger new deployment
- Hard refresh browser (Ctrl+Shift+R)
Best Practices
Use Git Integration
Connect your Git repository for automatic deployments.
Enable Preview Deployments
Test changes before merging to production.
Set Up Custom Domain
Use your own domain for professional appearance.
Monitor Analytics
Track page views and performance.
Use Environment Variables
Keep sensitive data out of your code.
Comparison with Other Platforms
| Feature | Vercel | GitHub Pages | Netlify |
|---|---|---|---|
| Setup | Instant | Manual | Easy |
| Custom Domain | Free | Free | Free |
| HTTPS | Automatic | Automatic | Automatic |
| Preview URLs | Yes | No | Yes |
| Analytics | Yes ($) | No | Yes ($) |
| Build Time | Fast | Medium | Fast |