Deploying Your Documentation
This guide covers building your documentation for production and deploying to various platforms. Doom generates static HTML that can be served from any web server or hosting service.Building for Production
Build static assets
Run the build command to generate production-ready files:This creates optimized static files in the
dist/ directory.Preview the build
Test your production build locally:This starts a local server (default port 4173) serving your built documentation.
The
doom serve command (also aliased as doom preview) lets you verify your production build before deployment.Multi-Version Documentation
Doom supports building multiple versions of your documentation to maintain docs for different product releases.Version Naming
Use the-v flag to specify a version:
{base}/4.0{base}/4.1{base}/master
Unversioned Builds
For single-version documentation or when you don’t want version prefixes in URLs:Multi-Version Directory Structure
A typical multi-version deployment looks like:Version Redirect Page
Create anindex.html at the root to redirect to the latest version:
dist/product-docs/index.html
Versions Configuration
List available versions inversions.yaml:
versions.yaml
Build Automation Script
Here’s a shell script to build multiple versions:build-versions.sh
Advanced Build Options
Custom Output Directory
Override the default output directory:dist/{outDir}/{version}
Base Path Override
Change the base URL path:https://example.com/documentation
Prefix Option
Add a prefix to the base path:https://example.com/platform/docs
Ignore Internal Routes
Exclude internal documentation pages:internalRoutes configuration in your doom.config.yml.
Language Filtering
Build only specific languages:Export Mode
Build for PDF export (excludes API routes):apis/** routes and optimizes for PDF generation.
Deployment Platforms
Vercel
Netlify
GitHub Pages
Enable GitHub Pages
In repository settings:
- Go to Pages
- Source: Deploy from a branch
- Branch:
gh-pages
Docker
Create a containerized deployment:Dockerfile
nginx.conf
Static Server
For any web server, simply copy thedist/ directory:
Dynamic Configuration
Useoverrides.yaml to customize configuration per deployment environment:
overrides.yaml
Use Cases
- Multi-tenant deployments: Different branding per tenant
- Environment-specific: Dev, staging, production configurations
- Localization: Override text without rebuilding
Sites Configuration
For complex documentation ecosystems with multiple related sites, usesites.yaml:
sites.yaml
- Cross-site references with
<ExternalSite>component - Coordinated multi-version builds
- Shared asset management
Sitemap Generation
Generate a sitemap for SEO:doom.config.yml
sitemap.xml in your output directory.
Performance Optimization
Build Performance
- Use local cache: Avoid
--forceunless necessary - Limit language builds: Use
-Ito build only needed languages - Parallel builds: Build versions in parallel using CI/CD
Runtime Performance
- CDN: Serve from a CDN for faster global access
- Compression: Enable gzip/brotli compression on your server
- Caching: Set long cache headers for static assets
- Lazy loading: Doom automatically lazy-loads routes
Continuous Deployment
Example CI/CD pipeline for GitLab:.gitlab-ci.yml
Troubleshooting
Assets not loading
Assets not loading
Check your Ensure all asset links use absolute paths:
base path configuration:/images/logo.svg404 errors on page refresh
404 errors on page refresh
Configure your server to redirect all requests to Apache (.htaccess):
index.html:Nginx:Version switcher not working
Version switcher not working
Ensure Place it at the root level alongside version directories.
versions.yaml exists in your deployment:Build fails with out of memory
Build fails with out of memory
Increase Node.js memory limit:Or use the rebuild feature for large sites (automatically triggered when needed).
Next Steps
Versioning
Learn advanced version management strategies
PDF Export
Export documentation to PDF format
Build Command
Detailed build command reference
Configuration
Explore all configuration options