Skip to content
Alita Robot
Esc
navigateopen⌘Jpreview
On this page

Self-Hosting

Host your own instance of Alita Robot.

This guide covers everything you need to deploy your own instance of Alita Robot.

Prerequisites

Before you begin, ensure you have:

Component Minimum Version Purpose
PostgreSQL 16+ Primary database
Redis 7+ Caching layer
Docker (recommended) 20.10+ Container deployment

For building from source:

  • Go 1.26+

Deployment Options

Essential Configuration

At minimum, you need these environment variables:

BOT_TOKEN=your_bot_token_from_botfather
OWNER_ID=your_telegram_user_id
MESSAGE_DUMP=-100xxxxxxxxxx  # Log channel ID
DATABASE_URL=postgresql://alita:change-me@localhost:5432/alita

Redis itself is also required at runtime. No Redis endpoint variable is needed when it is available at the default localhost:6379; otherwise set either REDIS_ADDRESS=host:port or a full REDIS_URL.

Full Environment Reference

Complete list of all environment variables and their descriptions.

Webhook vs Polling

Mode Use Case Setup Complexity
Webhook Production Requires HTTPS domain
Polling Development Simple, works anywhere

Webhook Setup

Configure webhooks for production deployments.

Database Setup

Alita uses PostgreSQL with automatic migrations:

# Enable auto-migration
AUTO_MIGRATE=true

# Or run manually (requires PSQL_DB_* env vars to be set)
make psql-migrate

Database Guide

Database setup, migrations, connection pooling, and schema design.

Monitoring

Built-in observability endpoints:

  • GET /health - Health check with DB/Redis status
  • GET /metrics - Prometheus metrics
  • GET /db_metrics - Database performance metrics

Monitoring Guide

Health checks, Prometheus metrics, and resource monitoring.

Next Steps

Was this page helpful?