This is a Hexo using the latest version of Node.js, which is currently Node.js 24.
2.3K
English | 简体中文
Dockerized Hexo with Hexo Admin
A Hexo environment running the latest Node.js (currently Node.js 24).
https://github.com/SeeDLL/Ubuntu_Docker
The image is available directly from Docker Hub.
Node.js: https://hub.docker.com/_/node
Hexo Blog Framework: https://hexo.io
Pull the Image
| Source | Command |
|---|---|
| Docker Hub | docker pull seedll/hexo:latest |
Create a Container
docker create \
--name=hexo \
-p 4000:13389 \
-e HEXO_SERVER_PORT=13389 \
-e RUN_MODE=server \
-e APP_CHECK_UPDATE=true \
-e CUSTOM_SCRIPTS=true \
-e CUSTOM_SCRIPT1="xx1.sh" \
-e CUSTOM_SCRIPT2="xx2.sh" \
-e GIT_USER=xxxxxx \
-e [email protected] \
-v {your_hexo_dir_path}:/app \
-v {your_custom_scripts_dir_path}:/custom_scripts \
--restart unless-stopped \
seedll/hexo:latest
| Variable | Description |
|---|---|
HEXO_SERVER_PORT | Custom port for Hexo server. |
RUN_MODE | Hexo operation mode: server (live server) or build (static site generation). Default: server. |
APP_CHECK_UPDATE | If true, checks for updates to Hexo and dependencies on container start. |
CUSTOM_SCRIPTS | Enable (true/false) custom scripts execution. |
CUSTOM_SCRIPT1 | Filename for Script 1 (executed before requirements.txt installation). |
CUSTOM_SCRIPT2 | Filename for Script 2 (executed after requirements.txt installation). |
GIT_USER | Git username configuration. |
GIT_EMAIL | Git email configuration. |
/app | Host directory bound to Hexo’s working directory in the container. |
/custom_scripts | Host directory for custom scripts. |
| LANG=zh-cn | Configures display language: zh-cn for Chinese, en_US for English |
-v bound directory is empty, a fresh Hexo setup will be auto-initialized.node_modules, node_modules will be initialized.requirements.txt exists, required modules will be installed after node_modules initialization.APP_CHECK_UPDATE=true to auto-update Hexo and dependencies on container start.Run
Static Site Generation (Build Mode):
sudo docker run -it -d --name=GithubBlog \
-e HEXO_SERVER_PORT=4000 \
-e RUN_MODE=build \
-e CUSTOM_SCRIPTS=true \
-e CUSTOM_SCRIPT1="diy1.sh" \
-e CUSTOM_SCRIPT2="diy2.sh" \
-v /home/temp/code/MyBolgSource/:/app \
-v /home/temp/code/custDir:/custom_scripts \
-p 127.0.0.1:4000:4000 \
seedll/hexo
Live Server Mode:
sudo docker run -it -d --name=GithubBlog \
-e HEXO_SERVER_PORT=4000 \
-e RUN_MODE=server \
-e CUSTOM_SCRIPTS=true \
-e CUSTOM_SCRIPT1="diy1.sh" \
-e CUSTOM_SCRIPT2="diy2.sh" \
-v /home/temp/code/MyBolgSource/:/app \
-v /home/temp/code/custDir:/custom_scripts \
-p 127.0.0.1:4000:4000 \
seedll/hexo
Stop the Container
docker stop hexo
Remove the Container
docker rm hexo
Remove the Image
docker image rm seedll/hexo:latest
node_modules, requirements.txt).Let me know if you'd like any refinements!
Content type
Image
Digest
sha256:818342c40…
Size
116.9 MB
Last updated
4 months ago
docker pull seedll/hexo