Installation
Install Boltdocs and run your first documentation site in under two minutes.
Boltdocs requires Node.js 18+ and a package manager. We recommend pnpm for its speed and disk efficiency, but npm and yarn work perfectly too.
If you're starting from scratch, use create-boltdocs to generate a complete project with all the boilerplate ready:
pnpm create boltdocs@latest my-docs
Then jump straight to running the dev server.
pnpm 10+ blocks lifecycle scripts (preinstall/postinstall) of dependencies by default. The create-boltdocs template already includes the required pnpm.onlyBuiltDependencies configuration, so pnpm install works out of the box. If you're adding Boltdocs to an existing project manually, see the troubleshooting guide for the required configuration.
Create the Docs Directory
Boltdocs expects your content to live in a docs/ folder at the root of your project. Create it and add your first page:
mkdir docs
echo "# Hello, Boltdocs!" > docs/index.md
Add a Configuration File
Create boltdocs.config.ts at the root of your project:
import { defineConfig } from 'boltdocs'
export default defineConfig({
siteUrl: 'https://my-project.com',
theme: {
title: 'My Project Docs',
githubRepo: 'my-org/my-project',
},
})
This file is the single source of truth for your documentation site. You don't need a vite.config.ts — Boltdocs generates the full Vite configuration internally.
Add Scripts to package.json
{
"scripts": {
"docs:dev": "boltdocs",
"docs:build": "boltdocs build",
"docs:preview": "boltdocs preview"
}
}
Run the Dev Server
pnpm docs:dev
Open http://localhost:5173 and you'll see your documentation site running locally with hot reload.
The first start is a bit slower while Boltdocs builds its internal route map and warms up the file cache. Subsequent restarts are nearly instant.
Build for Production
pnpm docs:build
The output is generated in dist/. Every page is pre-rendered as static HTML, with a client bundle for navigation and search.
What's Next?
Configuration
Learn how to customize the title, logo, navigation, and every other option in your configuration file.
File-System Routing
Learn how Boltdocs turns your docs/ folder into a complete navigation structure.