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:

sh
pnpm create boltdocs@latest my-docs

Then jump straight to running the dev server.

Build scripts on pnpm 10+

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 DirectoryLink

Boltdocs expects your content to live in a docs/ folder at the root of your project. Create it and add your first page:

sh
mkdir docs
echo "# Hello, Boltdocs!" > docs/index.md

Add a Configuration FileLink

Create boltdocs.config.ts at the root of your project:

boltdocs.config.ts
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.jsonLink

package.json
{
  "scripts": {
    "docs:dev": "boltdocs",
    "docs:build": "boltdocs build",
    "docs:preview": "boltdocs preview"
  }
}

Run the Dev ServerLink

sh
pnpm docs:dev

Open http://localhost:5173 and you'll see your documentation site running locally with hot reload.

Note

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 ProductionLink

sh
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?Link

Last updated on October 18, 2026

Was this page helpful?