How to connect WhatsApp to OpenClaw on your own server
By the serverserv team · 6 min read · Updated
Install the WhatsApp plugin, set who may message the agent, scan a QR code from WhatsApp's "Linked devices" screen, then start the gateway. It takes about 10 minutes on a server that already runs OpenClaw.
Before you start
- A server running OpenClaw. serverserv OpenClaw Hosting arrives ready.
- A phone with WhatsApp. OpenClaw recommends a separate, dedicated number for the agent rather than your personal one.
- A way to see the QR code live on screen. QR codes can expire if you send them as a screenshot.
Step 1: Install the WhatsApp plugin
openclaw plugins install @openclaw/whatsapp
Step 2: Decide who can message your agent
In your OpenClaw config, keep strangers out until you approve them:
{
channels: {
whatsapp: {
dmPolicy: "pairing",
allowFrom: ["+14165550100"],
groupPolicy: "allowlist",
groupAllowFrom: ["+14165550100"],
},
},
}
pairing means an unknown sender must be approved before the agent answers them. Replace the example number with your own.
Step 3: Link WhatsApp with a QR code
openclaw channels login --channel whatsapp
On your phone, open WhatsApp → Settings → Linked devices → Link a device, and scan the code.
Step 4: Start the gateway
openclaw gateway
If you set OpenClaw up as a service, it is already running.
Step 5: Approve the first message
openclaw pairing list whatsapp
openclaw pairing approve whatsapp <CODE>
Requests expire after 1 hour, and each account can hold 3 pending requests at once.
Good to know
- OpenClaw connects through WhatsApp Web as a linked device, so keep the phone online now and then and do not log the device out.
- Use a dedicated number for customer-facing agents, and follow WhatsApp's own business rules.
Want this done for you? Our WhatsApp AI agent setup includes the server, the connection and your business details.
Prefer Telegram? Follow our OpenClaw Telegram or Discord setup guide. It takes about 10 minutes and the same agent can answer on both apps.
Questions
Do I need the WhatsApp Business API?
No. OpenClaw links to WhatsApp as a linked device, the same way WhatsApp Web does.
Can I use my personal WhatsApp number?
You can, but OpenClaw recommends a separate, dedicated number for the agent.
Why does my QR code not work?
QR codes expire quickly. Scan the code live from the screen rather than from a screenshot, and run the login command again if it times out.
Sources
Related
WhatsApp AI Agent
An agent on your own server that answers customers on WhatsApp 24/7.
Done for youExplore →AI Booking Agent
Customers book, move and cancel appointments by chat.
Done for youExplore →How to Secure a Self-Hosted n8n Server
9 steps: HTTPS, owner account, firewall, SSH keys, webhook auth, updates and backups.
6 min readExplore →Skip the setup
OpenClaw Hosting arrives installed and secured on your own server.
See OpenClaw plansGet it done for you