Deploying
This guide covers deploying your documentation site to Vercel, the recommended platform for Next.js applications.
Deploy to Vercel
Push to Git
Push your documentation project to a Git repository on GitHub, GitLab, or Bitbucket.
git add . git commit -m "Initial documentation site" git push origin main
Import to Vercel
Go to vercel.com/new and import your repository. Vercel will automatically detect the Next.js framework.
Deploy
Click Deploy. Vercel will build and deploy your site automatically. Every push to main triggers a new production deployment.
Zero-config deployment
Build settings
For most documentation sites, the default settings work perfectly. If you need to customise:
| Setting | Value |
|---|---|
| Framework | Next.js |
| Build command | next build |
| Output directory | .next |
| Node.js version | 20.x |
Environment variables
If your documentation fetches content from a CMS or API, add the required environment variables in your Vercel project settings:
# Content source CMS_API_KEY=your-api-key CMS_ENDPOINT=https://api.your-cms.com # Optional: analytics NEXT_PUBLIC_ANALYTICS_ID=your-analytics-id
Custom domain
Add a custom domain in your Vercel project settings under Domains. Point your DNS to Vercel and SSL is configured automatically.