Step-by-Step Guide to Deploying OpenClaw

2026年1月31日 6180点热度 0人点赞 2条评论
内容目录

Quick Configuration of OpenClaw

After purchasing a server, environment setup is the first step in using OpenClaw. Because OpenClaw depends on multiple languages such as NodeJS, Swift, Kotlin, and related dependency libraries, manual configuration is cumbersome and prone to version compatibility issues. Therefore, it is recommended to use the Tencent Cloud application template first — this template already includes the full runtime environment and the OpenClaw core program, allowing you to skip dependency installation and significantly improve configuration efficiency.

Note that even if the system installation is completed through the application template, OpenClaw cannot be used directly. All subsequent configuration must be completed through the terminal command line. Only after finishing the configuration can you start using OpenClaw.

Therefore, be sure to follow the steps below carefully to avoid configuration failure caused by missed operations.

When reinstalling using the template, please use OpenClaw. Moltbot does not support Feishu.

386c6ae2-ea4c-4744-a458-23dede64b906

In the server management interface, find the login button to enter the command terminal, or open port 22 and log in using your own shell.

image-20260130092528011

Next, run the command to start the configuration wizard and follow the prompts step by step.

openclaw onboard

Tip: If settings were not saved during configuration or you need to modify existing configuration items, you can run the openclaw configure command to re-enter the configuration interface.

◆ I understand this is powerful and inherently risky. Continue?

Operation instruction: Use the left and right arrow keys to switch between Yes/No options. Selecting Yes indicates that you understand the permission-related risks of OpenClaw and agree to continue the configuration.

image-20260131075334056

◆ Onboarding mode

When entering the Onboarding mode selection screen, first-time users are recommended to choose QuickStart mode. This mode focuses on “minimal configuration + fastest deployment,” skipping unnecessary configuration items and quickly completing the basic OpenClaw deployment.

image-20260131075708967

image-20260131075904753

◆Config handling

For the first configuration, Use existing values, Update, or Reset are all acceptable.

◆Model/auth provide

Configure the model you want to use. You can configure it directly here, or handle it later through the configuration file.

Since the author uses the domestic moonshot model, but the OpenClaw configuration defaults to international endpoints which may cause incorrect API addresses, the author selects Skip for now to skip LLM configuration for now and will configure the model separately later.

image-20260131080336392

image-20260131080515745

◆Default model

When entering the Default model selection screen, you can choose any model as a temporary placeholder. This configuration will later be overridden by modifying the configuration file and will not affect the final usage.

f447bbeb-2d85-48f6-a27a-e3a5642e50de

◆Select channel (QuickStart)

Configure the chat application you want to use. If using Feishu, fill in the parameters as required. You can also select Skip for now to skip it for now. The author will explain how to configure it in a separate section later.

ef846e73-46e5-46da-8ad6-a2ab45afb80d

◇ Skills status

Configure skills. You can select Yes and install some commonly used tools according to the prompts.

image-20260131080952529

When reaching the Install missing skill dependencies step, press the space key to select the skills you want to install by default. Multiple selections are allowed.

05a4d5f1-5d1f-448e-8349-485d41c9d473

Other configurations are not needed for now, so they can be ignored.

dd201379-0c16-41fd-b69f-06e819464a6a

Confirm and restart the service.

image-20260131081258104

◆ How do you want to hatch your bot?

Select Hatch in TUI to use it through the terminal. Later you can also configure the Web UI so that OpenClaw can be accessed through a web browser.

9f18898c-890e-45ff-8dfc-dce57d34c975

Finally, check the information output on the interface and save this information.

b251944b-9073-4bcb-959f-367c31984cef

Accessing OpenClaw via Public Network

You do not necessarily need to expose it to the public internet. If you do not need Telegram integration or public WebUI access, you can skip this section.

If you have a domain name, it is recommended to bind the domain rather than exposing OpenClaw to the public internet through port mapping.

WebSocket

The WebSocket solution requires directly exposing the Gateway port, which is less secure and is only recommended for temporary testing.

If we need to connect social apps to the server, this step is required. If you are only configuring Feishu, you do not need to do this.

If you have a domain name for reverse proxy, exposing the WebSocket through a port is still not recommended.

Its architecture logic is as follows:

Message Channels (WhatsApp/Telegram/Discord/iMessage)  
        │  
        ▼  
┌───────────────────────────┐  
│          Gateway          │  ws://127.0.0.1:18789  
│     (Single Control Plane)│  
└───────────┬───────────────┘  
              │  
              ├─ Pi agent (RPC)  
              ├─ CLI (clawdbot …)  
              ├─ Chat UI (SwiftUI)  
              └─ Other clients  

Run the command to continue configuring OpenClaw.

openclaw configure

◆ Where will the Gateway run?

Select ◆ Where will the Gateway run? so that your OpenClaw running on the server can be accessed externally.

Next, note that the address shown under Gateway WebSocket URL can be modified. Find the public IP of your Tencent Cloud server and replace 127.0.0.1 with it.

3248ac61-7cdc-4ebd-af79-f9176d3d0b6d

◆ Gateway auth

Select Token, meaning a credential is required to access OpenClaw.

image-20260131082124288

◆ Gateway token

Equivalent to entering a password. This password will be required to access OpenClaw later.

Stop and start using the insecure mode with --allow-unconfigured.

openclaw gateway stop
openclaw gateway --allow-unconfigured

Web UI

Change mode to remote and bind to lan in ~/.openclaw/openclaw.json, then restart OpenClaw.

Check the token:

cat ~/.openclaw/openclaw.json

630df128-917e-4751-8ad6-5fa47f16c2a7

When accessing through the public network, append &token=xxx to the URL.

22d60d46-bade-4bc3-9332-5942cde504d2

If accessing via the public network shows the pairing required error, it means the device needs authorization. Run the command to query the authorized terminal list:

openclaw devices list

3f8d2aad-3c14-4822-aa49-b848c4c53aff

Find the Pending list, copy the Request value, and configure authorization.

openclaw devices approve b8eb70dd...

The interface can now be accessed normally.

6dd4cca8-38d7-45f9-93e1-f4758f4b40c2

Configure Models

Here we use the moonshot model as an example and skip the CLI configuration method, showing how to configure a custom model in OpenClaw using the configuration file.

Go to https://platform.moonshot.cn/console/api-keys to create a new key, and visit https://platform.moonshot.cn/playground to view supported models.

ef99563e-fffd-4c8f-bbe4-c90c864fc0da

The Kimi Code model is also very powerful. You can get one to run coding tasks in the background. Purchase the coding model here: https://www.kimi.com/code

image-20260131100451955

Create a new key: https://www.kimi.com/code/console?from=kfc_overview_topbar

b030bb77-45eb-43e2-b8dc-81742667f569

Open ~/.openclaw/openclaw.json and replace or add the following model configuration:

Please replace ${MOONSHOT_API_KEY} and ${KIMICODE_API_KEY} with your own keys.

{
  "agents": {
    "defaults": {
      "model": {
        "primary": "moonshot/kimi-k2.5"
      },
      "maxConcurrent": 4,
      "subagents": {
        "maxConcurrent": 8
      },
      "workspace": "/root/.openclaw/workspace"
    }
  },
  "models": {
    "mode": "merge",
    "providers": {
      "moonshot": {
        "baseUrl": "https://api.moonshot.cn/v1",
        "apiKey": "${MOONSHOT_API_KEY}",
        "api": "openai-completions",
        "models": [
          {
            "id": "kimi-k2.5",
            "name": "Kimi K2.5"
          }
        ]
      },
      "kimi-code": {
        "baseUrl": "https://api.kimi.com/coding/v1",
        "apiKey": "${KIMICODE_API_KEY}",
        "api": "openai-completions",
        "models": [
          {
            "id": "kimi-for-coding",
            "name": "Kimi For Coding"
          }
        ]
      }
    }
  }
}

Connecting other models compatible with the OpenAI API works in a similar way.

Restart:

openclaw gateway stop
openclaw gateway start

Configure Feishu Integration

Open the Feishu application management console, add application capabilities, and select Bot.

image-20260131144706538

Configure permission management and enable the permissions for messages and groups.

image-20260131144812115

Configure events and callbacks, use long connections, and add message-related events.

625aff5d-48cd-4ee4-86a0-090d8d316eec

image-20260131144858161

Run the OpenClaw configuration command:

openclaw configure

Select Channels.

15490039-6f2a-42da-aedb-fcfa8415be54

image-20260131113353214

Fill in the Feishu App ID and secret as required. Then you can send messages to the bot in Feishu.

image-20260131145004834

痴者工良

高级程序员劝退师

文章评论