Guide to Self-Hosting Chatwoot: Centralized Facebook, Zalo, Live Chat Management for Businesses
A detailed guide on self-hosting Chatwoot on VPS or Dedicated Server to manage customer interactions across Facebook, Zalo, Live Chat, and more. Covers installation, configuration,...
Self-Hosting a Customer Care System with Chatwoot: Centralized Management Solution
In the digital age, managing customer interactions across multiple channels like Facebook, Zalo, Live Chat, Email, and other platforms is a major challenge for small and medium-sized businesses. Chatwoot is an open-source customer care platform that allows businesses to unify all these communication channels into a single interface. This guide provides a detailed walkthrough on self-hosting Chatwoot on a VPS or Dedicated Server to optimize costs, ensure data security, and maintain full control over your customer support infrastructure.
1. Introduction to Chatwoot and Benefits of Self-Hosting
Chatwoot is an open-source customer care platform that supports integration with various communication channels including Facebook Messenger, Zalo, Live Chat, Email, SMS, and over 30 other platforms. By self-hosting, businesses can:
- Ensure data privacy and full control over customer information
- Reduce monthly subscription costs
- Customize AI, RAG, or other tools to meet specific business needs
- Manage the entire system according to internal requirements
Chatwoot is built on Ruby on Rails and uses PostgreSQL as its database. To self-host efficiently, a server with sufficient configuration is required to handle interaction loads.
2. System Requirements and Environment Preparation
Chatwoot requires at least:
- RAM: 4GB or more (8GB recommended for medium to large businesses)
- Storage: 50GB SSD or more
- OS: Ubuntu 20.04 or 22.04
- Database: PostgreSQL 12+ or MySQL 8+
- Redis 6+
- Node.js 16+
For small businesses, a High-RAM Cloud VPS is ideal for self-hosting. For larger enterprises, a Dedicated Compute Server provides optimal performance and stability.
3. Installing and Configuring Chatwoot on a VPS
Run the following commands on your Ubuntu server:
bash\n# Update the system\nsudo apt update && sudo apt upgrade -y\n\n# Install Git and Node.js\nsudo apt install git curl -y\ncurl -sL https://deb.nodesource.com/setup_16.x | sudo -E bash -\nsudo apt install nodejs -y\n\n# Install PostgreSQL\nsudo apt install postgresql postgresql-contrib -y\nsudo -u postgres psql -c \"CREATE USER chatwoot WITH PASSWORD 'your_password';\"\nsudo -u postgres psql -c \"CREATE DATABASE chatwoot_production OWNER chatwoot;\"\n\n# Install Redis\nsudo apt install redis-server -y\nsudo systemctl enable redis-server\nsudo systemctl start redis-server\n\n# Clone Chatwoot repository\ngit clone https://github.com/chatwoot/chatwoot.git\ncd chatwoot\n\n# Install gems and bundle\ngem install bundler\nbundle install\n\n# Configure environment\ncp .env.example .env\n
Modify the `.env` file with the following settings:
env\n# Database\nDATABASE_URL=postgresql://chatwoot:your_password@localhost:5432/chatwoot_production\n\n# Redis\nREDIS_URL=redis://localhost:6379\n\n# Mail\nSMTP_ADDRESS=smtp.gmail.com\nSMTP_PORT=587\[email protected]\nSMTP_PASSWORD=your_password\n
Run the following commands to initialize and start Chatwoot:
bash\nrails db:setup\nrails assets:precompile\nrails server\n
4. Integrating AI and Optimizing Performance
Chatwoot supports AI integration via plugins or APIs. You can use language models such as Llama 3, Mistral, or GPT-4 (via API) to automate customer responses. Effective solutions include:
- RAG Integration: Connect Chatwoot to vector databases like Pgvector, Qdrant, or Milvus to answer questions based on internal knowledge.
- AI Auto-Response: Use AI to generate automated replies for common inquiries.
- Sentiment Analysis: Integrate sentiment analysis models to assess customer satisfaction levels.
To optimize performance, consider:
- Using Redis as a queue for background tasks
- Deploying a reverse proxy like Nginx or Caddy to improve access speed
- Using Cloudflare for protection and CDN optimization
5. System Verification and Maintenance
Run the following commands to verify your system:
bash\n# Check service status\nrails runner \"puts 'Chatwoot is running'\"\n\n# Verify database connection\nrails db:version\n\n# Test Redis\nredis-cli ping\n
For ongoing maintenance, regularly:
- Back up the database daily
- Analyze logs to detect errors
- Update Chatwoot and dependencies
6. Reference Resources
Self-hosting Chatwoot enables businesses to fully control their customer care system, integrate AI, and reduce costs. With the steps outlined above, you can deploy an efficient and secure centralized management system.
Practical Verification
To confirm Chatwoot is running correctly after setup, perform these non-destructive checks on your server. This assumes you have completed the installation and configuration steps above, including running rails server and ensuring the services (PostgreSQL, Redis) are active.
First, verify the application is accessible via the web interface. Assuming you are using a reverse proxy like Nginx or Caddy and have a domain or IP configured, open a browser and navigate to your Chatwoot URL (e.g., http://your-server-ip or https://chatwoot.yourdomain.com). You should see the Chatwoot login page.
Next, validate backend services are operational using CLI commands:
# Check if the Rails server is running (replace with your actual port if not 3000)
curl -sS http://localhost:3000 | grep -q "Chatwoot" && echo "Chatwoot server is responding" || echo "Server not reachable"
# Verify PostgreSQL connection and database exists
sudo -u postgres psql -c "\l" | grep -q "chatwoot_production" && echo "Database exists" || echo "Database not found"
# Test Redis connectivity
redis-cli ping
Expected output for the Redis check is PONG. For PostgreSQL, the database name chatwoot_production should appear in the list. The curl command should return HTML content containing the Chatwoot logo or title, confirming the application is serving requests.
Limitations: This verification assumes the server has network access to the web port (e.g., 80/443) and that no firewall rules block the connections. If you're using Cloudflare, ensure the origin server is properly configured. For AI integration, additional steps are required to set up models and APIs; these are not covered in this basic verification.
High-RAM Cloud VPS Plans Optimized for AI, Databases & Cache
Enterprise RAID 10 NVMe SSDs, CMC & FPT District 9 uplinks with Anycast Anti-DDoS and 99.99% SLA.
VPS-4E
10% VAT included
- CPU: 4 vCPU
- RAM: 8 GB
- SSD: 50 GB NVMe
