Overview
OrcBot is designed to run as a long-running service that listens for events from Telegram, WhatsApp, Discord, or other channels. This guide covers deployment strategies for production environments.OrcBot needs to stay active to:
- Listen for incoming messages on communication channels
- Run scheduled tasks and heartbeats
- Process background actions from the queue
- Maintain active connections to channel APIs
Deployment Options
1. Daemon Mode (Recommended for VPS)
Best for: Single-server deployments, personal use, development.- Built-in process management
- PID file tracking (
~/.orcbot/orcbot.pid) - Log rotation
- Graceful shutdown
- Conflict detection (prevents multiple instances)
2. Docker (Recommended for Production)
Best for: Cloud deployments, scalability, isolation.Using Docker Compose (Minimal)
Using Docker Compose (Full Stack)
3. PM2 Process Manager
Best for: Node.js-optimized deployments, shared hosting.4. Systemd Service (Linux)
Best for: Native Linux integration, system-level management.Cloud Platforms
Railway
Procfile:
Heroku
AWS EC2
Launch EC2 instance
- AMI: Ubuntu Server 22.04 LTS
- Instance type: t3.small (2 vCPU, 2 GB RAM)
- Storage: 20 GB SSD
DigitalOcean Droplet
Similar to AWS EC2 - follow the same steps. Recommended: Use Docker for easier deployment.Configuration for Production
Environment Variables
Production Config
Monitoring
Health Checks
HTTP Endpoint:Logging
View Logs:Metrics
Custom Prometheus Exporter:Updates and Maintenance
Updating OrcBot
Database Migrations
OrcBot uses file-based storage by default (no migrations needed). If using SQLite:Troubleshooting
Agent Not Starting
Check logs:- Missing API keys
- Port already in use (3100)
- Invalid configuration syntax
- Insufficient permissions
High Memory Usage
Symptoms: Agent uses over 1GB RAM. Solutions:Channel Disconnections
Telegram: Token revoked or bot blocked.Best Practices
Use Docker
Containerize for portability and isolation.
Enable Health Checks
Monitor agent status and restart on failure.
Rotate Logs
Prevent disk space issues with log rotation.
Backup Regularly
Backup config and memory daily.
Monitor Resources
Track CPU, memory, and disk usage.
Update Dependencies
Keep Node.js and npm packages up to date.