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 just as well. (Refined)
If you're starting from scratch, use create-boltdocs to generate a complete project with all the boilerplate in place:
pnpm create boltdocs@latest my-docs
Then skip straight to running the dev server.
pnpm 10+ blocks lifecycle scripts (preinstall/postinstall) from 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.
Manual Installation
If you're adding Boltdocs to an existing project, install it as a dev dependency:
# pnpm
pnpm add -D boltdocs
# npm
npm install --save-dev boltdocs
# yarn
yarn add --dev boltdocs
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 Config File
Create boltdocs.config.ts in 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 startup is slightly slower as Boltdocs builds its internal route map and warms the file cache. Subsequent restarts are near-instant.
Build for Production
pnpm docs:build
The output lands 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 config file.
File-System Routing
Learn how Boltdocs turns your docs/ folder into a full navigation structure.