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!
Docusaurus' minimum supported Node.js version is Node 8, but more recent versions will work as well.
- Open your Terminal.
- If you have
npmthe package manager (allows you to install npm modules from your terminal).
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.
node -v v8.15.1
Install Yarn (Optional)
We highly recommend you to 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
- Go to https://github.com/ and sign up for an account if you don't already have one.
- Click on "New Repository" or go to https://github.com/new.
- Name your repository without spaces. For e.g.
- Proceed to create the repository without adding
.gitignoreor a license.
- Clone your repository to your local machine:
git clone [email protected]:USERNAME/docusaurus-tutorial.git # SSH # or git clone https://github.com/USERNAME/docusaurus-tutorial.git # HTTPS
cdinto the repository which you just created.
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