# 如何在 Docker 中运行 Titan

{% hint style="info" %}
我们的 GitHub 上的 [**Releases**](https://github.com/Titannet-dao/titan-node/releases) 部分是获取最新二进制发布版本和查看源代码的最佳位置。
{% endhint %}

### 步骤 1：下载镜像 <a href="#step-1-download-the-advanced-cli-executables" id="step-1-download-the-advanced-cli-executables"></a>

```
docker pull nezha123/titan-edge
```

### 步骤 2：创建自己的存储卷 <a href="#step-1-download-the-advanced-cli-executables" id="step-1-download-the-advanced-cli-executables"></a>

```
mkdir ~/.titanedge
```

*<mark style="color:red;">$storage 是您要配置的存储路径</mark>*

### 步骤3 ：运行

```
docker run --network=host -d -v ~/.titanedge:/root/.titanedge nezha123/titan-edge
```

### 步骤4 ：绑定您的👉[身份码](/titan-network-zhong-wen/hui-geng-si-ce-shi-wang/huygens-testnet/an-zhuang-cheng-xu-zhuan-qu/bang-ding-shen-fen-ma.md)👈

```
docker run --rm -it -v ~/.titanedge:/root/.titanedge nezha123/titan-edge bind --hash=your-hash-here https://api-test1.container1.titannet.io/api/v2/device/binding
```

## Docker教程：在使用公网IP的机器上运行Docker时的NAT类型影响及处理方法

#### 影响说明：&#x20;

在使用具有公网IP的机器上运行Docker时，NAT类型可能会显示为Nonat。这种情况可能会影响运行多个Docker实例的能力。为了应对这一问题，您可以采取以下措施：

#### 处理方法：

1. **移除网络宿主模式：**

   默认情况下，使用 --network=host 可以使容器直接使用宿主机的网络，但这会使NAT表现为Nonat。您可以通过删除该参数来避免此问题，使NAT类型恢复到之前的状态。 <br>
2. **修改端口配置：**

   如果需要继续使用公网IP，您还可以选择手动将默认端口 1234 更改为其他端口，以适应您的具体网络环境。

#### 注意事项：

* 确保在运行上述命令前，已经按照需求修改了相关网络设置或端口配置。
* 测试配置更改后，验证Docker容器的行为是否符合预期。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://help.titanapp.info/titan-network-zhong-wen/he-xie-er-ce-shi-wang/guan-yu-he-xie-er-ce-shi-wang/yun-xing-jie-dian-zhuan-qu/ru-he-zai-docker-zhong-yun-xing-titan.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
