Contents
A WhatsApp bot for a store or service answers common questions, sends order status and hands the chat to a person when needed. The official route is Meta’s WhatsApp Business Platform, usually through the Cloud API, which Meta hosts itself. You don’t host WhatsApp; you host your part: a small web app that receives messages and decides how to reply.
How an official WhatsApp bot works
- A customer messages your business number.
- Meta sends the message as a POST request to your webhook URL.
- Your app handles it: looks up an order, asks an AI model through an API, or saves it for a staff member.
- Your app replies through the Cloud API with an HTTPS request carrying your access token.
What the bot needs
- A Meta setup: an app in Meta for Developers with the WhatsApp product, a business account, and a phone number dedicated to the business.
- App secrets: a permanent System User access token, the App secret, and a verify token you choose. Keep them in environment variables, never in code.
- A public HTTPS URL for the webhook, such as
https://wa.example.com/webhook. - A database for conversations, each customer’s state and the IDs of messages already handled.
- Respect for the platform’s rules: free-form replies within 24 hours of the customer’s last message, approved templates outside that window, and customer opt-in before you start a conversation.
When you connect the webhook, Meta sends a GET request to verify it, then delivers messages as signed POST requests. A short Express example:
const express = require('express');
const crypto = require('crypto');
const app = express();
app.use(express.json({ verify: (req, res, buf) => { req.rawBody = buf; } }));
// Verification when you connect the webhook in Meta's dashboard
app.get('/webhook', (req, res) => {
if (req.query['hub.mode'] === 'subscribe' &&
req.query['hub.verify_token'] === process.env.WA_VERIFY_TOKEN) {
return res.send(req.query['hub.challenge']);
}
res.sendStatus(403);
});
// Incoming messages, with Meta's signature checked
app.post('/webhook', (req, res) => {
const expected = 'sha256=' + crypto.createHmac('sha256', process.env.WA_APP_SECRET)
.update(req.rawBody).digest('hex');
if (req.get('X-Hub-Signature-256') !== expected) return res.sendStatus(401);
res.sendStatus(200); // answer fast, then process the message
handleMessage(req.body);
});
app.listen(process.env.PORT || 3000);
Return 200 quickly. If the response is slow or fails, Meta may resend the notification and the same message arrives twice, so store each message ID and ignore duplicates.
Why we don’t suggest unofficial libraries
Some tools imitate WhatsApp Web or the phone app to connect an ordinary number to code. WhatsApp’s terms don’t allow this, and numbers used this way can be banned at any time: along with your customer list. These tools also usually need a browser running in the background non-stop. So we don’t recommend them and don’t document running them.
Which ArabyHost plan fits the bot
The AI and Developer plans run the webhook app with Node.js 20 or 24, or Python 3.9 to 3.12, through Phusion Passenger on a domain or subdomain with free SSL. Because Passenger starts the app when requests arrive, a webhook bot doesn’t need a permanent background worker. These plans also give you SSH, Claude Code and Codex to build and change the bot on the server.
If your webhook is written in PHP, it can also run on the shared plans, since it’s an ordinary PHP file receiving HTTPS requests.
How it runs here, in short
- Create a subdomain such as
wa.example.com; it gets an SSL certificate automatically. - Create an app in Setup Node.js App or Setup Python App, and upload the code with Git or SSH.
- Add
WA_VERIFY_TOKEN,WA_APP_SECRETand the access token as the app’s environment variables. - In Meta’s dashboard, register the webhook URL and verify token, and subscribe to the
messagesfield. - Send a test message from your phone and check the app log.
For stores, the bot can read order status from the WooCommerce REST API. The complete steps are in the WhatsApp store bot guide, and if the bot uses AI to reply, see the AI app deployment guide.
What’s included
- Free automatic SSL, which Meta requires for webhook URLs.
- Daily JetBackup backups of the conversation database.
- Each account isolated with CageFS and its own resource limits, plus Imunify360 security.
- The Araby AI assistant reads error logs and explains the fix, plus support in Arabic.
Limits to know
- Meta’s limits aren’t ours: how many conversations you can start per day, template approval and business verification are all set by Meta.
- No GPU: you can’t run an AI model locally for replies; use an API.
- No root, no Docker, and no per-account Redis: keep message queues in the database.
- Per-plan resources: large campaigns sending thousands of messages at once need to be processed in batches.
On ArabyHost
Order an AI and Developer plan, set up your app in Meta for Developers, then run the webhook on a subdomain following the steps above. If you’d rather use a ready-made, no-code option, the same team runs ArabyBot, a platform for automating WhatsApp and Instagram conversations. For any question about the hosting side of the setup, contact our Arabic-speaking support.
FAQ
Is WhatsApp bot hosting free?
Hosting on ArabyHost is paid. Separately, Meta charges for some WhatsApp Business Platform message types according to its published pricing, so check Meta's pricing page before you launch.
Can the bot message a customer at any time?
The bot can reply freely within 24 hours of the customer's last message. Once that window closes, it can only send message templates that Meta has approved in advance.
Why not use libraries that connect a regular WhatsApp number to code?
They imitate WhatsApp Web or the phone app, which WhatsApp's terms don't allow, so the numbers get banned. They also usually need a browser running in the background all the time, which is heavy on any hosting.