1. Home
  2. ChevronRightGetting-started
  3. ChevronRightInstallation

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.

Info
pnpm 10+ build scripts

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 InstallationLink

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 DirectoryLink

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 FileLink

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

pnpm docs:dev

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

Info
Note

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 ProductionLink

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

Last updated on July 27, 2026

Was this page helpful?