This tutorial is geared at first-time users who want detailed instructions on how to go from zero to a Docusaurus website that has versions. Let's start!
Git is a version control system for tracking changes in source code during software development and it can help you synchronize and version files between your local system and your online repository. Git for Windows includes Git Bash, a terminal application. If not already installed, see Installing Git.
npm, the package manager that allows you to install NPM modules from your terminal.
- Open Terminal on a Mac, Linux, or Unix system. Open Git Bash on a Windows system.
- If you have
brewon your OS, run the following command to install Node.
brew install node
Alternatively, you can download an installer from the Node.js homepage.
Check your Node.js installation
Check that you have the minimum required version installed by running the following command:
You should see a version larger than Node 8.
Docusaurus' minimum supported Node.js version is Node 8, but more recent versions will work as well.
Install Yarn (Optional)
We highly recommend that you install Yarn, an alternative package manager that has superb performance for managing your NPM dependencies. Check it out here.
You can still proceed with the tutorial without Yarn.
Create a GitHub repository and local clone
- Go to https://github.com/ and sign up for an account if you don't already have one.
- Click on the green New button or go to https://github.com/new.
- Type a repository name without spaces. For example,
- Click Create repository (without
.gitignoreand without a license).
- In Terminal or Git Bash,
cdto a directory where the local clone will be a subdirectory.
cd /Users/NAME/doc_projects # macOS example
cd /c/NAME/doc_projects # Windows example
- Clone your repository to your local machine:
git clone [email protected]:USERNAME/docusaurus-tutorial.git # SSH
git clone https://github.com/USERNAME/docusaurus-tutorial.git # HTTPS
Install the Docusaurus init command
Docusaurus comes with a command line tool to help you scaffold a Docusaurus site with some example templates. Let's install the installer!
Run the following command:
npm install --global docusaurus-init
or if you have Yarn:
yarn global add docusaurus-init