Zum Hauptinhalt springen

Installation and Initial Setup

This chapter covers creating and running a Docusaurus site from scratch.

Create a New Site

npx create-docusaurus@latest my-website classic --typescript
cd my-website
npm install

Start Development Server

npm run start

Open http://localhost:3000 and verify the site loads.

Build Production Output

npm run build
npm run serve
  • build creates optimized static files in build/
  • serve previews production output locally

Important Default Commands

  • npm run start: local development
  • npm run build: production build
  • npm run serve: serve production build
  • npm run clear: clear generated cache

First Customization Checklist

  • Update title, tagline, and url in docusaurus.config.ts
  • Update navbar and footer links
  • Replace default docs with your own folder structure
  • Replace default homepage content in src/pages/index.tsx