O
OpenClaw
首页博客关于文档社区
O
OpenClaw

OpenClaw - 你的AI助手平台。连接AI能力,让工作更高效,生活更有趣。

导航

  • 首页
  • 博客
  • 关于
  • 文档
  • 社区

资源

  • GitHub
  • Discord
  • 使用文档
© 2026 OpenClaw. All rights reserved.Powered by OpenClaw & Next.js
返回首页
技术

CentOS/RHEL 系统安装 OpenClaw 指南

技
技术老炮
2026年3月19日
|
0 阅读
|
2 分钟阅读
分享:

# CentOS/RHEL 系统安装 OpenClaw 指南


本教程详细介绍如何在 CentOS Stream 9 或 RHEL 9 上安装 OpenClaw


环境要求


  • CentOS Stream 9 或 RHEL 9
  • 2GB+ RAM
  • 20GB+ 可用磁盘空间
  • Node.js 18+

第一步:更新系统


bash
sudo dnf update -y

第二步:安装 Node.js


bash
# 添加 Node.js 20.x 源
curl -fsSL https://rpm.nodesource.com/setup_20.x | sudo bash -

# 安装 Node.js
sudo dnf install -y nodejs

# 验证
node --version
npm --version

第三步:安装 PostgreSQL


bash
# 安装 PostgreSQL
sudo dnf install -y postgresql-server postgresql-contrib

# 初始化数据库
sudo postgresql-setup --initdb

# 启动服务
sudo systemctl start postgresql
sudo systemctl enable postgresql

# 创建用户和数据库
sudo -u postgres createuser -s openclaw
sudo -u postgres createdb openclaw
sudo -u postgres psql -c "ALTER USER openclaw WITH PASSWORD 'your_password';"

第四步:安装 Git 和其他依赖


bash
sudo dnf install -y git gcc-c++ make

第五步:克隆并安装 OpenClaw


bash
git clone https://github.com/openclaw/openclaw.git
cd openclaw
npm install

第六步:配置


bash
cp .env.example .env
nano .env

设置以下关键配置:

env
DATABASE_URL=postgresql://openclaw:your_password@localhost:5432/openclaw
JWT_SECRET=your-secret-key
AI_PROVIDER=openai
OPENAI_API_KEY=your-api-key

第七步:初始化数据库


bash
npx prisma generate
npx prisma db push

第八步:使用 PM2 启动


bash
sudo npm install -g pm2
pm2 start npm --name "openclaw" -- start
pm2 startup
pm2 save

防火墙配置


bash
# 开放 3000 端口
sudo firewall-cmd --permanent --add-port=3000/tcp
sudo firewall-cmd --reload

验证


访问 http://your-server-ip:3000


---


相关教程:

  • [Ubuntu/Debian 安装指南](/post/install-openclaw-ubuntu)
  • [Docker 安装 OpenClaw](/post/install-openclaw-docker)

标签

#OpenClaw#CentOS#RHEL#安装教程#Linux

相关文章

Ubuntu/Debian 系统安装 OpenClaw 完整指南

详细步骤指南:在 Ubuntu 和 Debian 系统上安装 OpenClaw AI 助手平台,包含开发环境和生产环境配置。

2026-03-20

Windows WSL2 安装 OpenClaw 教程

在 Windows 11/10 上通过 WSL2 Ubuntu 安装 OpenClaw 的详细教程,适合开发环境。

2026-03-20

macOS 安装 OpenClaw 指南

# macOS 安装 OpenClaw 指南 > 在 Mac 上安装 OpenClaw AI 助手平台 ## 环境要求 - macOS 12 (Monterey) 或更高版本 - 4GB+ RA

2026-03-20
上一篇

Ubuntu/Debian 系统安装 OpenClaw 完整指南

下一篇

Windows WSL2 安装 OpenClaw 教程

订阅博客更新

通过 RSS 订阅,及时获取最新文章

RSS 订阅链接
返回文章列表

评论 (0)

发表评论

0/1000