ADI for Enterprise: Self-Hosted Deployment Options

ADI Team
enterpriseself-hosteddockergitlab

Deploy ADI in your infrastructure with Docker Compose or expert mode. Full control over your autonomous development environment with support for custom GitLab instances.

ADI for Enterprise: Self-Hosted Deployment

Take full control of your autonomous development infrastructure. ADI offers flexible self-hosted deployment options for enterprises that need data sovereignty, custom integrations, or enhanced security.

Why Self-Host ADI?

Data Sovereignty

  • Keep all code and task data within your infrastructure
  • Comply with data residency requirements
  • Full control over data retention and processing

Custom Integrations

  • Connect to private GitLab instances
  • Integrate with internal task management systems
  • Custom authentication and authorization flows

Security & Compliance

  • Air-gapped deployments for sensitive environments
  • Custom security policies and network configurations
  • Audit logging and compliance reporting

Cost Optimization

  • Bring Your Own Key (BYOK) for AI providers
  • No data transfer costs to external services
  • Scale infrastructure based on your needs

Deployment Options

ADI provides two deployment approaches to match your infrastructure maturity and requirements.

Option 1: Docker Compose (Recommended)

The fastest way to get ADI running in your environment. Perfect for teams that want a production-ready setup without extensive DevOps overhead.

Best for:

  • Teams new to self-hosting
  • Quick production deployments
  • Standard infrastructure setups
  • Organizations using Docker/Podman

What's included:

  • Pre-configured multi-container setup
  • PostgreSQL database with optimized settings
  • Redis for caching and job queues
  • Nginx reverse proxy with SSL/TLS support
  • Health checks and auto-restart policies
  • Volume management for data persistence

Option 2: Expert Mode

Full control over every aspect of your deployment. Build custom configurations, integrate with existing infrastructure, and optimize for your specific needs.

Best for:

  • Large enterprises with existing infrastructure
  • Teams with specific compliance requirements
  • Organizations using Kubernetes or custom orchestration
  • Advanced DevOps teams wanting full control

What you control:

  • Database selection and configuration
  • Custom load balancing and scaling
  • Integration with existing monitoring and logging
  • Custom authentication providers
  • Network topology and security policies

Docker Compose Deployment

Prerequisites

Before deploying, ensure you have:

  • Docker 24.0+ and Docker Compose 2.20+
  • 2 CPU cores and 4GB RAM minimum (8GB recommended)
  • 20GB disk space for application and database
  • Domain name with DNS configured (for SSL/TLS)
  • GitLab instance (cloud or self-hosted)

Step 1: Download Configuration

# Clone the ADI deployment repository
git clone https://github.com/your-org/adi-deploy.git
cd adi-deploy

# Or download the docker-compose.yaml directly
curl -O https://raw.githubusercontent.com/your-org/adi-deploy/main/docker-compose.yaml

Step 2: Configure Environment

Create a .env file with your configuration:

# Application Settings
APP_URL=https://adi.your-company.com
APP_PORT=3000

# Database Configuration
POSTGRES_HOST=postgres
POSTGRES_PORT=5432
POSTGRES_DB=adi
POSTGRES_USER=adi
POSTGRES_PASSWORD=your-secure-password-here

# Redis Configuration
REDIS_HOST=redis
REDIS_PORT=6379

# GitLab Integration
GITLAB_URL=https://gitlab.your-company.com
GITLAB_CLIENT_ID=your-oauth-app-id
GITLAB_CLIENT_SECRET=your-oauth-secret
GITLAB_REDIRECT_URI=https://adi.your-company.com/auth/gitlab/callback

# Session & Security
SESSION_SECRET=your-random-session-secret-here
JWT_SECRET=your-random-jwt-secret-here

# Email Configuration (Optional)
SMTP_HOST=smtp.your-company.com
SMTP_PORT=587
[email protected]
SMTP_PASSWORD=your-smtp-password

# SSL/TLS (Optional - if using Let's Encrypt)
[email protected]
LETSENCRYPT_DOMAIN=adi.your-company.com

Step 3: Review docker-compose.yaml

The provided docker-compose.yaml includes:

version: '3.8'

services:
  # ADI Application
  adi-app:
    image: adi/app:latest
    container_name: adi-app
    restart: unless-stopped
    env_file: .env
    depends_on:
      - postgres
      - redis
    ports:
      - "3000:3000"
    volumes:
      - ./data/uploads:/app/uploads
      - ./logs:/app/logs
    healthcheck:
      test: ["CMD", "curl", "-f", "http://localhost:3000/health"]
      interval: 30s
      timeout: 10s
      retries: 3

  # PostgreSQL Database
  postgres:
    image: postgres:16-alpine
    container_name: adi-postgres
    restart: unless-stopped
    environment:
      POSTGRES_DB: ${POSTGRES_DB}
      POSTGRES_USER: ${POSTGRES_USER}
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
    volumes:
      - postgres-data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER}"]
      interval: 10s
      timeout: 5s
      retries: 5

  # Redis Cache
  redis:
    image: redis:7-alpine
    container_name: adi-redis
    restart: unless-stopped
    volumes:
      - redis-data:/data
    command: redis-server --appendonly yes
    healthcheck:
      test: ["CMD", "redis-cli", "ping"]
      interval: 10s
      timeout: 5s
      retries: 5

  # Nginx Reverse Proxy (Optional)
  nginx:
    image: nginx:alpine
    container_name: adi-nginx
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
      - ./ssl:/etc/nginx/ssl:ro
    depends_on:
      - adi-app

volumes:
  postgres-data:
  redis-data:

Step 4: Deploy

# Start all services
docker compose up -d

# Check logs
docker compose logs -f adi-app

# Verify health
docker compose ps
curl http://localhost:3000/health

Step 5: Initial Setup

  1. Access your ADI instance: https://adi.your-company.com
  2. Complete the initial setup wizard
  3. Configure GitLab OAuth connection
  4. Add your AI provider API keys
  5. Configure task sources (Jira, Linear, etc.)

Step 6: Configure GitLab OAuth

For custom GitLab instances:

  1. Navigate to your GitLab instance: Settings → Applications
  2. Create new OAuth application:
    • Name: ADI
    • Redirect URI: https://adi.your-company.com/auth/gitlab/callback
    • Scopes: api, read_user, read_repository, write_repository
  3. Copy the Application ID and Secret to your .env file
  4. Restart ADI: docker compose restart adi-app

Expert Mode Deployment

For advanced users who want full control over their deployment.

Architecture Overview

ADI consists of these components:

  • Backend API (Node.js/TypeScript)
  • Worker Processes (Task evaluation and execution)
  • Frontend (Next.js)
  • PostgreSQL (Primary database)
  • Redis (Caching and job queues)

System Requirements

Minimum:

  • 2 CPU cores, 4GB RAM
  • PostgreSQL 14+
  • Redis 7+
  • Node.js 20+

Recommended:

  • 4+ CPU cores, 8GB+ RAM
  • Load balancer for multiple instances
  • Separate database server
  • Redis Cluster for high availability

Manual Installation

1. Database Setup
# Install PostgreSQL
sudo apt install postgresql-16

# Create database and user
sudo -u postgres psql
CREATE DATABASE adi;
CREATE USER adi WITH PASSWORD 'your-password';
GRANT ALL PRIVILEGES ON DATABASE adi TO adi;
\q

# Run migrations
npm run db:migrate
2. Redis Setup
# Install Redis
sudo apt install redis-server

# Configure persistence
sudo systemctl enable redis-server
sudo systemctl start redis-server
3. Application Setup
# Clone repository
git clone https://github.com/your-org/adi.git
cd adi

# Install dependencies
npm install

# Build application
npm run build

# Configure environment
cp .env.example .env
# Edit .env with your configuration

# Run database migrations
npm run db:migrate

# Start application
npm run start
4. Worker Processes
# Start task evaluation workers
npm run worker:tasks

# Start GitLab sync workers
npm run worker:sync

# Monitor workers
npm run worker:status
5. Process Management

Use systemd for production deployments:

# /etc/systemd/system/adi.service
[Unit]
Description=ADI Application
After=network.target postgresql.service redis.service

[Service]
Type=simple
User=adi
WorkingDirectory=/opt/adi
Environment=NODE_ENV=production
ExecStart=/usr/bin/node dist/server.js
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

Kubernetes Deployment

For organizations using Kubernetes:

# Example deployment configuration
apiVersion: apps/v1
kind: Deployment
metadata:
  name: adi-app
spec:
  replicas: 3
  selector:
    matchLabels:
      app: adi
  template:
    metadata:
      labels:
        app: adi
    spec:
      containers:
      - name: adi
        image: adi/app:latest
        ports:
        - containerPort: 3000
        env:
        - name: DATABASE_URL
          valueFrom:
            secretKeyRef:
              name: adi-secrets
              key: database-url
        resources:
          requests:
            memory: "512Mi"
            cpu: "500m"
          limits:
            memory: "2Gi"
            cpu: "2000m"

Custom GitLab Integration

ADI supports both GitLab.com and self-hosted GitLab instances.

Configuring Custom GitLab

1. GitLab OAuth Setup
# In your GitLab instance
Admin → Applications → New Application

Name: ADI
Redirect URI: https://adi.your-company.com/auth/gitlab/callback
Scopes:
  - api
  - read_user
  - read_repository
  - write_repository
2. GitLab Runner Configuration

For custom GitLab executors:

# .gitlab-ci.yml
adi-executor:
  stage: deploy
  script:
    - curl -X POST https://adi.your-company.com/api/webhooks/gitlab
      -H "Content-Type: application/json"
      -H "X-Gitlab-Token: $GITLAB_TOKEN"
      -d "{\"project_id\": $CI_PROJECT_ID, \"ref\": \"$CI_COMMIT_REF_NAME\"}"
  only:
    - merge_requests
3. Custom Executor Settings

Configure ADI to use your GitLab executor:

{
  "executor": {
    "type": "gitlab-runner",
    "config": {
      "url": "https://gitlab.your-company.com",
      "token": "your-runner-token",
      "tags": ["adi", "autonomous"],
      "docker": {
        "image": "node:20-alpine",
        "volumes": ["/cache"]
      }
    }
  }
}

Monitoring & Maintenance

Health Checks

ADI provides health check endpoints:

# Application health
curl http://localhost:3000/health

# Database connectivity
curl http://localhost:3000/health/db

# Redis connectivity
curl http://localhost:3000/health/redis

# Worker status
curl http://localhost:3000/health/workers

Logging

Configure logging for production:

// config/logging.js
{
  "level": "info",
  "format": "json",
  "outputs": [
    {
      "type": "file",
      "path": "/var/log/adi/app.log",
      "maxSize": "100M",
      "maxFiles": 10
    },
    {
      "type": "syslog",
      "host": "logs.your-company.com",
      "port": 514
    }
  ]
}

Backup Strategy

Database:

# Daily PostgreSQL backups
pg_dump -h localhost -U adi adi > backup-$(date +%Y%m%d).sql

# Automated with cron
0 2 * * * /usr/local/bin/backup-adi-db.sh

Configuration:

# Backup environment and configs
tar -czf adi-config-$(date +%Y%m%d).tar.gz .env config/

Updates

# Docker Compose
docker compose pull
docker compose up -d

# Manual installation
git pull
npm install
npm run build
npm run db:migrate
systemctl restart adi

Security Best Practices

API Keys & Secrets

  • Store secrets in environment variables or secret management systems
  • Use separate API keys per environment
  • Rotate secrets regularly
  • Never commit secrets to version control

Network Security

  • Use TLS/SSL for all connections
  • Implement IP whitelisting for admin access
  • Configure firewall rules to restrict access
  • Use VPN for administrative access

Database Security

  • Use strong passwords (32+ characters)
  • Enable SSL/TLS for database connections
  • Regular security updates
  • Restrict database access to application hosts only

Monitoring & Alerts

  • Set up alerts for failed health checks
  • Monitor API rate limits and quota usage
  • Track worker process status
  • Alert on unusual AI provider costs

Troubleshooting

Common Issues

Database Connection Errors:

# Check PostgreSQL status
docker compose ps postgres
docker compose logs postgres

# Verify credentials
psql -h localhost -U adi -d adi

Redis Connection Issues:

# Check Redis status
docker compose ps redis
docker compose exec redis redis-cli ping

GitLab OAuth Failures:

  • Verify redirect URI matches exactly
  • Check OAuth application scopes
  • Ensure GitLab instance is accessible
  • Review application logs for detailed errors

Worker Not Processing Tasks:

# Check worker logs
docker compose logs adi-worker

# Verify Redis queue
docker compose exec redis redis-cli
LLEN queue:tasks

Support & Resources

Documentation

Community

  • GitHub Discussions: Share deployment strategies
  • Slack Channel: Real-time support from the community
  • Stack Overflow: Tag your questions with adi-platform

Enterprise Support

For dedicated support:

  • Email: [email protected]
  • Response Time: 24 hours for standard, 4 hours for critical
  • Custom Integration: Help with complex enterprise deployments
  • Training: On-site or remote training for your team

Get Started

Ready to deploy ADI in your infrastructure?

  1. Download the starter kit: Download docker-compose.yaml
  2. Review the documentation: Full deployment guide
  3. Join the community: Enterprise Slack channel

Questions? Contact us at [email protected]