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 -dAfter 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-storageArchitecture
┌─────────────────────────────────────────────────────────┐
│ 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/activerabbitRedis
# 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-lruNginx 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: 2Database 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:cleanupBackup & 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 -deleteMonitoring
# 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/metricsUpgrading
# 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/healthDevelopment 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/devDocker Development
# First-time setup
./bin/docker-setup
# Start all services
docker-compose up
# Or run in background
docker-compose up -dHelper Scripts
| Script | Description |
|---|---|
bin/dev | Start development server with all services |
bin/docker-setup | First-time Docker setup |
bin/docker-dev | Start Docker development environment |
bin/docker-console | Open Rails console in Docker |
bin/docker-reset | Reset entire Docker environment |
Ports
| Service | Port |
|---|---|
| Web Application | http://localhost:3000 |
| Sidekiq Dashboard | http://localhost:3000/sidekiq |
| PostgreSQL | localhost:5432 |
| Redis | localhost:6380 |
Tech Stack
| Component | Technology |
|---|---|
| Framework | Ruby on Rails 8.2 |
| Database | PostgreSQL |
| Cache/Jobs | Redis, Sidekiq |
| Authentication | Devise |
| Payments | Stripe (Pay gem) |
| UI | Tailwind CSS |
| Security | Rack::Attack |
| HTTP Client | Faraday |
| Metrics | HDRHistogram |
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]