Building a Multi-Channel AI Chatbot System (Zalo, Messenger, Telegram) Using Typebot and Flowise Hosted on a Budget VPS
Introduction: The Power of Self-Hosted AI Chatbots
In the modern digital ecosystem, customer engagement happens across multiple channels simultaneously. For businesses operating in regions like Southeast Asia, managing interactions across Zalo, Facebook Messenger, and Telegram is no longer optional—it is a core business requirement. However, relying on proprietary, closed-source chatbot platforms often leads to skyrocketing subscription costs, rigid vendor lock-in, and severe data privacy concerns.
By leveraging open-source tools like Typebot (a powerful visual chatbot builder) and Flowise (a drag-and-drop UI for LangChain/LlamaIndex), businesses can build sophisticated, LLM-powered chat infrastructures. The best part? This entire stack can be self-hosted on a budget Virtual Private Server (VPS), commonly referred to in the tech community as "VPS cỏ" (low-spec VPS), allowing you to achieve enterprise-level automation for a fraction of the cost. This guide will walk you through the architecture, installation, and multi-channel integration of this powerful AI stack.
Why Choose the Typebot + Flowise Architecture?
Combining Typebot and Flowise creates a highly flexible, hybrid chatbot system that balances structural logic with advanced artificial intelligence.
- Typebot as the Frontend & Orchestrator: Typebot excels at handling variables, rich media UI elements, conditions, and structured API webhooks. It serves as the elegant user interface and conversational gatekeeper.
- Flowise as the Brain: Flowise handles complex Retrieval-Augmented Generation (RAG), vector database management, tool integrations, and agentic workflows. It transforms standard prompts into context-aware AI brains.
- Cost Efficiency: Instead of paying per-seat or per-message fees to third-party providers, you only pay for your underlying VPS resources and direct LLM API usage (such as OpenAI, Anthropic, or open-source models via Ollama).
System Architecture Overview
Before diving into the deployment phase, it is crucial to understand how data flows through this self-hosted ecosystem:
User Input (Zalo/Messenger/Telegram) → Webhook Gateway → Typebot Server → Flowise API → LLM / Vector DB → Response returned via Typebot to the User.
To run this setup comfortably, a budget Linux VPS with at least 2 vCPUs, 4GB RAM, and 40GB SSD is highly recommended. While it can run on lower specs, running Docker containers for Typebot, Flowise, and a database requires a stable baseline of memory.
Step-by-Step Deployment Guide on a Budget VPS
Step 1: Preparing the Server Environment
First, access your VPS via SSH and update the system packages. We will utilize Docker and Docker Compose to ensure a clean, isolated, and easily maintainable installation.
sudo apt update && sudo apt upgrade -y
sudo apt install docker.io docker-compose -yStep 2: Deploying Flowise via Docker Compose
Create a dedicated directory for Flowise and set up its configuration. Flowise will act as our backend AI engine.
mkdir flowise && cd flowise
nano docker-compose.ymlPaste a standard Docker Compose configuration mapping port 3000 and defining persistent storage volumes so your AI workflows are saved permanently after restarts.
Step 3: Deploying Typebot
Typebot requires a PostgreSQL database and an object storage solution (or local storage setup). Create a typebot directory and deploy its multi-container environment using the official Docker templates, ensuring ports 8000 (Viewer) and 8001 (Builder) are securely configured.
Step 4: Setting Up Nginx and SSL Certificates
To communicate securely with external messaging APIs (Zalo, Facebook), your chatbot server must use HTTPS. Install Nginx and use Let's Encrypt Certbot to obtain free SSL certificates for your subdomains (e.g., typebot.yourdomain.com and flowise.yourdomain.com).
Designing the AI Workflow in Flowise
Once logged into Flowise, create a new chatflow to serve as the brain of your assistant:
- Add a Chat Model: Drag in an LLM node like ChatOpenAI or ChatAnthropic.
- Implement RAG (Optional): Connect a Vector Store Retriever (such as Pinecone or a local Chroma/Faiss instance) loaded with your business documentation, FAQs, or product catalogs. This ensures the bot provides highly accurate, company-specific answers.
- Deploy the API Endpoint: Save the chatflow and note down the API URL and authorization headers. This endpoint will be queried by Typebot.
Structuring the Conversation in Typebot
Open the Typebot Builder and construct your conversational flow. Typebot acts as the bridge between raw chat APIs and the Flowise brain:
- Step 1: Lead Capture & Triage: Use native Typebot blocks to ask for basic information like name, phone number, or intent. This reduces LLM token costs by handling routine questions through static logic.
- Step 2: The HTTP Webhook Block: When the user asks a complex question, trigger an HTTP Request block aimed at your Flowise API endpoint. Pass the user's message as a JSON payload.
- Step 3: Parsing and Displaying the Response: Save the JSON response from Flowise into a variable (e.g.,
{aiResponse}) and display it to the user.
Connecting to Multi-Channel Gateways
1. Telegram Integration
Telegram is the most straightforward channel to connect. Use the BotFather to generate an API token. In Typebot, go to the Share tab, select Telegram, paste your token, and establish the webhook connection instantly.
2. Facebook Messenger Integration
Navigate to the Meta for Developers dashboard, create a business application, and configure the Messenger product. Link your official Facebook Page, generate an Access Token, and set up the Webhook pointing to Typebot's designated integration endpoint.
3. Zalo Official Account (OA) Integration
Integrating Zalo requires utilizing the Zalo Official Account API. Since Zalo enforces strict webhook structures and token refreshes, you may use an intermediate webhook manager like n8n (also self-hosted on your VPS) or a custom script to format Zalo payloads into standard Typebot text inputs, then relay the response back via the Zalo OA OpenAPI.
Optimization and Maintenance Tips for "VPS Cỏ"
Running a robust AI stack on a budget server requires careful resource management to prevent crashes and high latency:
- Enable Swap Memory: If your VPS runs low on physical RAM, a swap file (e.g., 2GB to 4GB) prevents Docker containers from getting terminated by the Linux Out-Of-Memory (OOM) killer.
- Database Optimization: Regularly clean up Typebot conversation logs and set up a data retention policy to keep your database lean.
- Monitor Resource Usage: Use command-line tools like
htopor lightweight container monitors likectopto observe memory spikes when multiple users query the LLM simultaneously.
Conclusion
Building a self-hosted, multi-channel AI chatbot system using Typebot and Flowise unlocks immense scalability for your business without the financial burden of premium SaaS platforms. By centralizing your logic in Typebot, empowering it with custom knowledge bases via Flowise, and deploying it securely on an affordable VPS, you maintain total data sovereignty, drastically cut down on monthly overhead, and deliver an exceptional automated experience to your customers across Zalo, Messenger, and Telegram.
