I was originally planning to create a blog using Create React App. It was extremely easy to set up
create-react-app, but “the devil is in the details”. So I decided to use Hexo framework instead, as did not want to spend much time googling stuff and figuring out the details.
Before I started, I did not have any experience with
hexo, and had no idea about
nvm. So below an instruction for beginners :)
Install Git if you don’t have it yet (installation instructions).
Install nvm (Node Version Manager)
If you get
nvm: command not found after running the install script, try solutions described here. In my case I solved the problem with
nvm by adding this line of code into
Hexo framework is powered by
node.js, that is why you need to have
node installed before proceeding with Hexo installation.
Suppose you want to create your blog in a local folder
my-blog. Run one by one the following commands:
Voila! The blog is ready, check it out at http://localhost:4000/.
Configure blog settings
Now you can start configuring your blog using
_config.yml file in the root of your blog’s folder. There are lots of settings can be configured (read more about it). To start with, you can configure some personal information as did I:
Now it is time to beautify your blog. You can choose one of a few dozens free themes available here. My choice was
cactus-white that is based on a cactus-dark theme. Below are a few commands you need to run one by one in the Terminal in order to switch theme from default one to the
After you installed a new theme, you need to change the
theme property in the
To see the changes at http://localhost:4000/, you need to re-generate blog by running
hexo generate, and then restart the hexo server (stop it and then run
Write a new post
To create a new post or a new page, you can use the following commands:
A file with .md extension will be created in a
source folder. You can write your post using markdown - lightweight markup language with plain text formatting syntax.
Deploy to GitHub Pages
Make sure you have created a GitHub repository with a name
username.github.io. For example, my repository is
Install hexo deployer plugin:
Once the plugin is installed, change deployment settings in the
_config.ymlfile (replace ‘username’ with your GitHub username):
Deploy the blog to GitHub pages using this command:
Done, your blog is now available at
The whole process took me a few hours (90% of that time I spent choosing a blog theme).
Before you go...
If you found this article helpful, click the "Like" button below or share the article on Facebook so your friends can benefit from it too :)