Halo deployment: Docker Compose + reverse proxy
Open-source Java website builder from China with themes and plugins. Uses the community image halohub/halo.
In short: Open-source Java website builder from China with themes and plugins. Uses the community image halohub/halo. This page gives a Docker Compose deployment based on the official source; data lives in /opt/halo and the web port is bound to 127.0.0.1 behind Nginx / Caddy.
- Server
- Official: Official compose sets JVM_OPTS=-Xmx256m -Xms256m by default; our generic suggestion: 2 vCPU / 2 GB RAM and up
- Ports
- 8090 (Web)
- CPU arch
- Images published for amd64 / arm64 (image manifests checked 2026-11-14)
- Install
curl -fsSL https://deploy.cc/i/halo.sh -o halo.sh && sudo bash halo.sh --domain example.com- Official source
- docs.halo.run/guide/install/docker-compose
- Last verified
- 2026-11-13 · Run-tested
Overview & official links
- About
- Open-source Java website builder from China with themes and plugins. Uses the community image halohub/halo.
- Repository
- github.com/halo-dev/halo
- Docs
- docs.halo.run
- Deploy source
- docs.halo.run/guide/install/docker-compose checked 2026-11-13
- Verification
- Run-tested Started with our script on a test machine and answered over HTTP · HTTP 200 · 2026-11-13
- Ports
8090Web
Server requirements
Official requirements
Official compose sets JVM_OPTS=-Xmx256m -Xms256m by default. — source
Suggested VPS size
2 vCPU / 2 GB RAM and up, Debian 12 / Ubuntu 24.04 with Docker.
Generic suggestion, not official.
Option 1: install script (optional)
Writes the compose below to /opt/halo and starts it; check the sha256 first. What the script does
curl -fsSL https://deploy.cc/i/halo.sh -o halo.sh sha256sum halo.sh # 7b4f506ea5fb2a4166a9aa082aff199817af6a21fcc7ebd7fe64510d0ab253ef less halo.sh sudo bash halo.sh --domain example.com
sha256: 7b4f506ea5fb2a4166a9aa082aff199817af6a21fcc7ebd7fe64510d0ab253ef · Checks ports: 8090/tcp
Option 2: docker-compose by hand
Save to /opt/halo, replace __GEN_…__ in .env, then docker compose up -d.
# Halo — docker-compose.yml (deploy.cc)
# 官方来源 / Official source: https://docs.halo.run/guide/install/docker-compose
# 核对日期 / Checked: 2026-11-13
# 改动: 镜像改为社区版 halohub/halo:2.27
# 改动: 数据库密码改为 .env 随机值
# 改动: 外部访问地址从 .env 读取
services:
halo:
image: halohub/halo:2.27
restart: on-failure:3
depends_on:
halodb:
condition: service_healthy
networks:
halo_network:
volumes:
- ./halo2:/root/.halo2
ports:
- "127.0.0.1:8090:8090"
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8090/actuator/health/readiness"]
interval: 30s
timeout: 5s
retries: 5
start_period: 30s
environment:
- JVM_OPTS=-Xmx256m -Xms256m
command:
- --spring.r2dbc.url=r2dbc:pool:postgresql://halodb/halo
- --spring.r2dbc.username=halo
- --spring.r2dbc.password=${DB_PASSWORD:?set DB_PASSWORD in .env}
- --spring.sql.init.platform=postgresql
- --halo.external-url=${EXTERNAL_URL:?set EXTERNAL_URL in .env}
halodb:
image: postgres:15.4
restart: on-failure:3
networks:
halo_network:
volumes:
- ./db:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
environment:
- POSTGRES_PASSWORD=${DB_PASSWORD:?set DB_PASSWORD in .env}
- POSTGRES_USER=halo
- POSTGRES_DB=halo
- PGUSER=halo
networks:
halo_network:
- The official example uses the paid image halo-pro; the community image is halohub/halo (see the image notes in the docs).
Environment variables
| Variable | Meaning |
|---|---|
| DB_PASSWORD | PostgreSQL password (generated) |
| EXTERNAL_URL | Public site URL, ending with / |
| TZ | Time zone (default Asia/Shanghai) |
# Halo — deploy.cc .env 模板 / template # __GEN_*__ 由一键脚本替换为随机值;手动部署请自己改掉。 TZ=Asia/Shanghai # PostgreSQL 密码(自动生成) / PostgreSQL password (generated) DB_PASSWORD=__GEN_PW__ # 站点外部访问地址,结尾带 / / Public site URL, ending with / EXTERNAL_URL=__URL__/
Reverse proxy & HTTPS
The app listens on 127.0.0.1:8090; expose it with Nginx or Caddy over HTTPS. For rate limiting, caching and more, use the nginx.cc generator.
# Halo 反向代理 / reverse proxy — generated by deploy.cc
# 把 example.com 换成你的域名,证书路径按实际修改(certbot / acme.sh 签发)。
# Replace example.com and the certificate paths. More options: https://nginx.cc/zh/gen
# 放到 /etc/nginx/conf.d/<name>.conf,然后 nginx -t && systemctl reload nginx
server {
listen 80;
listen [::]:80;
server_name example.com;
location /.well-known/acme-challenge/ {
root /var/www/html;
}
location / {
return 301 https://$host$request_uri;
}
}
server {
listen 443 ssl;
listen [::]:443 ssl;
http2 on; # nginx < 1.25.1: 删除此行,改为 listen 443 ssl http2;
server_name example.com;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
ssl_protocols TLSv1.2 TLSv1.3;
client_max_body_size 64m;
location / {
proxy_pass http://127.0.0.1:8090;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_read_timeout 300s;
}
}
Or Caddy (automatic certificates)
# Halo — Caddyfile (deploy.cc). Caddy 会自动申请 HTTPS 证书 / automatic HTTPS
example.com {
reverse_proxy 127.0.0.1:8090
}
Update, backup & uninstall
cd /opt/halo docker compose pull docker compose up -d docker image prune -f
Back up and read the release notes before major upgrades.
cd /opt/halo && docker compose stop tar czf /root/halo-$(date +%F).tar.gz -C /opt halo cd /opt/halo && docker compose start
cd /opt/halo && docker compose down # The next line deletes all data permanently — back up first # rm -rf /opt/halo
FAQ
What is Halo?
Open-source Java website builder from China with themes and plugins. Uses the community image halohub/halo. Repository: https://github.com/halo-dev/halo
What server do I need for Halo?
Official: Official compose sets JVM_OPTS=-Xmx256m -Xms256m by default; our generic suggestion: 2 vCPU / 2 GB RAM and up (source: https://docs.halo.run/guide/install/docker-compose)
Which ports does Halo use?
8090 (Web). The web port binds to 127.0.0.1 only; expose it through Nginx or Caddy with HTTPS.
Does Halo run on ARM (arm64) servers?
Yes. Every image in this compose (halohub/halo:2.27, postgres:15.4) publishes an arm64 build (manifests checked 2026-11-14).
How do I install Halo with one command?
As root on a Linux server: curl -fsSL https://deploy.cc/i/halo.sh -o halo.sh && sudo bash halo.sh --domain example.com. It installs Docker via the official get.docker.com if missing, writes files to /opt/halo with random secrets and runs docker compose up -d; it stops instead of overwriting when the directory exists or a port is taken.
Where is Halo's data and how do I back it up?
All data and .env live in /opt/halo (bind mounts). Back up with: cd /opt/halo && docker compose stop && tar czf /root/halo-$(date +%F).tar.gz -C /opt halo && docker compose start
How do I update Halo?
cd /opt/halo && docker compose pull && docker compose up -d && docker image prune -f. Back up and read the release notes before major upgrades.
How does this compose differ from the official example?
Source: https://docs.halo.run/guide/install/docker-compose. Our changes are listed (in Chinese) in the file header; typically ports bound to 127.0.0.1, named volumes replaced by bind mounts and example secrets moved to .env.
Plain-text version (for copying or AI tools): /en/apps/halo.md
Related apps
The most widely used open-source CMS for blogs and business sites, with the largest plugin and theme ecosystem.
Blogs, CMS & docsRun-tested GhostOpen-source publishing platform for blogs, newsletters and paid memberships (Node.js).
Blogs, CMS & docsRun-tested TypechoLightweight PHP blog engine, popular in China, fine on small VPS.
Blogs, CMS & docsRun-tested Wiki.jsModern open-source wiki (Node.js) with Markdown, permissions and many auth providers.
Blogs, CMS & docsRun-tested BookStackOpen-source documentation / knowledge base organised as shelves, books, chapters and pages (PHP).
Blogs, CMS & docsConfig-checked WalineOpen-source comment system with a backend; SQLite / MySQL / PostgreSQL storage.
Blogs, CMS & docsRun-tested