Content updated: 2026-06-09Deploy the OpenClaw AI gateway on Linux or macOS using a one-click script, with Crazyrouter as the default backend. The installer will write a directly runnable
~/.openclaw/openclaw.json, register a system service, and pre-configure a set of models suitable for chatting, coding, and long-context tasks.
Overview
OpenClaw is suitable for turning Crazyrouter into your own controllable local AI access point:- Local WebUI/gateway, listening by default on
18789 - Can directly reuse Crazyrouter’s models and quota
- Supports Telegram and pre-enables plugin entries for DingTalk, WeCom, QQ Bot, Discord, Slack, and Feishu
- Suitable for personal always-on bots, team internal assistants, home servers, or lightweight self-hosted scenarios
Who is it for
- Those who want to connect Crazyrouter to a local AI gateway with a single command
- Those who want to run a Telegram Bot on their own server
- Those who want to manage chat, WebUI, and IM entries centrally
- Those who want to deploy a resident assistant on a dev machine or small home host
Usage Agreement
Recommended agreement:OpenAI-compatible API
- The installer by default points the
crazyrouterprovider tohttps://api.crazyrouter.com/v1 - It will also write
crazyrouter-claudeandcrazyrouter-minimaxproviders, making it easy to switch to the Anthropic Messages compatible path - OpenClaw itself exposes the local gateway and WebUI; authentication relies on the
gateway.auth.tokengenerated during installation
If you need to manually adjust the OpenClaw provider address later, first refer to API Endpoint documentation to confirm whether the current client should fill in the root domain or
/v1.Prerequisites
5-Minute Quick Start
1
Create a dedicated Crazyrouter token
In Crazyrouter’s backend, create a
sk-... token dedicated for OpenClaw. It is recommended to only open up the models you plan to use in the gateway, such as claude-opus-4-8, gpt-5.5, gemini-3.1-pro.2
Run the installation script
3
Note down the 3 values output by the installer
- WebUI address:
http://<server IP>:18789 - Auto-login address:
http://<server IP>:18789?token=<gateway_token> - Config file:
~/.openclaw/openclaw.json
4
Open the WebUI for the initial verification
Visit the auto-login address with your browser, make sure you can access the OpenClaw console, and send a test message using the default model
claude-opus-4-8, for example “Just reply ok”.5
Complete the Telegram pairing if needed
The installer will ask if you want to immediately configure Telegram. If you choose to set up now, after entering the Bot Token, send your bot any message to complete the first owner pairing.
Recommended Model Configurations
The installer defaults the main model toclaude-opus-4-8. If you want to change the everyday default model, just modify ~/.openclaw/openclaw.json’s agents.defaults.model.primary directly.
Example: Change the default model to
gpt-5.5
Token Best Practices
First Successful Checklist
- Browser can open
http://<server IP>:18789?token=<gateway_token> - OpenClaw WebUI can enter normally, does not repeatedly ask for login
- The default model can return the first message successfully
- After changing the model, the service can still respond normally after restart
-
journalctl --user -u openclaw -fortail -f ~/.openclaw/openclaw.logcan see successful requests - If Telegram is enabled, messages sent to the bot can receive replies
-
~/.openclaw/openclaw.jsonbackup has been saved
Key Files and Configuration Items
File Locations
Most Frequently Modified Config Items
IM Integration
Telegram
This is the most fully supported channel by the installer, it is recommended to start with Telegram:- Search
@BotFatheron Telegram - Send
/newbotto create a bot, and get the Bot Token - When the installer asks
Set up Telegram Bot now?, selectY - Paste the Bot Token, the installer will write it into
~/.openclaw/openclaw.json - After the installer automatically restarts the gateway, send any message to the bot
- The first person to send a message will be automatically paired as the owner
- If automatic pairing fails, execute:
Other IM Platforms
The installer pre-enables these plugin entries:dingtalkopenclaw-wecomqqbotdiscordslackfeishu
channels.<name> config yourself. The recommended workflow is:
- First, create a bot or app on the relevant platform
- Write the platform credentials into
~/.openclaw/openclaw.json - Make sure the corresponding
plugins.entries.<name>.enabledistrue - Restart the OpenClaw service
- Check the logs to verify if the channel was successfully loaded
If you are preparing to connect OpenClaw to team IM, it is strongly recommended to create a separate Crazyrouter token for the team bot, and set a stricter model whitelist and quota.
Service Management and Logs
- Linux (systemd)
- macOS (launchd)
loginctl enable-linger $(whoami), so that even if you exit SSH, user-level services outside the session can continue to run.Performance and Cost Recommendations
- Use
claude-opus-4-8by default first, then refine model separation after confirming the whole workflow - For high-frequency daily Q&A or bot notifications, switch back for cost to
claude-opus-4-8orgemini-3.1-pro - Use
gpt-5.5separately for coding workflows - In teams, assign Telegram / enterprise IM / WebUI different tokens for cost accounting and risk isolation
- Keep only necessary plugins and models to reduce cost from misuse
Upgrade Guide
The most reliable way to upgrade is to rerun the installer, as it will update the OpenClaw package, patches, and service scripts together.1
Back up the current configuration
2
Execute the installation script again
3
Check if custom configuration needs to be restored
If you have manually added any channels other than Telegram or changed the default model, re-compare
openclaw.json to make sure these custom settings are still present.4
Restart and verify
Reopen the WebUI and confirm that the model, logs, and connected IM channels are working properly.
npm install -g openclaw@latest first, then restart the service; but this method will not re-apply patches and script updates from the installer.
Uninstallation Guide
- Linux
- macOS
Common Errors and Fixes
FAQ
Which address should be used as the Crazyrouter backend?
Just keep the value set by the installer by default: OpenAI compatible provider useshttps://api.crazyrouter.com/v1, Claude / MiniMax natively compatible providers use https://api.crazyrouter.com.
Which default model should I keep?
In most cases, keepclaude-opus-4-8 first. If you mainly use OpenClaw as a code assistant, then switch to gpt-5.5.
Why can’t I see the model I want to use in the model list?
Usually because your Crazyrouter token hasn’t allowed that model, or you changed to a wrong provider prefix.Why do private Telegram chats work but group chats don’t?
The installer sets the default Telegram group policy toallowlist. You need to further adjust the Telegram channel configuration according to your usage needs.
How do I open OpenClaw to the public most safely?
At a minimum, do three things: restrict source access, protectgateway.auth.token, and use a separate Crazyrouter token for OpenClaw. If exposing directly to the public internet, it’s recommended to add a reverse proxy and extra access control.
View the installation script repository
Check the installation script, submit issues, or manually review the one-click installation logic.