Buiding Your Own Chatbot in Feishu with Openclaw-lite

🚀 Quick Start

1. SSH Connection to Container

Use the following command to connect to your OpenClaw container:

ssh user@<container-address> -p <port> -i <private-key-path>

🎯 First-Time Setup

Step 1: Run Initial Configuration

After connecting to the container, first-time users need to run the configuration wizard:

openclaw onboard

Key Options During Configuration:

  1. Security Warning - Read and select Yes to continue

  2. Configuration Mode - Select QuickStart (for quick setup)

  3. Model Provider - Choose your AI model provider (e.g., Qwen)

  4. Authentication Method - Complete OAuth authentication as prompted

  5. Channel Configuration - First-time users can select

  6. Skills Configuration - Recommended to select Yes to configure skills

  7. Dependency Installation - Can select Skip for now (install as needed)

Important Information to Record:

After configuration is complete, the system will display:

  • Web UI Address: http://127.0.0.1:18789/

  • Access Token: http://127.0.0.1:18789/#token=<your-token>

⚠️ Please save this Token securely! It's your credential for accessing the Web interface.


Step 2: Run Health Check

After initialization, it's recommended to run a health check:

If issues are detected that need fixing, run:


▶️ Starting Services

Start OpenClaw Gateway

Run in the container:

Signs of Successful Startup:

⚠️ Important Notes:

  • Do not close this SSH session after startup; the gateway needs to keep running

  • For background execution, press Ctrl+C to exit


🌐 Accessing Web Interface

1. Open a new terminal window and execute the SSH command with port forwarding:

Example:

2. Open your browser and visit:

🔧 Common Commands

Basic Commands

COMMAND

DESCRIPTION

openclaw onboard

Initial configuration wizard

openclaw gateway

Start gateway service (foreground)

openclaw doctor

Health check

openclaw doctor --fix

Auto-fix issues

openclaw security audit

Security audit

openclaw security audit --fix

Auto-fix security issues

openclaw --help

View all available commands

Service Management

Configuration Management


🔍 Troubleshooting

Issue 1: Cannot Access Web Interface

Symptoms: Browser shows connection failed or ERR_CONNECTION_REFUSED

Solutions:

  1. Confirm gateway service is running:

  2. Verify SSH port forwarding is correct:

  3. Check firewall settings

Issue 2: Token Verification Failed

Symptoms: Web interface shows unauthorized: gateway token mismatch

Solutions:

  1. Retrieve Token again:

  2. Re-enter the correct Token in Web interface settings

Issue 3: Gateway Won't Start

Symptoms: Error when running openclaw gateway

Solutions:

  1. Run health check:

  2. Check port usage:

  3. Check logs:

Issue 4: UI Assets Missing

Symptoms: Message shows Control UI assets not found

Solutions:

UI assets are automatically built when the container starts. If you encounter issues:

  1. Manually build UI:

  2. Check build logs:


📚 Additional Resources

Official Documentation

Important Configuration File Locations

PATH

DESCRIPTION

~/.openclaw/openclaw.json

Main configuration file

~/.openclaw/credentials/

OAuth credentials directory

~/.openclaw/workspace/

Workspace directory

~/.openclaw/agents/main/sessions/

Session data

/tmp/openclaw/openclaw-*.log

Runtime logs

/workspace/clawbot.log

Container initialization logs

/opt/openclaw/

OpenClaw installation directory

Security Recommendations

  1. Run Security Audits Regularly:

  2. Protect Token Security:

    • Do not share Token in public places

    • Rotate Token regularly

  3. Configure Access Control:

    • Enable pairing mechanism

    • Set up allowlist

    • Enable mention gating

  4. Principle of Least Privilege:

    • Only enable necessary tools and skills

    • Use sandbox environment

    • Keep secrets files in locations inaccessible to agent


🦞Let's start building a Feishu bot with openclaw now!

1. Create the Application

  1. Log in and click Create Custom App.

  2. Fill in the App Name and Description.

  3. Upload an App Icon.

2. Obtain Credentials

  1. Navigate to the Credentials & Basic Info page.

  2. Copy the App ID (format: cli_xxx).

  3. Copy the App Secret (keep this secure and do not leak it!).

3. Configure Permissions

Navigate to the Permission Management page and import the following configuration:

4. Enable Bot Capabilities

  1. Go to App Capabilities > Bot.

  2. Toggle on Add Bot -> Enable.

  3. Configure the Bot Name.

5. Configure Event Subscription

  1. Navigate to the Event Subscription page.

  2. Select Receive events via persistent connection (WebSocket mode).


If you cannot connect in persistent connection mode for the first time,see this following tip:

circle-info

Local Setup: Create lark.py

Create a file named lark.py and paste the following code:

Run this script; once you see a successful ping, the connection is established.


6. Publish the Application

  1. Go to the Version Management & Release page.

  2. Create a version and fill in the details.

  3. Submit for Audit and Release.

  4. Wait for administrator approval (Custom apps for internal use are often approved automatically).

7. OpenClaw Backend Configuration

  1. Initialize configuration for Channels -> Feishu

  2. Start the Gateway service:

  3. Verify the connection:

Last updated

Was this helpful?