Sign inSign up

osins/openclaw

By osins

Updated 7 months ago

OpenClaw: AI gateway supporting Qwen, Gemini, Claude with Docker deployment.

Image
Machine learning & AI
0

1.4K

osins/openclaw repository overview

AI Agent Service

This is an AI agent service based on OpenClaw, integrating multiple AI tools and models, supporting unified management through a gateway.

Features

  • AI agent gateway based on OpenClaw framework
  • Support for multiple AI models (Qwen Coder, Vision, etc.)
  • Integrated Telegram bot channel
  • Proxy server support
  • Full Docker containerized deployment

System Architecture

  • Base Image: Debian 12-slim
  • Python: 3.10.x
  • Node.js: 22.x
  • Go: 1.21.x
  • AI Tools: Qwen Coder CLI, OpenClaw, Gemini CLI, Claude CLI
  • Containerization: Docker + Docker Compose

Deployment Instructions

Prerequisites
  • Docker
  • Docker Compose (v2.0+)
  • Proxy server (optional): proxy-server:port
Deployment Steps
  1. Clone the project locally
  2. Ensure the data directory structure is complete:
    data/
    ├── openclaw/
    ├── .qwen/
    ├── .gemini/
    └── workspace/
    
  3. Modify the tokens in configuration files (if needed)
  4. Execute the following command to start the service:
    docker compose up -d
    
Configuration Notes
Proxy Server Configuration

Proxy server configured in docker-compose.yml:

environment:
  - HTTP_PROXY=http://proxy-server:port
  - HTTPS_PROXY=http://proxy-server:port
  - http_proxy=http://proxy-server:port
  - https_proxy=http://proxy-server:port

Complete docker-compose.yml example:

services:
  agent:
    build:
      context: .
      dockerfile: Dockerfile
      args:
        - HTTP_PROXY=http://proxy-server:port
        - HTTPS_PROXY=http://proxy-server:port
        - http_proxy=http://proxy-server:port
        - https_proxy=http://proxy-server:port
    container_name: agent
    ports:
      - "18789:18789"
    volumes:
      - ./data/openclaw:/home/agent/.openclaw
      - ./data/.qwen:/home/agent/.qwen
      - ./data/.gemini:/home/agent/.gemini
      - ./data/workspace:/home/agent/workspace
    environment:
      - NODE_ENV=production
      - PYTHONPATH=/home/agent
      - TZ=Asia/Shanghai
      - HTTP_PROXY=http://proxy-server:port
      - HTTPS_PROXY=http://proxy-server:port
      - http_proxy=http://proxy-server:port
      - https_proxy=http://proxy-server:port
      - OPENCLAW_GATEWAY_TOKEN=your_gateway_token_here
    command: ["openclaw","gateway","run", "--verbose"]
    networks:
      - ai-agent-network
    restart: unless-stopped
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:18789/"]
      interval: 30s
      timeout: 10s
      retries: 3
      start_period: 40s

volumes:
  agent-data:
    driver: local

networks:
  ai-agent-network:
    driver: bridge
Gateway Authentication Configuration

Set the same gateway token in the following two configuration files:

  • data/openclaw/config.yaml
  • data/openclaw/openclaw.json

It is critical that the tokens in both files match exactly. If the tokens are inconsistent, the OpenClaw gateway will fail to start properly and you will encounter "gateway token mismatch" errors, preventing proper communication between gateway components. This mismatch will cause the service to be unavailable.

Service Ports
  • Main Service Port: 18789
Environment Variables
  • NODE_ENV: Runtime environment (production)
  • PYTHONPATH: Python module search path
  • TZ: Timezone setting (Asia/Shanghai)
  • OPENCLAW_GATEWAY_TOKEN: Gateway authentication token - This is critical for securing your OpenClaw gateway. Without this token, unauthorized clients could connect to your gateway. If not set correctly, you may encounter "gateway token mismatch" errors, preventing proper communication between gateway components.

Usage Instructions

Accessing the Service
Check Status

Enter the container to check service status:

docker compose exec agent openclaw status
View Logs

View service logs:

docker compose logs -f

Troubleshooting

Common Issues
  1. Gateway Token Mismatch Error

    • Ensure gateway.auth.token and gateway.remote.token in both config.yaml and openclaw.json are set to the same value
  2. Proxy Connection Issues

    • Check if proxy server address and port are correct
    • Confirm that the proxy server is running properly
  3. Permission Issues

    • Check permissions of /home/agent/.openclaw directory
    • If needed, run chmod 700 /home/agent/.openclaw
Restart Service
docker compose down && docker compose up -d

Security Considerations

  • Configuration files may contain sensitive information, please keep them secure
  • Regularly update gateway authentication tokens
  • Limit access permissions to the service
  • Keep systems and components updated to the latest versions

Maintenance

Updates

Regularly check and update OpenClaw version:

openclaw update
Backups

Regularly backup the data directory to preserve configurations and data.

Telegram Channel Configuration

The service includes integrated support for Telegram bot communication. To configure Telegram integration:

  1. Create a new bot with @BotFather on Telegram
  2. Obtain the bot token from BotFather
  3. Update the data/openclaw/openclaw.json file with your bot token:
    {
      "channels": {
        "telegram": {
          "enabled": true,
          "dmPolicy": "pairing",
          "botToken": "YOUR_BOT_TOKEN_HERE",
          "groupPolicy": "allowlist",
          "streamMode": "partial",
          "proxy": "http://proxy-server:port"
        }
      }
    }
    
  4. Alternatively, you can configure the Telegram bot token using OpenClaw CLI:
    openclaw config set channels.telegram.botToken YOUR_BOT_TOKEN_HERE
    
  5. Restart the service after making changes to the configuration

Note: The bot token in the default configuration is a placeholder. Replace it with your actual bot token for Telegram functionality to work properly.

Tag summary

Content type

Image

Digest

sha256:99ab4ca5e

Size

1.8 GB

Last updated

7 months ago

docker pull osins/openclaw