Deploying OpenClaw on Ubuntu and Configuring the API
发表于阅读次数:本文字数:8.2k阅读时长 ≈15 分钟
Overview
I hadn’t paid much attention to OpenClaw before, mainly because the API consumption is relatively high and costly. This time I received a free Unicom Coding Plan Pro along with a 2-core 4GB cloud server, so I decided to give it a try. This article first covers how to install OpenClaw on an Ubuntu cloud server. Usage guides and further details will be written when time permits.
OS: Ubuntu 22.04 Server
OpenClaw version: 2026.2.26
Cloud server: 2-core 4GB RAM
User: root
Installation
Install OpenClaw
I am using a cloud server with a clean OS — no software pre-installed. Installing OpenClaw is actually very simple. Run the following one-liner to install it:
1
curl -fsSL https://openclaw.ai/install.sh | bash
The installation script will automatically install Node, OpenClaw, and other dependencies. Select “Yes” for all prompts in the interface.
After installation, the Gateway will fail to start (don’t worry — once we complete the configuration below, we just need to restart the Gateway). At the end, the following information will appear on the screen:
1 2 3 4 5 6 7 8 9 10 11 12
🦞 OpenClaw 2026.2.26 (bc50708) — Your task has been queued; your dignity has been deprecated.
Dashboard URL: http://127.0.0.1:18789/#token=85xxxxxxxxxxxxd9c6b036328fe00d04fd3c98 Copy to clipboard unavailable. No GUI detected. Open from your computer: ssh -N -L 18789:127.0.0.1:18789 root@192.168.0.167 Then open: http://localhost:18789/ http://localhost:18789/#token=85xxxxxxxxxxxxd9c6b036328fe00d04fd3c98 Docs: https://docs.openclaw.ai/gateway/remote https://docs.openclaw.ai/web/control-ui
openclaw config set gateway.mode local openclaw gateway restart
If the console shows no failure messages, the Gateway has started successfully. After configuring the firewall, you can access the UI in your browser, for example: http://:18790/#token=85xxxxxxxxxxxxd9c6b036328fe00d04fd3c98
At this point the UI may still show some errors — proceed to the next step.
Configure OpenClaw
Once you can access the UI, it is still not usable yet — you need to modify the OpenClaw configuration file located in the /root/.openclaw directory.
Below I provide the complete configuration that you can use directly. Replace the token, allowedOrigins, apiKey, and other values with your own settings. I am using the free Unicom Coding Plan.