Self-Hosting

    Deploy ActiveRabbit on your own infrastructure.

    ActiveRabbit can be self-hosted on your own servers for complete data control, compliance requirements, or air-gapped environments.

    System Requirements

    Prerequisites

    • Docker & Docker Compose
    • PostgreSQL
    • Redis
    • 4GB+ RAM recommended

    Development Prerequisites

    • Ruby: 3.2.3+
    • PostgreSQL
    • Redis
    • Node.js (for asset compilation)

    Quick Start

    Using Docker Compose (Recommended)

    # Clone the repository
    git clone https://github.com/activerabbit-ai/activerabbit
    cd activerabbit
    
    # Start all services
    docker-compose up -d

    After setup, access the dashboard at http://localhost:3000.

    Environment Variables

    # .env file
    
    # Required
    SECRET_KEY_BASE=your-secret-key-here-generate-with-rails-secret
    DATABASE_URL=postgres://user:pass@localhost:5432/activerabbit
    REDIS_URL=redis://localhost:6379/0
    
    # Optional
    RAILS_ENV=production
    RAILS_LOG_LEVEL=info
    PORT=3000
    
    # Email (for alerts)
    SMTP_HOST=smtp.example.com
    SMTP_PORT=587
    SMTP_USER=your-smtp-user
    SMTP_PASSWORD=your-smtp-password
    SMTP_FROM=alerts@yourdomain.com
    
    # Storage (for source maps)
    STORAGE_TYPE=local  # or s3, gcs
    # S3 configuration (if using S3)
    AWS_ACCESS_KEY_ID=your-key
    AWS_SECRET_ACCESS_KEY=your-secret
    AWS_REGION=us-east-1
    AWS_BUCKET=activerabbit-storage

    Architecture

    ┌─────────────────────────────────────────────────────────┐
    │                     Load Balancer                        │
    │                    (nginx/traefik)                       │
    └─────────────────────────────────────────────────────────┘
                               │
               ┌───────────────┼───────────────┐
               ▼               ▼               ▼
        ┌────────────┐  ┌────────────┐  ┌────────────┐
        │  Web App   │  │  Web App   │  │  Web App   │
        │  (Rails)   │  │  (Rails)   │  │  (Rails)   │
        └────────────┘  └────────────┘  └────────────┘
               │               │               │
               └───────────────┼───────────────┘
                               │
            ┌──────────────────┼──────────────────┐
            ▼                  ▼                  ▼
     ┌────────────┐    ┌────────────┐    ┌────────────┐
     │ PostgreSQL │    │   Redis    │    │  Sidekiq   │
     │  Database  │    │   Cache    │    │  Workers   │
     └────────────┘    └────────────┘    └────────────┘

    Component Configuration

    PostgreSQL

    # Create database
    createdb activerabbit_production
    
    # Run migrations
    docker compose exec web rails db:migrate
    
    # Or with external PostgreSQL
    DATABASE_URL=postgres://user:pass@db-host:5432/activerabbit

    Redis

    # For caching and background jobs
    REDIS_URL=redis://redis-host:6379/0
    
    # With password
    REDIS_URL=redis://:password@redis-host:6379/0
    
    # Recommended Redis settings
    maxmemory 1gb
    maxmemory-policy allkeys-lru

    Nginx Configuration

    upstream activerabbit {
      server 127.0.0.1:3000;
      server 127.0.0.1:3001;
      server 127.0.0.1:3002;
    }
    
    server {
      listen 443 ssl http2;
      server_name activerabbit.yourdomain.com;
    
      ssl_certificate /etc/ssl/certs/activerabbit.crt;
      ssl_certificate_key /etc/ssl/private/activerabbit.key;
    
      location / {
        proxy_pass http://activerabbit;
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        proxy_set_header X-Forwarded-Proto $scheme;
      }
    
      # API endpoint with higher limits
      location /api/ {
        proxy_pass http://activerabbit;
        client_max_body_size 10m;
        proxy_read_timeout 60s;
      }
    }

    Scaling

    Horizontal Scaling

    # docker-compose.override.yml
    services:
      web:
        deploy:
          replicas: 3
      
      worker:
        deploy:
          replicas: 2

    Database Optimization

    -- Recommended PostgreSQL settings
    ALTER SYSTEM SET shared_buffers = '256MB';
    ALTER SYSTEM SET effective_cache_size = '1GB';
    ALTER SYSTEM SET work_mem = '16MB';
    ALTER SYSTEM SET maintenance_work_mem = '128MB';
    
    -- Create indexes for common queries
    CREATE INDEX CONCURRENTLY idx_events_project_timestamp 
      ON events(project_id, timestamp DESC);
    
    CREATE INDEX CONCURRENTLY idx_events_fingerprint 
      ON events(fingerprint);

    Data Retention

    # Configure in environment
    RETENTION_DAYS=90          # Keep events for 90 days
    RETENTION_RESOLVED_DAYS=30 # Keep resolved issues for 30 days
    
    # Run cleanup manually
    docker compose exec web rails activerabbit:cleanup
    
    # Or schedule via cron
    0 3 * * * docker compose exec web rails activerabbit:cleanup

    Backup & Recovery

    # Backup database
    docker compose exec db pg_dump -U postgres activerabbit > backup.sql
    
    # Backup with compression
    docker compose exec db pg_dump -U postgres activerabbit | gzip > backup.sql.gz
    
    # Restore
    gunzip -c backup.sql.gz | docker compose exec -T db psql -U postgres activerabbit
    
    # Automated backup script
    #!/bin/bash
    DATE=$(date +%Y%m%d_%H%M%S)
    docker compose exec -T db pg_dump -U postgres activerabbit | \
      gzip > /backups/activerabbit_$DATE.sql.gz
    
    # Keep last 7 days
    find /backups -name "activerabbit_*.sql.gz" -mtime +7 -delete

    Monitoring

    # Health check endpoint
    curl http://localhost:3000/health
    
    # Response
    {
      "status": "ok",
      "database": "connected",
      "redis": "connected",
      "workers": 2
    }
    
    # Prometheus metrics (if enabled)
    curl http://localhost:3000/metrics

    Upgrading

    # Pull latest images
    docker compose pull
    
    # Run migrations
    docker compose run --rm web rails db:migrate
    
    # Restart services
    docker compose up -d
    
    # Verify
    docker compose ps
    curl http://localhost:3000/health

    Development Setup

    # Clone and install
    git clone https://github.com/activerabbit-ai/activerabbit
    cd activerabbit
    bundle install
    
    # Setup environment
    cp .env.example .env
    # Edit .env with your settings
    
    # Setup database
    rails db:create db:migrate
    
    # Start all services
    bin/dev

    Docker Development

    # First-time setup
    ./bin/docker-setup
    
    # Start all services
    docker-compose up
    
    # Or run in background
    docker-compose up -d

    Helper Scripts

    ScriptDescription
    bin/devStart development server with all services
    bin/docker-setupFirst-time Docker setup
    bin/docker-devStart Docker development environment
    bin/docker-consoleOpen Rails console in Docker
    bin/docker-resetReset entire Docker environment

    Ports

    ServicePort
    Web Applicationhttp://localhost:3000
    Sidekiq Dashboardhttp://localhost:3000/sidekiq
    PostgreSQLlocalhost:5432
    Redislocalhost:6380

    Tech Stack

    ComponentTechnology
    FrameworkRuby on Rails 8.2
    DatabasePostgreSQL
    Cache/JobsRedis, Sidekiq
    AuthenticationDevise
    PaymentsStripe (Pay gem)
    UITailwind CSS
    SecurityRack::Attack
    HTTP ClientFaraday
    MetricsHDRHistogram

    Running Tests

    # Run all tests
    bundle exec rspec
    
    # Run specific test
    bundle exec rspec spec/models/user_spec.rb
    
    # Run with coverage
    COVERAGE=true bundle exec rspec

    💼 Enterprise Support

    Need help with self-hosting? Enterprise customers get dedicated support, architecture review, and SLA guarantees. Contact [email protected]