---
title: "本地安装"
description: "在开发机上安装并运行 daemon、CLI 和原生工具。"
source: https://carina.nebutra.com/zh-cn/deployment/local/
---

# 本地安装

> 在开发机上安装并运行 daemon、CLI 和原生工具。

Carina 默认运行在开发机或你控制的内部 runner 上；local-first 是基线形态。

## 安装

```bash title="install-local.sh"
# 发布安装器
curl -fsSL https://carina.nebutra.com/install.sh | sh

# 从源码安装
git clone https://github.com/nebutra/carina.git
cd carina
make install
```

## 启动运行时

```bash title="start-daemon.sh"
carina daemon start
carina daemon status
carina version
carina doctor
```

优先让 CLI 管理 daemon 生命周期，它会发现与 binary 相邻的 kernel 和 native tools。只有指向替代构建产物时才需要 `-tools` / `-kernel`；直接后台启动 `carina-daemon` 主要用于旧版或特殊打包布局。

## 数据布局

| 类型 | 内容 |
| --- | --- |
| Config | profile、MCP server、BYOK provider credentials |
| State | session、审计段、补丁和 memory |
| Socket | 默认 `~/.carina/daemon.sock` |
| Logs | daemon 诊断日志 |

实际路径以 `carina doctor` 和当前 release notes 的输出为准。

## Reasoner

- 只有存在已启用且可运行的 provider 时，运行时才会自动选择 `model-router`。
- model-router / BYOK 可通过 `CARINA_REASONER_MODEL` 固定模型。
- 外部兼容后端必须显式设置 `CARINA_REASONER_BACKEND=claude-cli` 或 `CARINA_REASONER_BACKEND=codex-cli`。

## 可选 Gateway

网络 listener 默认关闭。只有准备好签名密钥和显式 bind 时才开启 WebSocket / HTTP Gateway，完整约束见 [Runtime API](/zh-cn/api/overview/)。

## 更新后检查

```bash frame="none"
carina version
carina doctor
```

  包名和安装 URL 跟随开源 release channel。每次升级后运行 `carina doctor`，确认 daemon、kernel、toolchain 与配置一致。

## 权威来源

- Daemon 生命周期：`carina daemon start|status|stop|logs` · `carina doctor`
- 打包：`docs/release.md`
- 相关：[安装](/zh-cn/getting-started/installation/) · [CLI 参考](/zh-cn/reference/cli/) · [API 概览](/zh-cn/api/overview/)

## 下一步

- [快速上手](/zh-cn/getting-started/quickstart/) — 首条受治理会话
- [Workers](/zh-cn/deployment/workers/) — 单机不够时
- [FAQ](/zh-cn/deployment/faq/) — 产品边界

---
Source: https://carina.nebutra.com/zh-cn/deployment/local/
Markdown: https://carina.nebutra.com/zh-cn/deployment/local/index.md
