Install Docusaurus
This document shows how to install Docusaurus locally.
Docusaurus is an open-source documentation framework developed by Facebook that simplifies the process of creating and maintaining documentation websites. This guide walks you through the steps to install Docusaurus locally on your development machine.
For more information about Docusaurus and more detailed instructions, see official Docusaurus documentation.
Prerequisites
Before you begin, ensure you have the following tools installed on your system:
- Install Node.js: Docusaurus is built with JavaScript, and Node.js is required to run it.
- Install Yarn: A package manager used to manage Docusaurus dependencies.
- Ensure you have a Command Line Interface (CLI)—for example, git.
To install Docusaurus, follow the steps in the sections below.
Create a new Docusaurus project
On your PC, create a destination folder where you want to keep your Docusaurus project and run the following command:
npx create-docusaurus@latest REPOSITORY_NAME classic
Replace REPOSITORY_NAME
with the name of our project. Note that if you have a repository on GitHub or GitLab for this project, then replace the placeholder with the repository's name.
This command initializes a new Docusaurus project with the classic template.
Install Node.js packages or dependencies
- Move into your newly created Docusaurus project directory:
cd my-docusaurus-project
- Install Node.Js packages or dependencies into your project:
npm install
Optional: Start the development server
When Node.Js packages or dependencies get installed you can preview your documentation website locally. For this, from your project's folder, run the following command:
npm start
By default, your Docusaurus project gets available at http://localhost:3000
.
That's it, now you have your local project up and running.