A Docker image for the Hexo static blogging platform. Supports custom themes, plugins, and configurations. Primarily intended for local development and rapid prototyping of blog posts, but can also be used in production — the recommended approach is to use hexo deploy to push the generated static files to a CDN or web server.
| Architecture | Available | Tag |
|---|---|---|
| x86-64 | ✅ | latest |
| arm64 | ✅ | latest |
| Registry | Image |
|---|---|
| GHCR | ghcr.io/fletchto99/hexo-dev-docker |
| Docker Hub | fletchto99/hexo-dev-blog |
services:
blog:
image: ghcr.io/fletchto99/hexo-dev-docker
ports:
- "8080:8080"
volumes:
- ./blog:/config
environment:
- HEXO_PLUGINS=hexo-wordcount hexo-deploy-rsync # optionaldocker compose updocker run -d \
--name blog \
-v ./blog:/config \
-e HEXO_PLUGINS="hexo-wordcount hexo-deploy-rsync" \
-p 8080:8080 \
ghcr.io/fletchto99/hexo-dev-docker| Mount | Description |
|---|---|
/config |
Blog source files, themes, and generated output |
| Variable | Required | Description |
|---|---|---|
HEXO_PLUGINS |
No | Space-separated list of Hexo plugins to install at startup (e.g. hexo-wordcount hexo-deploy-rsync) |
On first startup, if the /config volume is empty, Hexo will initialize a new blog with the default scaffolding:
/config/
├── _config.yml # Hexo configuration
├── source/
│ └── _posts/ # Markdown blog posts
├── themes/ # Hexo themes
└── public/ # Generated static HTML (safe to deploy)
- Clone the theme into your
blog/themes/<theme-name>directory on the host. - Attach to the container console:
docker exec -it blog bash - Navigate to
/config/themes/<theme-name>and run any required setup commands (e.g.npm install). - Update
_config.ymlto use the new theme.
This container includes rsync for deployment. Add the hexo-deploy-rsync plugin via the HEXO_PLUGINS environment variable, then configure the deploy section in _config.yml:
deploy:
type: rsync
host: <prod server>
user: <user>
root: <path/to/blog/dir>
port: 22
delete: true
args: "-e ssh -i /config/deploy_key <user>@<prod server>"
verbose: true
ignore_errors: falsePlace your private key at blog/deploy_key on the host (mounted as /config/deploy_key in the container), then run:
docker exec -it blog hexo deploy