企业级openclaw应用部署

企业级openclaw应用部署

环境要求

2 核 CPU / 4 GB 内存 / 30 GB 磁盘(最低配置)

Python 3.12+

Node.js 20+

PostgreSQL 15+

Clawith

一、先更新系统依赖

shell 复制代码
sudo yum install -y epel-release
sudo yum update -y
sudo yum groupinstall -y "Development Tools"

二、安装 Python 3.12

shell 复制代码
# 安装编译依赖
sudo yum install -y gcc openssl-devel bzip2-devel libffi-devel zlib-devel wget make

# 下载并编译
cd /usr/src
sudo wget https://www.python.org/ftp/python/3.12.8/Python-3.12.8.tgz
sudo tar xzf Python-3.12.8.tgz
cd Python-3.12.8

sudo ./configure --enable-optimizations
sudo make -j$(nproc)
sudo make altinstall

验证:

shell 复制代码
python3.12 --version
pip3.12 --version

如果环境中有python3.9或pip3,导致版本不符的

shell 复制代码
sudo ln -sf /usr/local/bin/python3.12 /usr/bin/python3
sudo ln -sf /usr/local/bin/pip3.12 /usr/bin/pip3

三、安装 Node.js 22

shell 复制代码
curl -fsSL https://rpm.nodesource.com/setup_22.x | sudo bash -

# 安装
sudo yum install -y nodejs

# 验证
node -v
npm -v

四、安装 PostgreSQL 15

shell 复制代码
# 安装官方源
sudo dnf install -y https://download.postgresql.org/pub/repos/yum/reporpms/EL-9-x86_64/pgdg-redhat-repo-latest.noarch.rpm

# 禁用旧版
sudo dnf -qy module disable postgresql

# 安装
sudo dnf install -y postgresql15-server

# 初始化
sudo /usr/pgsql-15/bin/postgresql-15-setup initdb

# 开机自启
sudo systemctl enable postgresql-15
sudo systemctl start postgresql-15

设置密码

shell 复制代码
sudo -u postgres psql -c "ALTER USER postgres PASSWORD '123456';"

允许远程连接

shell 复制代码
sudo sed -i "s/^listen_addresses.*/listen_addresses = '*'/" /var/lib/pgsql/15/data/postgresql.conf
echo "host all all 0.0.0.0/0 md5" | sudo tee -a /var/lib/pgsql/15/data/pg_hba.conf
sudo systemctl restart postgresql-15

验证

shell 复制代码
psql --version

五、安装 Clawith

shell 复制代码
git clone https://github.com/dataelement/Clawith.git
cd Clawith
bash setup.sh         # 生产/测试:只装运行依赖(约 1 分钟)
bash setup.sh --dev   # 开发环境:额外装 pytest 等测试工具(约 3 分钟)

1、如果pip版本报错太低

shell 复制代码
pip3.12 install --upgrade pip==26.0.1

2、版本未同步报错

shell 复制代码
cd clawith/backend
.venv/bin/python -m pip install --upgrade pip==26.0.1 -i https://pypi.tuna.tsinghua.edu.cn/simple
.venv/bin/pip install -e '.' -i https://pypi.tuna.tsinghua.edu.cn/simple

重新执行

shell 复制代码
[root@localhost ~]# cd Clawith-main
[root@localhost Clawith-main]# sh setup.sh 

═══════════════════════════════════════
  🦞 Clawith --- First-time Setup
═══════════════════════════════════════

[1/6] Checking environment file...
  ✓ .env already exists

[2/6] Setting up PostgreSQL...
  ✓ Found psql: /usr/bin/psql
  ✓ PostgreSQL is running on port 5432
用户 root 的口令:
  ✓ Role 'clawith' already exists
用户 root 的口令:
  ✓ Database 'clawith' already exists
  ✓ DATABASE_URL set (port 5432)

[3/6] Setting up backend...
  Installing dependencies (this may take 1-2 minutes)...
Obtaining file:///root/Clawith-main/backend
  Installing build dependencies ... done
  Checking if build backend supports build_editable ... done
  Getting requirements to build editable ... done
  Preparing editable metadata (pyproject.toml) ... done
Requirement already satisfied: fastapi>=0.115.0 in ./.venv/lib/python3.12/site-packages (from fastapi[standard]>=0.115.0->clawith-backend==0.1.0) (0.135.2)

# 此处省略若干行 ...

Requirement already satisfied: sniffio in ./.venv/lib/python3.12/site-packages (from elasticsearch->aliyun-log-python-sdk<1.0.0,>=0.9.0->wuying-agentbay-sdk>=0.18.0->clawith-backend==0.1.0) (1.3.1)
Building wheels for collected packages: clawith-backend
  Building editable for clawith-backend (pyproject.toml) ... done
  Created wheel for clawith-backend: filename=clawith_backend-0.1.0-0.editable-py3-none-any.whl size=3327 sha256=bba9110748d43937349a537a943ca5d232a07db7fb280e77ddaecc6017e45be0
  Stored in directory: /tmp/pip-ephem-wheel-cache-rbdt0e22/wheels/ec/f3/67/ee23fff3801d73fcea206b9d75ce35179e118ac7ea6c85b955
Successfully built clawith-backend
Installing collected packages: clawith-backend
  Attempting uninstall: clawith-backend
    Found existing installation: clawith-backend 0.1.0
    Uninstalling clawith-backend-0.1.0:
      Successfully uninstalled clawith-backend-0.1.0
Successfully installed clawith-backend-0.1.0
  ✓ Backend dependencies installed

[4/6] Setting up frontend...
  Installing npm packages...
  ✓ Frontend dependencies installed

[5/6] Setting up database...

[6/6] Running database seed...
  ✅ Database tables created
  ✅ Default company created
  ✅ Template created: 🔬 研究助手
  ✅ Template created: 📋 项目管理助手
  ✅ Template created: 💬 客户服务助手
  ✅ Template created: 📊 数据分析师
  ✅ Template created: ✍️ 内容创作助手
  
  🎉 Seed data complete!


═══════════════════════════════════════
  🎉 Setup complete!
═══════════════════════════════════════

  To start the application:

  Option A: One-command start
    bash restart.sh

  Option B: Manual start
    # Terminal 1 --- Backend
    cd backend && .venv/bin/uvicorn app.main:app --host 0.0.0.0 --port 8008

    # Terminal 2 --- Frontend
    cd frontend && npx vite --host 0.0.0.0 --port 3008

  Option C: Docker
    docker compose up -d

  Access URLs:
    Local:   http://localhost:3008
    Network: http:// `ip` :3008

  The first user to register becomes the platform admin.

[root@localhost Clawith-main]#

启动

shell 复制代码
[root@localhost Clawith-main]# bash restart.sh
🔄 Stopping existing services...
🐘 PostgreSQL already running (port 5432)
🚀 Starting backend...
🔄 Running data migrations...
2026-04-01 15:48:58.729 | INFO     | __main__:migrate:29 - No schedules found to migrate.
  ✅ Backend ready (5s)
🚀 Starting frontend...
  ✅ Frontend ready (2s)
🔍 Verifying API proxy...
  ✅ Proxy working

═══════════════════════════════════════
  Clawith running!
═══════════════════════════════════════

  Local:   http://localhost:3008
  Network: http:// `ip` :3008
  API:     http:// `ip` :8008

  Backend log:  tail -f /root/Clawith-main/.data/log/backend.log
  Frontend log: tail -f /root/Clawith-main/.data/log/frontend.log
[root@localhost Clawith-main]# 

六、页面访问

相关推荐
饼干哥哥2 小时前
7*24小时全栈开发的Agent Team 避坑指南
人工智能
Elastic 中国社区官方博客2 小时前
从判断列表到训练好的 Learning to Rank( LTR )模型
大数据·数据库·人工智能·深度学习·elasticsearch·搜索引擎·全文检索
xiami_world2 小时前
AI生成PPT工具技术横评:Agent专家模式如何重构PPT生成工作流(6款工具实测)
人工智能·经验分享·ai·信息可视化·powerpoint
云雾J视界2 小时前
2026年AI Agent框架选型指南:OpenClaw vs LangChain vs AutoGen 深度对比
大数据·人工智能·langchain·agent·open claw
纪伊路上盛名在2 小时前
PPT汇报中方法学、框架流程图的 文生图方案1
人工智能·文生图·流程图·科研·agent
linux修理工2 小时前
armbian 安装openclaw
linux·运维·服务器
程序大视界2 小时前
用Claude Code分析Claude Code源码
人工智能·claude code
盘古信息IMS2 小时前
IMS六代精研!盘古信息擘画“中国离散制造MES + AI数智平台”新蓝图
人工智能·制造
在荒野的梦想2 小时前
LangChain4j 集成若依单体应用 | 5 大 AI 功能实战:多轮对话、流式输出、RAG 知识库
java·人工智能