Installation
This guide will walk you through installing Doom and setting up your first documentation project.Prerequisites
Before you begin, ensure you have the following installed on your system:
- Node.js: Version 20.19.0 or higher
- Package Manager: npm, yarn, or pnpm
- Text Editor: VS Code, WebStorm, or your preferred editor
Check Node.js Version
Verify your Node.js version:Installation Methods
Method 1: Create a New Project
Initialize Package
Initialize a new npm package:This creates a
package.json file with default values.Method 2: Add to Existing Project
If you have an existing project, simply install Doom:Project Setup
Create Documentation Structure
Set up the basic documentation directory structure. Doom supports multiple languages by default:
The
en and zh directories represent English and Chinese languages. You can add more languages like ru for Russian.Configure Package Scripts
Add Doom commands to your These scripts provide:
package.json:package.json
dev: Start development server with hot reloadbuild: Build production-ready static filesserve: Preview the built documentationnew: Generate new pages from templatestranslate: AI-powered translation between languagesexport: Export documentation to PDFlint: Check documentation quality with ESLint and CSpell
Create Configuration File
Create a This minimal configuration sets:
doom.config.yml file in your project root:doom.config.yml
- Default language to English
- Site title for browser tabs
- Logo text in the navigation bar
- GitHub link in the header
Configure TypeScript
Create a This enables:
tsconfig.json file for TypeScript support:tsconfig.json
- JSX support for React components
- Modern module resolution
- Strict type checking
- MDX file type checking
Project Structure
After setup, your project should look like this:Optional Configuration
Editor Setup (VS Code)
For the best development experience in VS Code, install these extensions:- ESLint - JavaScript/TypeScript linting
- CSpell - Spell checker
- MDX - Syntax highlighting for MDX files
.vscode/extensions.json:
Linting Setup
For editor integration of linting tools:Git Setup
Create a.gitignore file:
.gitignore
Verify Installation
Test your installation by starting the development server:Troubleshooting
Node version error
Node version error
If you see an error about Node version:Upgrade your Node.js to version 20.19.0 or higher:
Port already in use
Port already in use
If port 5173 is already in use, specify a different port:
TypeScript errors in MDX files
TypeScript errors in MDX files
Make sure you have created the Restart your TypeScript server in VS Code:
global.d.ts file with Doom’s type reference:Cmd+Shift+P → “TypeScript: Restart TS Server”Missing dependencies for PDF export
Missing dependencies for PDF export
PDF export requires Playwright browsers. Install them:For faster downloads in China, set the download mirror:
Next Steps
Quick Start
Learn the basics and create your first documentation pages
Configuration
Explore all configuration options for Doom
Markdown Guide
Learn how to write content with Markdown and MDX
API Documentation
Generate API docs from OpenAPI specs and CRDs
Pro Tip: Use
doom new to generate documentation pages from templates. This helps maintain consistency across your documentation.