This is an example of how to deploy a Hexo static blog on Clever Cloud, using the Node.js runtime.
Hexo is a fast, simple and powerful blog framework that renders Markdown posts into static HTML files. This example serves those generated pages with hexo server and regenerates them on every deployment.
This is the default Hexo scaffold using the Landscape theme. It ships with:
- A sample "Hello World" post under
source/_posts/ - The standard Hexo generators (index, archive, category, tag)
- EJS, Markdown and Stylus renderers
- The Landscape theme
The site is served on port 8080, as required by the Clever Cloud Node.js runtime.
- Hexo 8 - Static blog framework
- hexo-server - Built-in server
- Landscape - Default theme
- Node.js 24+
- Node.js 24+
- npm
npm install
npm startThe application will be accessible at http://localhost:8080.
To write content and regenerate the static pages:
npx hexo new "My new post" # create a new post in source/_posts/
npx hexo generate # render Markdown into static HTML (public/)
npx hexo clean # clear the cache and generated filesThe server launch is configured in package.json, in the scripts.start field:
hexo server --port 8080 --static- Listening on port
8080is required to deploy on Clever Cloud. - The
--staticoption serves only the pages generated byhexo generate. Remove it if you want Hexo to render pages on the fly.
Because --static serves the pre-generated public/ folder (which is not committed), you need to (re)generate it on every deployment with a post-build hook. See the optional step in the deployment instructions below.
You have two options to deploy your application on Clever Cloud: using the Web Console or using the Clever Tools CLI.
If you don't already have an account, go to the Clever Cloud console and follow the registration instructions.
- Log in to the Clever Cloud console
- Click on "Create" and select "An application"
- Choose "Node.js" as the runtime environment
- Configure your application settings (name, region, etc.)
The default start command runs hexo server --static, which serves only the pages produced by hexo generate. Since the generated public/ folder is not committed, add a post-build hook so the pages are (re)generated on every deployment — otherwise the app will respond with Cannot GET /.
In your application's dashboard, go to Environment variables and add:
CC_POST_BUILD_HOOK = npx hexo generate
Skip this step only if you removed the
--staticoption from thestartscript.
You can deploy your application using Git:
# Add Clever Cloud as a remote repository
git remote add clever git+ssh://git@push-par-clevercloud-customers.services.clever-cloud.com/app_<your-app-id>.git
# Push your code to deploy
git push clever masterInstall the Clever Tools CLI following the official documentation:
# Using npm
npm install -g clever-tools
# Or using Homebrew (macOS)
brew install clever-toolsclever login# Initialize the current directory as a Clever Cloud application
clever create --type node <YOUR_APP_NAME>clever scale --min-flavor pico --max-flavor pico
clever scale --min-instances 1 --max-instances 1More information on scaling in the documentation.
The default start command runs hexo server --static, which serves only the pages produced by hexo generate. Since the generated public/ folder is not committed, add a post-build hook so the pages are (re)generated on every deployment — otherwise the app will respond with Cannot GET /:
clever env set CC_POST_BUILD_HOOK "npx hexo generate"Skip this step only if you removed the
--staticoption from thestartscript.
clever deployOnce deployed, you can access your application at the URL provided by Clever Cloud.
clever openOnce deployed, you can monitor your application through:
- Web Console: The Clever Cloud console provides logs, metrics, and other tools to help you manage your application.
- CLI: Use
clever logsto view application logs andclever statusto check the status of your application.
This example is provided under the terms of the MIT license.