How to self-host a WhatsApp MCP server on a VPS
November 23, 2026 · 9 min read
Short answer
You need a Linux VPS with 1 GB of RAM or more, a domain pointing at it and Docker. Clone the repository, generate .env with scripts/init-env.sh, start everything with docker compose --profile https, scan the QR code from WhatsApp and add the /mcp URL to Claude as a custom connector.
Zenbox is free and open source. Run it on your own server and your messages stay with you, with no third party in the middle. This guide takes you from an empty VPS to asking Claude "who is waiting for me on WhatsApp?". If you can paste commands into a terminal, you can do it yourself; the longest wait is usually your DNS record reaching the server.
New to the idea of a connector? Start with what MCP is. Otherwise, here is the whole map:
- 1
Server and domain
A Linux VPS and a subdomain pointing at it.
- 2
Docker
The engine that runs everything in containers.
- 3
Configure
Clone the project and generate .env with your secrets.
- 4
Start
One command brings up WhatsApp, Zenbox and HTTPS.
- 5
Link and connect
Scan the QR code and add the connector in Claude.
What you are installing
Claude or ChatGPT
reach your domain over HTTPS
Caddy
automatic HTTPS certificate
Zenbox
MCP server, internal port 3000
WAHA (GOWS)
your WhatsApp, internal port 3001
Docker Compose starts three containers together. WAHA, an open-source WhatsApp HTTP API, keeps your WhatsApp session open, like a WhatsApp Web tab that never closes. Zenbox (the repository is called waha-mcp) turns that into tools your AI understands. Caddy puts HTTPS on your domain. The part that matters for security: WAHA and Zenbox only listen inside the server, on 127.0.0.1. The only public ports are 80 and 443.
1. Pick a VPS
Any Linux VPS with 1 GB of RAM or more works; Ubuntu 24.04 is a safe choice. You do not need a powerful machine: Zenbox keeps its data in SQLite inside Docker volumes, so there is no database server to run. ARM servers work too. A laptop is possible, with real limits:
| VPS (recommended) | Your laptop | |
|---|---|---|
| Works with claude.ai and ChatGPT | ✓ | ✕ |
| Works with Claude Code | ✓ | Only on that laptop |
| Needs a domain | ✓ | ✕ |
| Available 24/7 | ✓ | While it is on |
| Webhooks (edits, deletions, reactions) | ✓ | ✕ |
2. Point your domain
In your DNS provider, create an A record for a subdomain such as mcp.example.com with the VPS's public IP. Then check from the server that both match:
getent hosts mcp.example.com # must print the VPS's public IP
curl -fsS https://api.ipify.org # the VPS's public IP, to compareIf the VPS has a firewall, open ports 80 and 443 (with ufw: sudo ufw allow 80,443/tcp). Without them, Caddy cannot get a certificate.
3. Install Docker
You need Docker Engine with the Compose plugin, plus git and openssl. On Ubuntu, Docker's convenience script is the quick route; Docker's own documentation covers the other install methods.
curl -fsSL https://get.docker.com | sh
docker compose version # Compose v2 or later
git --version
openssl version4. Clone the project and generate .env
git clone https://github.com/stivenrosales/waha-mcp.git
cd waha-mcp
sh scripts/init-env.sh --domain mcp.example.com --username yournameThe script copies compose.env.example to .env and fills every secret with a random value. It prints no secret, writes the file with mode 600 and never overwrites an existing .env. It also picks the right WAHA image for your server's CPU.
Your login is the username you passed to --username, and your password is the ADMIN_PASSWORD line of .env. Right now, copy the MASTER_KEY line to your password manager: it encrypts your message cache, and without it that cache cannot be read. Your WhatsApp itself is not affected.
5. Start everything
docker compose --profile https up -d --build
docker compose psThe first start takes a few minutes because it builds the Zenbox image and pulls WAHA. Repeat docker compose ps until waha and waha-mcp show (healthy) and caddy is running. If waha-mcp keeps restarting, run docker compose logs --tail 30 waha-mcp: each line after Invalid configuration: names the variable to fix in .env.
6. Link your WhatsApp with the QR code
On your phone, open WhatsApp > Settings > Linked devices > Link a device. The simplest way to see the QR code is in the terminal:
docker compose logs -f wahaA QR code expires after a minute or so; fetch a new one if it does. Once you are linked, check the session and restart Zenbox once, so it records your account and sets up webhooks:
KEY="$(grep '^WAHA_API_KEY=' .env | cut -d= -f2-)"
curl -fsS -H "X-Api-Key: $KEY" http://127.0.0.1:3001/api/sessions/default
# "status": "WORKING" means you are linked
docker compose restart waha-mcpAn honest detail: as a linked device, Zenbox does not see your entire old history, only the recent messages WhatsApp hands it and everything that arrives from now on. If you download the QR as qr.png instead, delete the file once you are linked.
7. Check that it answers
curl -fsS http://127.0.0.1:3000/health # {"status":"ok"}
curl -fsS https://mcp.example.com/health # same answer, through HTTPS
docker compose logs waha-mcp | grep listeningThe startup line should say engine: GOWS and mode: single-owner. If it says engine: unknown (WAHA not reachable), wait until waha is healthy and restart waha-mcp.
8. Connect Claude
On claude.ai go to Customize > Connectors > Add custom connector, and use the URL https://mcp.example.com/mcp. The Free plan allows one custom connector. A Zenbox login page opens: sign in with your username and ADMIN_PASSWORD. In Claude Code it is one command:
claude mcp add --transport http waha https://mcp.example.com/mcp
# then, inside Claude Code: /mcp > waha > log inIt also works with ChatGPT and Gemini CLI. For each app's details, see how to connect WhatsApp to Claude. Then try it:
List my WhatsApp chats.
Before you call it done
Do this
- ✓Save MASTER_KEY and ADMIN_PASSWORD in your password manager
- ✓Delete qr.png if you downloaded it
- ✓Back up the volumes together with .env
- ✓Update with git pull and the same compose command
Avoid this
- ✕Committing .env to a repository
- ✕Exposing WAHA's port 3001 to the internet
- ✕Deleting volumes to “fix” an error
- ✕Using your number for bulk messaging
That last one matters. Zenbox connects as a linked device, like WhatsApp Web, not through the official API, and WhatsApp can ban numbers linked to unofficial apps, especially those used for bulk messaging. Use it for your own WhatsApp, as an assistant: it reads freely and sends only when you ask. Scheduled messages and missions need missions configured on the server, and voice note transcription is optional. Your cached messages are encrypted and deleted after 90 days by default. More in is it safe to connect WhatsApp to AI?, and if you are still comparing options, read what a WhatsApp MCP server is and how to choose one.
Rather not run a server?
We are preparing a hosted version, with no VPS or Docker. If that sounds better, join the waitlist at the end of this page: the first 100 get founder pricing.
Sources
FAQ
How much does it cost to self-host Zenbox?
Zenbox is free and open source under the MIT license. You only pay for the VPS and the domain, whose prices depend on the provider you choose.
Can I install it on my laptop instead of a VPS?
Yes, but then it only works with Claude Code on that same machine: claude.ai and ChatGPT cannot reach localhost. Webhooks are also off on a laptop, so edits, deletions and reactions made on your phone do not sync.
What happens if I lose MASTER_KEY?
The encrypted message cache on your server can no longer be read. Your WhatsApp account itself is not affected. Save the key in your password manager as soon as it is generated.
Does it run on an ARM VPS?
Yes. WAHA's GOWS image is different for amd64 and arm64, and scripts/init-env.sh picks the right one for your machine.
How do I update Zenbox?
In the project folder run git pull, then docker compose --profile https up -d --build. Your data volumes are kept.
Your WhatsApp, calm.
The hosted version opens soon. The first 100 get founder pricing.