Skip to main content

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

Best for: Single-server deployments, personal use, development.
Features:
  • Built-in process management
  • PID file tracking (~/.orcbot/orcbot.pid)
  • Log rotation
  • Graceful shutdown
  • Conflict detection (prevents multiple instances)
Best for: Cloud deployments, scalability, isolation.

Using Docker Compose (Minimal)

Setup:
1

Create .env file

2

Build and start

3

View logs

4

Access shell

Using Docker Compose (Full Stack)

Start:

3. PM2 Process Manager

Best for: Node.js-optimized deployments, shared hosting.
PM2 Ecosystem File:
Start with ecosystem:

4. Systemd Service (Linux)

Best for: Native Linux integration, system-level management.
Setup:
1

Create service user

2

Install service file

3

Enable and start

4

Check status

Cloud Platforms

Railway

1

Connect repository

Link your GitHub repository to Railway.
2

Set environment variables

Add OPENAI_API_KEY, TELEGRAM_TOKEN, etc. in the Railway dashboard.
3

Deploy

Railway auto-detects Node.js and runs npm start.
Procfile:

Heroku

AWS EC2

1

Launch EC2 instance

  • AMI: Ubuntu Server 22.04 LTS
  • Instance type: t3.small (2 vCPU, 2 GB RAM)
  • Storage: 20 GB SSD
2

Install dependencies

3

Clone and build

4

Configure environment

5

Start with PM2

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:
Response:
Docker Healthcheck:

Logging

View Logs:
Log Rotation:

Metrics

Custom Prometheus Exporter:
Expose Metrics:

Updates and Maintenance

Updating OrcBot

1

Backup data

2

Pull updates

3

Install dependencies

4

Rebuild

5

Restart

Database Migrations

OrcBot uses file-based storage by default (no migrations needed). If using SQLite:

Troubleshooting

Agent Not Starting

Check logs:
Common issues:
  • Missing API keys
  • Port already in use (3100)
  • Invalid configuration syntax
  • Insufficient permissions

High Memory Usage

Symptoms: Agent uses over 1GB RAM. Solutions:
Restart periodically:

Channel Disconnections

Telegram: Token revoked or bot blocked.
WhatsApp: Session expired.
Discord: Invalid token or missing permissions.

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.

Configuration

Configure OrcBot for production

Security

Production security best practices

Web Gateway

Expose OrcBot via REST API

Multi-Agent

Scale with worker processes