Deploy a Docusaurus website
Docusaurus is a static site generator that helps you build optimized websites quickly. It is designed to help you create documentation, blogs, and other content-driven sites with ease.
Requirements
If you need example source code, initialize a new project with Git and Node.js:
npx create-docusaurus@latest myStaticApp classic --javascriptDeploy a static application
You can create an application in our Console or through Clever Tools. Install them with npm or any supported package manager:
# Install with npm or any supported method
npm i -g clever-tools
# Login to Clever Cloud and check it worked
clever login
clever profileGo to the folder where you want to create your application, initialize a Git repository and create the linked application:
cd myStaticApp
git init
clever create -t staticTo deploy on Clever Cloud, your local folder needs to be an initialized Git repository linked to an application. If you already have an application on Clever Cloud and want to link it to the current local folder:
clever link your_app_name_or_IDAutomatic build
Docusaurus is one of the static site generators supported by the Static runtime automatic build, so you don’t need any additional build configuration.
Push your code
Once you complete these steps, commit your content to the local repository and deploy it:
git add .
git commit -m "First deploy"
clever deploy
clever openYou can display your website’s URL or add a custom domain to it (you’ll need to configure DNS):
clever domain
clever domain add your.website.tld404 page location
If you need to use a specific page for 404 errors, define its location with the SERVER_ERROR_PAGE_404 environment variable from Static Web Server, used by default in the Static runtime. For example: SERVER_ERROR_PAGE_404=404.html.