doteb

Self Host doteb

Simple guide to self-hosting doteb using Docker.

doteb is a self-hostable platform that provides a unified API gateway for multiple LLM providers. This guide offers two simple options to get started.

Prerequisites

  • Latest Docker
  • API keys for the LLM providers you want to use (OpenAI, Anthropic, etc.)

Option 1: Unified Docker Image (Simplest)

This option uses a single Docker container that includes all services (UI, API, Gateway, Database, Redis).

# Set a strong secret first
export LLM_GATEWAY_SECRET="your-secret-key-here"
export GATEWAY_API_KEY_HASH_SECRET="your-api-key-hash-secret-here"

# Run the container
docker run -d \
  --name llmgateway \
  --restart unless-stopped \
  -p 3002:3002 \
  -p 3003:3003 \
  -p 3005:3005 \
  -p 3006:3006 \
  -p 4001:4001 \
  -p 4002:4002 \
  -v llmgateway_postgres:/var/lib/postgresql/data \
  -v llmgateway_redis:/var/lib/redis \
  -e AUTH_SECRET="$LLM_GATEWAY_SECRET" \
  -e GATEWAY_API_KEY_HASH_SECRET="$GATEWAY_API_KEY_HASH_SECRET" \
  llmgateway-unified:latest

Docker will create the named volumes automatically on first run. Do not bind-mount a host directory directly to /var/lib/postgresql/data, because PostgreSQL initialization inside the container needs to manage permissions on that path.

Note: for production, use the pinned image tag supplied with your deployment package instead of latest.

Using Docker Compose (Alternative for unified image)

# Copy the compose files from your deployment package
cp /path/to/deployment/docker-compose.unified.yml .
cp /path/to/deployment/.env.unified.example .

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

# Start the service
docker compose -f docker-compose.unified.yml up -d

Note: for production, replace latest with the pinned image tag supplied with your deployment package.

Option 2: Separate Services with Docker Compose

This option uses separate containers for each service, offering more flexibility.

# Copy the split-service compose files from your deployment package
cp /path/to/deployment/docker-compose.split.yml .
cp /path/to/deployment/.env.example .

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

# Start the services
docker compose -f docker-compose.split.yml up -d

Note: for production, replace latest in all images with the pinned image tags supplied with your deployment package.

Accessing Your doteb

After starting either option, you can access:

Required Configuration

At minimum, you need to set these environment variables:

# Database (change the password!)
POSTGRES_PASSWORD=your_secure_password_here

# Authentication
AUTH_SECRET=your-secret-key-here
GATEWAY_API_KEY_HASH_SECRET=your-api-key-hash-secret-here

# LLM Provider API Keys (add the ones you need)
LLM_OPENAI_API_KEY=sk-...
LLM_ANTHROPIC_API_KEY=sk-ant-...

Basic Management Commands

For Unified Docker (Option 1)

# View logs
docker logs llmgateway

# Restart container
docker restart llmgateway

# Stop container
docker stop llmgateway

For Docker Compose (Option 2)

# View logs
docker compose -f docker-compose.split.yml logs -f

# Restart services
docker compose -f docker-compose.split.yml restart

# Stop services
docker compose -f docker-compose.split.yml down

Build locally

Public source builds are not distributed. Use the published images or the private deployment bundle provided for your environment.

All provider API keys

You can set any of the following API keys:

LLM_OPENAI_API_KEY=
LLM_OPENAI_BASE_URL=
LLM_ANTHROPIC_API_KEY=

Multiple API Keys and Load Balancing

doteb supports multiple API keys per provider for load balancing and increased availability. Simply provide comma-separated values for your API keys:

# Multiple OpenAI keys for load balancing
LLM_OPENAI_API_KEY=sk-key1,sk-key2,sk-key3

# Multiple Anthropic keys
LLM_ANTHROPIC_API_KEY=sk-ant-key1,sk-ant-key2

Health-Aware Routing

The gateway automatically tracks the health of each API key and routes requests to healthy keys. If a key experiences consecutive errors, it will be temporarily skipped. Keys that return authentication errors (401/403) are permanently blacklisted until restart.

For providers that require additional configuration (like Google Vertex), you can specify multiple values that correspond to each API key. The gateway will always use the matching index:

# Multiple Google Vertex configurations
LLM_GOOGLE_VERTEX_API_KEY=key1,key2,key3
LLM_GOOGLE_CLOUD_PROJECT=project-a,project-b,project-c
LLM_GOOGLE_VERTEX_REGION=us-central1,europe-west1,asia-east1

When the gateway selects key2, it will automatically use project-b and europe-west1. If you have fewer configuration values than keys, the last value will be reused for remaining keys.

Next Steps

Once your doteb is running:

  1. Open the web interface at http://localhost:3002
  2. Create your first organization and project
  3. Generate API keys for your applications
  4. Test the gateway by making API calls to http://localhost:4001

Helm Chart

You can also deploy doteb to Kubernetes using the Helm chart supplied with your deployment package or local checkout:

helm install llmgateway ./infra/helm/llmgateway

Set global.image.registry and individual *.image.repository values when you publish images to a private registry.

Use the chart values supplied with your deployment package for configuration. Contact support if you need environment-specific image or chart settings.

How is this guide?

Last updated on

On this page

Ready for production?

Ship to production with SSO, audit logs, spend controls, and guardrails your security team will approve.

Explore Enterprise