In short
On a server with OpenClaw preinstalled, setup takes three steps: connect over SSH and run the openclaw onboard wizard to set your model provider and API key, add the Telegram channel with the token from BotFather, then approve the pairing code from your first message with openclaw pairing approve. WhatsApp is added as a linked device by scanning a QR code.
In this guide
- What You Need Before You Start
- Step 1: Connect to the Server and Verify the Install
- Step 2: Onboarding Wizard and Model API Key
- Step 3: Create a Telegram Bot
- Step 4: Connect the Telegram Channel to OpenClaw
- Step 5: First Message and Pairing Approval
- Step 6 (Optional): Connect WhatsApp
- Step 7: Personalize the Assistant
- Secure Access to the Control Panel
- Common Problems
- After Setup: Keep It Updated and Backed Up
- Next Step: Skip the Install and Go Straight to Configuration
If the software is already installed, setting up OpenClaw is really a configuration job: you tell the assistant which AI model to use, connect a messaging channel, and decide who can talk to it. This guide starts from a Linux server with OpenClaw preinstalled; you'll add a model API key, connect a Telegram bot, optionally pair WhatsApp, and send your first message. If you don't know what OpenClaw is yet, read What is OpenClaw? first.
What You Need Before You Start
- Server access: The server's IP address and root (or sudo) user credentials. For the SSH connection, see the guide to connecting to a server over SSH.
- Model access: An API key from the provider you'll use (for example, Anthropic or OpenAI). Create the key in the provider's console and set a spending limit.
- A Telegram account: Telegram on your phone or computer to create the bot.
- (Optional) A separate number for WhatsApp: Using a second number is recommended instead of linking the assistant to your personal number.
Step 1: Connect to the Server and Verify the Install
Connect to the server from a terminal (PowerShell or Windows Terminal on Windows), replacing the placeholder with your server's IP:
ssh root@SUNUCU_IP
Check that OpenClaw and Node.js are installed:
node --version
openclaw --version
openclaw doctor
The openclaw doctor command lists missing configuration and known issues. On a fresh install, warnings are normal because no model or channel is defined yet. Command names and options can change between versions; whenever you're unsure, use the openclaw --help output as your reference.
Step 2: Onboarding Wizard and Model API Key
OpenClaw's interactive setup wizard configures the model, workspace and Gateway in one pass:
openclaw onboard --install-daemon
The wizard asks for the following, in order:
- Model provider: Choose your provider and paste your API key when prompted. The key isn't echoed to the screen; that's normal.
- Default model: Pick one of the provider's models. For everyday assistant tasks, a mid-tier model usually strikes a good balance of cost and speed.
- Gateway settings: Accept having the Gateway listen only on the local address (loopback) and generating an access token. This keeps the control interface off the internet.
- Channels: You can add Telegram inside the wizard too; this guide covers it separately in the next step.
The --install-daemon option registers the Gateway as a system service, so the assistant starts automatically when the server reboots. Check its status with:
openclaw gateway status
The configuration lives in the ~/.openclaw/ folder in the running user's home directory; the main file is ~/.openclaw/openclaw.json. Don't keep API keys anywhere outside this folder, such as in a document.
Step 3: Create a Telegram Bot
- Open @BotFather in Telegram and type
/newbot. - Give the bot a display name, then a unique username ending in
bot(for example,firmam_asistan_bot). - BotFather gives you a bot token in the format
123456789:AA.... This token is the bot's password; never share it. - Optional: use
/setprivacyto leave group privacy mode on; the bot then only sees messages addressed to it in groups.
Step 4: Connect the Telegram Channel to OpenClaw
Add the token to the configuration file. Open ~/.openclaw/openclaw.json (nano ~/.openclaw/openclaw.json) and add Telegram to the channels section:
{
"channels": {
"telegram": {
"enabled": true,
"botToken": "123456789:AA-BURAYA-TOKEN",
"dmPolicy": "pairing"
}
}
}
If the file already has other fields, add only the telegram block to the existing channels object; don't replace the whole file. Setting dmPolicy to pairing means anyone messaging your bot for the first time has to wait for your approval. Restart the Gateway to apply the change:
openclaw gateway restart
openclaw logs --follow
In the logs, you should see a line showing that the Telegram channel started successfully. If the token is wrong, you'll get an authorization error here.
Step 5: First Message and Pairing Approval
- Find your bot in Telegram and tap Start or send any message.
- The bot sends you a short pairing code and waits for approval.
- On the server, list pending requests and approve the code (replace KOD with the code you received):
openclaw pairing list telegram openclaw pairing approve telegram KOD - Message your bot again. This time the message goes to the model and you get a reply.
For an assistant only you will use, a fixed allowlist is stricter than pairing. Once you know your Telegram user ID (a numeric ID), you can change the configuration like this:
"telegram": {
"enabled": true,
"botToken": "123456789:AA-BURAYA-TOKEN",
"dmPolicy": "allowlist",
"allowFrom": ["111222333"]
}
With this setting, messages from anyone not on the list are never processed. We cover allowlists and other hardening settings in detail in the OpenClaw security guide.
Step 6 (Optional): Connect WhatsApp
The WhatsApp channel doesn't use a bot token; it works through linked device pairing, just like WhatsApp Web:
- Add the WhatsApp channel to the configuration and enter the allowed number in international format:
"whatsapp": { "dmPolicy": "allowlist", "allowFrom": ["+905XXXXXXXXX"] } - Start pairing:
openclaw channels login. A QR code appears in the terminal. - Open WhatsApp on the phone you've set aside for the assistant, go to Settings > Linked Devices > Link a Device, and scan the QR code.
- Restart the Gateway with
openclaw gateway restartand send a message from your allowed number.
If the phone stays offline for a long time, WhatsApp may end the linked device session; if that happens, just repeat the QR pairing.
Step 7: Personalize the Assistant
Once the channel works, shape the assistant's behavior to fit your needs. A few practical tips:
- Language and tone: Tell the assistant which language to reply in and to keep answers short and clear, either in your first messages or in the persistent instruction files in the workspace. That way you don't have to repeat it in every conversation.
- Time zone: Set the server's time zone so reminders and scheduled tasks run at the right time, for example:
timedatectl set-timezone Europe/Istanbul - Tool permissions: Keep powerful tools such as command execution and file writing off for the first few days; enable the permissions you need one by one as you get to know the assistant's behavior.
- Cost tracking: Check the model provider's usage dashboard daily during the first week. Long chat histories and the browser tool drive up token usage; if needed, choose a cheaper default model.
Secure Access to the Control Panel
By default, the Gateway's web control interface is reachable only from the server itself, on default port 18789. Instead of opening that port in the firewall, create an SSH tunnel from your own computer:
ssh -N -L 18789:127.0.0.1:18789 root@SUNUCU_IP
While the tunnel is open, go to http://127.0.0.1:18789 in your browser and sign in with the Gateway token generated during onboarding.
Common Problems
| Symptom | Likely cause | Fix |
|---|---|---|
| The bot never replies | The Gateway isn't running or the token is wrong | Check the output of openclaw gateway status and openclaw logs --follow |
| The bot only sends a pairing code | The sender hasn't been approved yet | openclaw pairing approve telegram KOD |
| Model error, 401, or quota warning | Wrong API key, or balance/limit used up | Check the key and limit in the provider's console, then set it again with the wizard |
| The Gateway won't start due to a JSON error | Missing comma or quote in the configuration file | Fix the file, then run openclaw doctor |
After Setup: Keep It Updated and Backed Up
OpenClaw is a fast-moving project, so new versions ship often. Read the release notes before updating, then take a copy of the ~/.openclaw folder:
tar czf /root/openclaw-yedek-$(date +%F).tar.gz -C ~ .openclaw
chmod 600 /root/openclaw-yedek-*.tar.gz
This archive contains your API keys and bot tokens; if you move it off the server, store it somewhere encrypted. After updating, confirm everything is in place with openclaw doctor and openclaw gateway status, then send a short test message from Telegram. In versions that change configuration fields, the doctor command usually tells you what needs updating.
Next Step: Skip the Install and Go Straight to Configuration
On a server with OpenClaw preinstalled, every step in this guide takes about fifteen minutes. Sunucu Atlas OpenClaw server plans are delivered with OpenClaw preinstalled, Node.js 24 and the UFW firewall enabled, so you don't have to install Node.js, define a service or configure a firewall from scratch. For personal use and a single Telegram channel, SA-OPENCLAW-1 (2 CPU, 4 GB RAM, 40 GB NVMe) is a solid start; if you'll run WhatsApp and Telegram together and turn on the browser tool, SA-OPENCLAW-2 gives you more RAM headroom. With root access, the entire configuration is under your control, and if you get stuck, you can open a support ticket.
Frequently asked questions
Which Node.js version does OpenClaw require?
OpenClaw needs a current Node.js LTS release; older versions cause install or runtime errors. You can check the version on your server with node --version.
How do I change the API key in OpenClaw later?
Run the openclaw onboard wizard again and enter the new key at the model provider step. After the change, restart the Gateway with openclaw gateway restart.
Why does my Telegram bot reply with a pairing code?
If dmPolicy is set to pairing, every first-time user has to wait for approval. Once you approve the code on the server with openclaw pairing approve telegram KOD, the bot starts replying normally.
Should I connect OpenClaw to my personal WhatsApp number?
Preferably not. As a linked device, the assistant can access that number's messages; a separate number protects your privacy and lowers the risk of auto-replying to the wrong person.
How do I access the Gateway control panel?
By default, the panel listens only on the server's local address, on port 18789. From your own computer, open a tunnel with ssh -N -L 18789:127.0.0.1:18789 and then go to 127.0.0.1:18789 in your browser.