Setting up Hexo Blog#
1. Server Configuration#
Server Requirements#
Programs that need to be installed on the server
- Nginx
- Node.js (Node.js version should not be lower than 10.13, it is recommended to use Node.js 12.0 and above)
- Git
- npm (I didn't have the npm command after installing Node, so I had to install it myself)
Using Ubuntu server as an example
First, update the system
sudo apt-get update && apt-get upgrade -y
- Install Nginx
sudo apt install nginx
- Install Node.js
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - &&\
sudo apt-get install -y nodejs
- Install Git
sudo apt-get install git
- Install npm
apt install npm
Install Hexo#
- Create a directory to store files
mkdir /var/hexo && cd /var/hexo
- Install Hexo
npm install -g hexo-cli
- Initialization
Go to the hexo folder created earlier and execute
hexo init jmlot
# Then a jmlot folder will be created, the blog files seem to be placed here
- Generate static files, an additional public folder will be created
hexo g
Newly generated Public folder
- View the blog
hexo s
Hexo Help Commands#
The blog program has been set up and can run normally!