Docusaurus is a set of npm packages that generate a full-featured documentation website from Markdown and MDX files. This page walks you through installing the prerequisites, creating a new project with theDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/facebook/docusaurus/llms.txt
Use this file to discover all available pages before exploring further.
create-docusaurus scaffolding tool, exploring the generated file structure, and running the site locally and in production.
Check Node.js version
Docusaurus requires Node.js 24.14 or later. Verify your version before proceeding:If the output is below
v24.14, install or upgrade Node.js from nodejs.org. If you manage multiple Node.js versions, nvm makes switching straightforward.Scaffold a new site
Use the The CLI detects your package manager automatically. If it cannot determine one, it will prompt you to choose between npm, yarn, pnpm, and bun.
create-docusaurus CLI to generate a complete starter project. The classic template is recommended — it bundles the @docusaurus/preset-classic preset, which includes docs, a blog, custom pages, and a CSS framework with dark mode.Explore the generated project
After scaffolding, your project directory looks like this:
- docs/
- blog/
- src/
- static/
- Config files
Contains the Markdown and MDX source files for your documentation. The sidebar order is controlled by
sidebars.js. You can rename this directory by setting the path option in your docs plugin config.Start the development server
The development server watches for file changes and reloads the browser automatically.The site opens at http://localhost:3000 by default. Edit any file in
docs/, blog/, or src/ and the browser will reflect the change instantly.Build for production
When you are ready to publish, generate the optimized static output:The compiled site is written to the
build/ directory. You can preview it locally before deploying:npm run serve starts a local HTTP server against the build/ directory and is the most accurate way to test the production output before pushing to a host.Monorepo setup
If Docusaurus is part of a larger monorepo alongside the packages it documents, scaffold the site into a subdirectory:npx create-docusaurus@latest from the monorepo root and specify website as the site name. On hosting platforms like Netlify or Vercel, set the base directory to ./website so the platform resolves the correct root for builds.
Updating Docusaurus
To upgrade, update the version of every@docusaurus/-namespaced package in your package.json to the same target version, then reinstall: