Railway

Deploy WhatsApp Poll Bot

Self-hosted WhatsApp bot to schedule recurring polls across multiple groups

Deploy WhatsApp Poll Bot

Just deployed

/app/data

/var/lib/postgresql/data

Deploy and Host WhatsApp Poll Bot on Railway

WhatsApp Poll Bot is a self-hosted bot that schedules and sends recurring polls to multiple WhatsApp groups, with a mobile-first web dashboard to manage polls, view results, and administer users. Powered by Baileys (no headless browser), it runs in ~80 MB RAM and supports daily, weekly, monthly, or custom cron schedules.

About Hosting WhatsApp Poll Bot

Hosting Poll Bot involves running a single Node.js process that combines an Express HTTP dashboard, a Baileys WebSocket client (the WhatsApp connection), and a node-cron scheduler — all inside one container. Persistent state lives in SQLite on a mounted volume so the WhatsApp session survives redeploys; optional PostgreSQL backups go to a separate service for safety. After the first deploy, you scan a QR code once with the WhatsApp account dedicated to the bot, then sign in to the dashboard with a 6-digit code sent over WhatsApp. From there, you create poll schedules, target groups, and watch votes flow in real time.

Common Use Cases

  • Recurring attendance polls across multiple groups (team check-ins, sports practice, weekly meal planning)
  • Self-hosted survey scheduler for communities, clubs, and small organizations
  • Lightweight alternative to commercial WhatsApp group management SaaS, kept fully on infrastructure you control

Dependencies for WhatsApp Poll Bot Hosting

  • A secondary WhatsApp account dedicated to the bot (never use your personal account — Meta may flag automated activity)
  • A persistent volume mounted at /app/data for the SQLite database and WhatsApp session
  • A PostgreSQL service (optional, but recommended) for off-volume backups — auto-provisioned by this template

Deployment Dependencies

Implementation Details

After deployment, set two required environment variables in Railway:

  • ADMIN_PHONES — your phone number(s) in international format without the + (e.g., 33612345678), comma-separated
  • PAIR_SECRET — 24+ random characters that gate the QR display (generate with openssl rand -hex 24)

Optional variables (VIEWER_PHONES, ALLOWED_PHONES, TIMEZONE, BACKUP_TRIGGER_SECRET, BAILEYS_LOG_LEVEL) are documented in .env.example.

Once the service boots, open its public URL, choose Admin mode, enter your PAIR_SECRET, and scan the QR code with the bot's WhatsApp account (Settings → Linked Devices → Link a Device). You'll then be prompted for your phone number and a 6-digit verification code sent via WhatsApp — and you're in.

Why Deploy WhatsApp Poll Bot on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying WhatsApp Poll Bot on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


Template Content

More templates in this category

View Template
Telegram JavaScript Bot
A template for Telegram bot in JavaScript using grammY

Agampreet Singh
View Template
Cobalt Tools [Updated May ’26]
Cobalt Tools [May ’26] (Media Downloader, Converter & Automation) Self Host

shinyduo
View Template
Whatsmiau
Deploy Whatsmiau on Railway. WhatsApp REST API. One click.

Douglas Rubim