Self-Hosting Overview
Self-Hosting Alita Robot
Section titled “Self-Hosting Alita Robot”This guide covers everything you need to deploy your own instance of Alita Robot.
Prerequisites
Section titled “Prerequisites”Before you begin, ensure you have:
| Component | Minimum Version | Purpose |
|---|---|---|
| PostgreSQL | 14+ | Primary database |
| Redis | 6+ | Caching layer |
| Docker (recommended) | 20.10+ | Container deployment |
For building from source:
- Go 1.25+
Deployment Options
Section titled “Deployment Options”Docker Compose (Recommended)
Section titled “Docker Compose (Recommended)”The easiest way to deploy Alita. Includes PostgreSQL and Redis.
git clone https://github.com/divkix/Alita_Robot.gitcd Alita_Robotcp sample.env .env# Edit .env with your configurationdocker-compose up -dBinary Deployment
Section titled “Binary Deployment”Download pre-built binaries for your platform:
- Linux (amd64, arm64)
- macOS (amd64, arm64)
- Windows (amd64)
Build from Source
Section titled “Build from Source”Compile the bot yourself:
git clone https://github.com/divkix/Alita_Robot.gitcd Alita_Robotgo build -o alita_robot .Essential Configuration
Section titled “Essential Configuration”At minimum, you need these environment variables:
BOT_TOKEN=your_bot_token_from_botfatherOWNER_ID=your_telegram_user_idMESSAGE_DUMP=-100xxxxxxxxxx # Log channel IDDATABASE_URL=postgres://user:pass@host:5432/dbREDIS_ADDRESS=localhost:6379Webhook vs Polling
Section titled “Webhook vs Polling”| Mode | Use Case | Setup Complexity |
|---|---|---|
| Webhook | Production | Requires HTTPS domain |
| Polling | Development | Simple, works anywhere |
Database Setup
Section titled “Database Setup”Alita uses PostgreSQL with automatic migrations:
# Enable auto-migrationAUTO_MIGRATE=true
# Or run manuallymake psql-migrateMonitoring
Section titled “Monitoring”Built-in observability endpoints:
GET /health- Health check with DB/Redis statusGET /metrics- Prometheus metrics
Next Steps
Section titled “Next Steps”- Docker Deployment - Quick start with containers
- Environment Variables - Full configuration reference
- Troubleshooting - Common issues and solutions