Deploying

This guide covers deploying your documentation site to Vercel, the recommended platform for Next.js applications.

Deploy to Vercel

1

Push to Git

Push your documentation project to a Git repository on GitHub, GitLab, or Bitbucket.

bash
git add .
git commit -m "Initial documentation site"
git push origin main
2

Import to Vercel

Go to vercel.com/new and import your repository. Vercel will automatically detect the Next.js framework.

3

Deploy

Click Deploy. Vercel will build and deploy your site automatically. Every push to main triggers a new production deployment.

Zero-config deployment

Vercel automatically detects Next.js and applies optimal build settings. No configuration required.

Build settings

For most documentation sites, the default settings work perfectly. If you need to customise:

SettingValue
FrameworkNext.js
Build commandnext build
Output directory.next
Node.js version20.x

Environment variables

If your documentation fetches content from a CMS or API, add the required environment variables in your Vercel project settings:

.env.local
# 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.