cd /news/ai-agents/5-problems-i-hit-running-a-whatsapp-… Β· home β€Ί topics β€Ί ai-agents β€Ί article
[ARTICLE Β· art-136277] src=dev.to β†— pub= topic=ai-agents verified=true sentiment=Β· neutral

5 Problems I Hit Running a WhatsApp AI Bot 24/7 on Windows - And How I Fixed Them

A developer documented five reliability problems encountered while running a WhatsApp AI bot 24/7 on a Windows PC, including process persistence, repeated QR-code authentication, local LLM inference speed, and unhandled errors. The fixes rely on PM2 for process management, whatsapp-web.js LocalAuth for persistent sessions, smaller Ollama models such as llama3.2:3b for faster replies, and try/catch error handling around every external call. The resulting architecture runs entirely on owned hardware with no VPS or paid AI API.

by read2 min views1 publishedSep 21, 2026

Running a WhatsApp AI bot locally sounds simple:

WhatsApp β†’ Node.js β†’ Ollama β†’ done.

In practice, keeping it running reliably 24/7 on a Windows PC taught me a few things the hard way.

Here are 5 problems I ran into β€” and how I fixed them.

During development, running node index.js worked perfectly.

But the moment the terminal was closed, the bot disappeared with it.

Use a process manager such as PM2: npm install -g pm2

Then:

pm2 start index.js --name whatsapp-ai-bot And save the process list:

pm2 save

This makes the bot much easier to manage and restart.

Scanning a QR code every time the bot starts isn't practical for a machine that's supposed to run 24/7.

With whatsapp-web.js, use persistent local authentication:

`const { Client, LocalAuth } = require('whatsapp-web.js');`

`const client = new Client({ authStrategy: new LocalAuth() });`

The authentication session is stored locally, so normal restarts don't require pairing the account again.

A local LLM means no paid AI API, but your hardware now does the inference.

Running a model that's too large can make a WhatsApp bot feel unusable.

Start with a smaller model.

For example: ollama run llama3.2:3b

Then test response time before moving to something larger.

For a chat bot, a fast smaller model can be more useful than a smarter model that takes forever to answer. Network requests fail.

Ollama may temporarily be unavailable.

Messages may contain unexpected content.

Without error handling, one bad request can take down a bot that's supposed to run unattended.

Treat every external operation as something that can fail.

try { const response = await askOllama(message.body); await message.reply(response); } catch (error) { console.error('Bot error:', error); } Also log failures instead of silently ignoring them.

This was an important distinction.

The setup can avoid:

But the Windows machine still needs to remain powered on and connected to the internet.

For me, that's the useful part of this architecture: reuse hardware you already own instead of paying for another server every month. The architecture ended up being surprisingly small:

WhatsApp β†’ whatsapp-web.js β†’ Node.js β†’ Ollama β†’ Local LLM

No VPS.

No paid AI API.

No monthly hosting subscription.

If you want the complete Windows setup, source code, configuration, and step-by-step instructions, I put everything together here: πŸ‘‰ Complete WhatsApp AI Bot Setup Guide + Code

If you're building something similar, I'd also be interested to hear what problems you ran into.

── more in #ai-agents 4 stories Β· sorted by recency
── more on @whatsapp 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/5-problems-i-hit-run…] indexed:0 read:2min 2026-09-21 Β· β€”