Introduction
Fumadocs is built on top of modern React frameworks, giving you flexible deployment options ranging from server-side rendering to fully static sites. This guide covers the essential concepts and platform-specific instructions for deploying your documentation.Deployment Models
Fumadocs supports two primary deployment approaches:Server-Side Rendering (SSR)
The default deployment model for Fumadocs applications. Your documentation runs on a Node.js server, enabling:- Dynamic content generation
- Server-side search indexing
- API routes for advanced features
- On-demand revalidation
- Large documentation sites with frequent updates
- Sites requiring server-side logic
- Teams using Vercel or similar platforms
Static Site Generation (SSG)
Export your documentation as static HTML/CSS/JS files for hosting on CDNs:- No server required
- Maximum performance
- Simple hosting on any static host
- Client-side search
- Smaller documentation sites
- Hosting on Cloudflare Pages, Netlify, GitHub Pages
- Maximum cost optimization
Framework-Specific Guides
Your deployment approach depends on your React framework:Platform-Specific Considerations
Next.js + Cloudflare
Fumadocs does not work on Cloudflare’s Edge runtime.
Next.js + Docker
When deploying with Docker and Fumadocs MDX configured, you must include configuration files in your Docker image:FROM node:18-alpine AS deps
RUN apk add --no-cache libc6-compat
WORKDIR /app
# Include configuration files for Fumadocs MDX
COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* .npmrc* source.config.ts next.config.* ./
RUN \
if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
elif [ -f package-lock.json ]; then npm ci; \
elif [ -f pnpm-lock.yaml ]; then corepack enable pnpm && pnpm i --frozen-lockfile; \
else echo "Lockfile not found." && exit 1; \
fi
Search Configuration
Search behavior varies by deployment model:Server-Side Search (Default)
The built-in Orama search runs on the server and works out of the box with SSR deployments.Static Site Search
For static exports, configure client-side search:Follow the Static Export guide to pre-generate search indexes.
Cloud Search Solutions
Third-party search providers work with both deployment models:Environment Variables
Set environment variables based on your platform:Vercel
Configure in Project Settings → Environment Variables or usevercel.json.
Cloudflare Pages
Set in Pages project settings or use.dev.vars for local development.
Docker
Pass variables withdocker run -e or use .env files with docker-compose.
Build Commands
Next.js
package.json
With Pre/Post Build Scripts
package.json