Files
BackupX/docs-site/i18n/zh-CN/docusaurus-plugin-content-docs/current/deployment/bare-metal.md
T
Wu Qing 61709dd4c9 fix(cluster): support external master URL
- add server.external_url / BACKUPX_SERVER_EXTERNAL_URL for Agent install URL generation
- pass the configured external Master URL into install script and compose rendering
- document cluster deployment requirements for Docker, bare-metal, and multi-node setups

Fixes #55
2026-05-09 07:41:51 +08:00

2.0 KiB
Raw Blame History

sidebar_position, title, description
sidebar_position title description
2 裸机部署 从预编译包或源码部署 BackupXsystemd + Nginx)。

裸机部署

使用预编译包

# 下载对应平台的压缩包
curl -LO https://github.com/Awuqing/BackupX/releases/latest/download/backupx-v1.6.0-linux-amd64.tar.gz

# 解压并安装
tar xzf backupx-v*-linux-amd64.tar.gz && cd backupx-*
sudo ./install.sh

安装脚本自动完成以下步骤:

  1. 创建系统用户 backupx
  2. 复制二进制到 /opt/backupx/
  3. 生成默认 config.yaml(含安全的 JWT/加密密钥)
  4. 安装并启用 backupx.service systemd 单元
  5. (可选)生成 Nginx 站点配置 — 参见 Nginx 反向代理

如果要部署多节点集群,安装后请编辑 /etc/backupx/config.yaml,设置远程 Agent 可访问到的 Master URL

server:
  external_url: "https://backup.example.com"

修改后重启 BackupX

sudo systemctl restart backupx

从源码构建

git clone https://github.com/Awuqing/BackupX.git && cd BackupX
make build
sudo ./deploy/install.sh

make build 会产出:

  • server/bin/backupxGo 后端,无 CGO
  • web/dist/React 前端,执行 npm run build

systemd

安装后的 service 文件:

[Unit]
Description=BackupX backup management service
After=network.target

[Service]
Type=simple
User=backupx
WorkingDirectory=/opt/backupx
ExecStart=/opt/backupx/backupx --config /opt/backupx/config.yaml
Restart=on-failure
RestartSec=5s
LimitNOFILE=65536

[Install]
WantedBy=multi-user.target

常用命令:

sudo systemctl status backupx
sudo journalctl -u backupx -f    # 实时日志
sudo systemctl restart backupx

密码重置

忘记管理员密码时:

/opt/backupx/backupx reset-password \
  --username admin \
  --password 'newpass123' \
  --config /opt/backupx/config.yaml

Docker 等效命令:

docker exec -it backupx /app/bin/backupx reset-password --username admin --password 'newpass123'