Deploy OpenClaw AI Agent on Your Server and Connect It to Feishu

This guide walks you through preparing the environment, installing OpenClaw, configuring its onboarding, creating a Feishu custom app, setting up event subscriptions and permissions, and finally pairing the AI agent so it can respond to Feishu messages.

Model Perspective
Model Perspective
Model Perspective
Deploy OpenClaw AI Agent on Your Server and Connect It to Feishu

1. Prerequisites

Before starting, ensure you have the following:

Operating system: Linux or macOS (Windows support is incomplete).

Memory: at least 2 GB (4 GB recommended).

Node.js version 22.x or newer.

Network access to GitHub and npm (a proxy may be needed on Chinese servers).

AI model API key – either Qwen (DashScope) or Kimi K2.5 , with OpenAI/Claude/DeepSeek as alternatives.

A Feishu personal account (enterprise accounts provide full permissions).

2. Install Node.js via nvm

# For servers in China, use the Gitee mirror
curl -o- https://gitee.com/RubyMetric/nvm-cn/raw/main/install.sh | bash

# Reload environment variables
source ~/.bashrc

# Install Node.js 22
nvm install 22

# Verify installation
node -v   # should output v22.x.x

If you are on a non‑Chinese server, replace the first line with the official installer:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash

3. Install OpenClaw

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

The installer downloads dependencies automatically; the duration depends on network speed.

4. Common installation issue

If you encounter npm install failed; cleaning up and retrying..., it is usually due to insufficient memory. Create a 2 GB swap file:

# Create 2GB swap file
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

Then rerun the OpenClaw installation command.

5. Onboarding configuration (connect AI model)

After installation, OpenClaw launches an interactive onboarding process.

Step 1 – Security prompt: Choose Yes to acknowledge the risks.

Step 2 – Mode: Select QuickStart (you can configure details later with openclaw configure).

Step 3 – Model selection: For beginners, choose Qwen (OAuth). A URL will be shown; open it in a browser and authorize with your Alibaba Cloud account.

Step 4 – Skip other messaging platforms: Choose Skip for now for Telegram/Discord.

Step 5 – Start gateway: Choose Open the Web UI to launch http://localhost:3000.

6. Create a Feishu custom app

Visit open.feishu.cn/app and log in with your Feishu account.

Click “Create enterprise custom app”, give it a name (e.g., “My AI Assistant”), upload an avatar, and create.

In the left menu, select “Add app capability”, choose “Bot”, and click “Add”.

Navigate to “Credentials & Basic Info” and copy the App ID and App Secret for later use.

7. Configure Feishu event subscription (critical step)

Event subscription tells Feishu where to forward messages sent to the bot.

If your server has a public IP, use http://YOUR_IP:3000/webhooks/feishu as the request URL.

If you are on a local machine, set up a tunnel (e.g., Cloudflare Tunnel or ngrok http 3000) and use the generated HTTPS address.

Enter the request URL in the “Request URL” field.

Click “Validate” – the OpenClaw gateway must be running for the check to succeed.

Click “Add Event”, search for and add im.message.receive_v1 (receive message, required).

8. Grant required permissions

In the Feishu console, go to “Permission Management” → “Batch Import” and paste the following JSON:

[
  "im:message",
  "im:message.group_at_msg",
  "im:message.p2p_msg",
  "im:message:send_as_bot"
]

Confirm the import; the permissions are approved automatically for custom apps.

9. Configure the Feishu channel in OpenClaw

Run the following commands on the server (replace placeholders with your actual App ID and Secret):

# Add Feishu channel
openclaw channels add
# Choose "Feishu (Lark Open Platform)"
# Follow prompts to input App ID and App Secret

Or set the values directly:

openclaw config set channels.feishu.accounts.default.appId "cli_YourAppID"
openclaw config set channels.feishu.accounts.default.appSecret "YourAppSecret"
openclaw config set channels.feishu.accounts.default.enabled true

OpenClaw 2026.2+ already includes the Feishu plugin, so no extra openclaw plugins install is needed. If you run an older version, upgrade first: openclaw update Restart the gateway to apply the configuration:

openclaw gateway restart

10. Publish the Feishu app and pair

In the Feishu console, go to “App Publishing” → “Version Management & Release”, create a version (e.g., 1.0.0), save, and click “Apply for Release”. Choose “Only available within the team”.

Open Feishu, find the newly published bot, and send any message (e.g., “hello”). The bot replies with a pairing code such as 🦞 Pairing code: ABCD-1234.

Open the OpenClaw Web UI at http://localhost:3000, locate the pairing entry, enter the code, and confirm.

After successful pairing, the UI shows the Feishu channel status in green.

Test by sending a command in Feishu, e.g., “Write a Python quick‑sort”, and wait for the AI’s response.

11. Optional: Official Feishu plugin (advanced)

If you want the AI to act on your behalf (read/write documents, spreadsheets, calendars), install the official Feishu plugin (available from March 2026). It uses OAuth to grant the AI direct access. Note that the built‑in channel and the official plugin cannot be used simultaneously; install the plugin only after the basic flow works.

12. Frequently Asked Questions

Bot does not reply? Check that the gateway is running ( openclaw gateway status), the event subscription URL is reachable, and the App ID/Secret are correct. For tunnel users, ensure the ngrok process is still active.

Installation fails due to memory? Create swap as described earlier or use a cloud marketplace image that pre‑installs OpenClaw.

Can I connect both Feishu and Telegram? Yes, OpenClaw supports multiple channels concurrently.

How much does the AI API cost? Qwen offers generous free tokens for new users; Kimi K2.5 is pay‑as‑you‑go, typically a few dollars per month for light usage. OpenClaw itself is free.

Is it safe? Destructive actions (deleting files, sending messages) require explicit user confirmation. Deploy on an isolated server and consider sandbox or permission‑restriction modes.

13. Summary of the whole process

Install OpenClaw on a server and connect an AI model.

Create a Feishu custom app and obtain App ID & Secret.

Configure event subscription so Feishu forwards messages to OpenClaw.

Pair the bot, test, and you’re done.

For users comfortable with the command line, the entire setup can be completed in about 30 minutes. Typical stumbling blocks are inaccessible event URLs or insufficient memory, both of which are addressed in this guide.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

IntegrationFeishuNode.jsai-agenttutorialOpenClaw
Model Perspective
Written by

Model Perspective

Insights, knowledge, and enjoyment from a mathematical modeling researcher and educator. Hosted by Haihua Wang, a modeling instructor and author of "Clever Use of Chat for Mathematical Modeling", "Modeling: The Mathematics of Thinking", "Mathematical Modeling Practice: A Hands‑On Guide to Competitions", and co‑author of "Mathematical Modeling: Teaching Design and Cases".

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.