
v0.35.1 on Ubuntu 16.04/18.04. Hexo 8.x requires Node ≥ 20.19. Below: nvm 0.40.7, current LTS, hexo-cli without sudo, and the official workflow (init, server, generate). This site ran Hexo for years and migrated to WordPress in 2026 — the generator remains useful for static blogs.Hexo is a static site generator in Node.js: Markdown goes in, HTML comes out, no database. GitHub Pages, Netlify, an nginx pointing to public/. In September 2026 the npm package hexo is at 8.1.2. The official CLI remains npm install -g hexo-cli — but without root.
Node via nvm (do not use sudo npm)
Hexo 8.0+ requires Node 20.19 or newer. Ubuntu apt lags behind. nvm 0.40.7 (18 August 2026) installs the LTS in your home directory:
sudo apt update
sudo apt install -y build-essential git curl
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.7/install.sh | bash
source ~/.bashrc
nvm install --lts
nvm use --lts
node -v
npm -v
If you see EACCES with global npm, the prefix is wrong — do not fix it with sudo. nvm already points npm to ~/.nvm. Alternative: fnm.
npm install -g hexo-cli
hexo version
First blog
hexo init clones the starter (Landscape theme) and installs dependencies with npm, yarn or pnpm — whichever is in PATH:
hexo init ~/src/blog
cd ~/src/blog
hexo new "Olá, Hexo"
hexo server
Open http://localhost:4000. The draft is in source/_posts/, Markdown + front-matter. Generate static files:
hexo generate
# ou: hexo g
ls public/
The public/ is what nginx or Pages serves. Do not commit this folder — the .gitignore in the starter already ignores it.
Publish
GitHub Pages, in 2026, uses an Action, not just hexo-deployer-git in gh-pages. The official docs: hexo.io/docs/github-pages. Deployment via rsync/git still exists:
npm install hexo-deployer-git --save
# _config.yml → deploy: type: git / repo: / branch:
hexo clean && hexo deploy
An nginx on the VPS: root /caminho/do/blog/public; and hexo generate in cron or CI. No PHP, no MariaDB.
Wrap-up
Node LTS, hexo-cli under your user, hexo init, hexo s, hexo g. Not the nvm 0.35 and Ubuntu 16.04 from the original post. Docs: hexo.io/docs · github.com/hexojs/hexo.