支持 Ubuntu、Debian、CentOS、RHEL 等系统
在终端运行以下命令,即可自动安装 Node.js 和 OpenClaw:
curl -fsSL https://get.openclaw.ai | bash
等待安装完成即可!
curl -fsSL https://fnm.vercel.app/install | bash source ~/.bashrc fnm install --lts fnm use --lts
或者使用 apt 安装:
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash - sudo apt-get install -y nodejs
curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash - sudo yum install -y nodejs
curl -fsSL https://rpm.nodesource.com/setup_lts.x | sudo bash - sudo dnf install -y nodejs
node -v
如果显示版本号(如 v20.11.0),说明安装成功!
sudo apt update sudo apt install git
sudo yum install git
在终端输入以下命令:
npm install -g openclaw@latest
等待安装完成,大概需要1-2分钟。
sudo:sudo npm install -g openclaw@latest
安装完成后,在终端输入:
openclaw onboard --install-daemon
这会启动初始化向导,按提示操作:
在终端依次输入:
openclaw gateway start
然后输入:
openclaw dashboard
浏览器会自动打开:http://127.0.0.1:18789/
如果是服务器安装,用其他电脑浏览器访问服务器IP:18789
如果想让龙虾AI开机自动启动,可以配置 systemd 服务:
sudo nano /etc/systemd/system/openclaw.service
写入以下内容:
[Unit] Description=OpenClaw AI Assistant After=network.target [Service] Type=simple User=你的用户名 WorkingDirectory=/home/你的用户名 ExecStart=/usr/local/bin/openclaw gateway start Restart=always [Install] WantedBy=multi-user.target
然后启用服务:
sudo systemctl daemon-reload sudo systemctl enable openclaw sudo systemctl start openclaw
Q: 提示 command not found?
A: 运行 source ~/.bashrc 刷新环境变量
Q: 网关启动失败?
A: 输入 openclaw gateway restart 重试
Q: 端口被占用?
A: 检查 18789 端口是否被其他程序占用
Q: 怎么关闭龙虾AI?
A: 输入 openclaw gateway stop
如果安装过程中遇到问题,可以:
© 2026 龙虾AI