【学习】Ubuntu下openclaw部署全流程

前言

最近openclaw、miclaw大火,我也来学习一下这些框架是做什么的,能干什么~

由于家里目前正好有一台闲置的ubuntu 22笔记本,打算本地+key部署一下,本地部署openclaw,通过key调用大模型。

搭建中参考了很多教程,主要参考:

https://blog.csdn.net/qq_40600379/article/details/158432149?spm=1011.2415.3001.10575&sharefrom=mp_manage_link3

一、安装依赖

基础环境

sudo apt update
sudo apt install -y curl

node

# 添加 NodeSource 仓库并安装
curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
sudo apt-get install -y nodejs

# 安装完成后,验证版本
node -v
npm -v

设置node国内镜像

npm config set registry https://registry.npmmirror.com 

二、安装openclaw

执行安装脚本,输入 y

curl -fsSL https://openclaw.ai/install.sh | bash

image-20260308183417275

选择 Quick Start(键盘方向键选择,回车确定)

image-20260308183441536

选择模型提供商,后续需要提供对应的key;

这里如果有你想选择的提供商,选择并按照提示输入key即可;

如果没有,则Skip for now

image-20260308183538987

这样就会帮助你进行筛选,选择All providers

image-20260308184221674

选择keep current

image-20260308184318882

跳过通道选择,skip for now

image-20260308184445030

跳过搜索设置

image-20260308184545472

跳过技能配置

image-20260308184604686

跳过hooks

image-20260308184625788

选择机器人启动方式,这里选择web ui,更为方便

image-20260308184826639

(如果遇到无法启动web端或者不消息在配置中退出了web也无所谓)

完成后激活环境变量

source ~/.bashrc

三、模型配置

在终端执行

openclaw config

选择网关运行位置

提示内容:Where will the Gateway run?

可选选项:● local / ○ remote

选择:● local(网关运行在本地服务器,回车确认)

选择配置模块

提示内容:Select sections to configure

可选选项:● Model / ○ Channels / ○ Skills / ○ Hooks / ○ Gateway

选择:● Model(进入模型配置,回车确认)

选择模型提供商

提示内容:Model/auth provider

可选选项:○ Anthropic / ○ OpenAI / ○ MiniMax / … / ● Custom Provider (Any OpenAI or Anthropic compatible endpoint)

选择:● Custom Provider(自定义提供商,回车确认)

输入deepseek基地址

提示内容:Enter the base URL for the custom provider

输入内容:https://api.deepseek.com/v1(输入完成后回车确认)

选择api key提供方式

提示内容:How do you want to provide this API key?

可选选项:

    ● Paste API key now (Stores the key directly in OpenClaw config)

    ○ Use environment variable (Requires restarting the gateway)

选择:● Paste API key now(立即粘贴 API Key,回车确认)

输入DeepSeek API Key

提示内容:Enter the API key

操作:粘贴 DeepSeek 官方提供的 API Key

选择端点兼容性

提示内容:Endpoint compatibility
可选选项:
  ● OpenAI-compatible (Uses /chat/completions)
  ○ Anthropic-compatible (Uses /messages)
选择:● OpenAI-compatible(OpenAI 兼容模式,回车确认)

输入模型 ID

提示内容:Enter the model ID (e.g., gpt-4, claude-3-opus)
输入内容:
  推理模型:`deepseek-reasoner`
  对话模型:`deepseek-chat`
操作:根据需求输入对应模型 ID,回车确认

选择 Endpoint ID

提示内容:Select an endpoint ID (or create a new one)
可选选项:● custom-api-deepseek-com(默认选项,回车确认)

设置模型别名(可选)

提示内容:Model alias (optional, for easier reference)
操作:可输入 `deepseek` 作为别名(便于后续识别),也可直接回车跳过(不设置别名)

接下来会问你还配置什么,选择continue退出即可。

image-20260308192511234

常用指令

获取web控制台链接

openclaw dashboard --no-open

重启openclaw网关

openclaw gateway restart
posted @ 2026-03-08 20:21  小拳头呀  阅读(31)  评论(0)    收藏  举报