Introduction
A step-by-step guide to setting up a Hexo blog on GitHub Pages in 2025, highlighting common pitfalls and important notes for a smooth experience.
Prerequisites
- nvs
- To install the
Node.js
- Download v1.7.1: https://github.com/jasongin/nvs/releases
- To install the
- Node.js
- Using
nvs
to install > v22.17.0
- Using
- Git
- v2.21.0.windows.1
- GitHub account
- Basic command line knowledge
Step 0: Install nvs
and hexo-cli
- Downlaod and install the
nvs
- You may encounter the below
Policy error
- Update the policy in windows powershell terminal in Admin. mode
1 | Get-ExecutionPolicy |
Step 1: Install Hexo
- Install
hexo-cli
vianpm
1 | npm install -g hexo-cli |
Step 2: Initialize Your Blog
1 | hexo init my-blog |
Important:
Make sure you are in an empty directory before running hexo init
.
Step 3: Create a GitHub Repository
Name it
<username>.github.io
for user/organization pages.For project pages, use any repo name and set the correct branch in Hexo config.

Note:
Repository name and branch matter for GitHub Pages to work.
Step 4: Configure _config.yml
- Set your
url
to match your GitHub Pages URL:https://<username>.github.io
- Update
deploy
settings for GitHub Pages.
Important:
- Incorrect
url
ordeploy
config can cause broken links or failed deployments. - The url link is different in the
url
anddeploy
setting
Step 5: Add .nojekyll
file
There are new steps for Github if you want to directly depkoy the web but not using Github internal build process.
Add a .nojekyll
file in the root of the deploy files
So, you need to add a source file in Hexo
- Add
.nojekyll
file insoruce /_posts
folder

- Add Include settgins in
_config.yml
file

Step 6: Deploy with Hexo
Install the deployer:
1 | npm install hexo-deployer-git --save |
Update _config.yml
:
1 | deploy: |
Deploy:
1 | hexo clean && hexo generate && hexo deploy |
Theme setting
Have a look at the Hexo themes here: Theme
However, most of them seem outdated and are not maintained anymore. Finally, I chose the hexo-theme-next theme.
It has a new repo for maintenance: https://github.com/theme-next/hexo-theme-next
However, it has not been updated for 5 years….
I have a little bit of regret choosing the Hexo blog framework…
Conclusion
Setting up Hexo on GitHub Pages in 2025 is straightforward but seems it is a bit outdated.