Deployment

Run the Ingate gateway on your own infrastructure: Docker, Docker Compose, Kubernetes, or a single Go binary.

Overview

Ingate can be self-hosted as a single Go binary or Docker container. It requires PostgreSQL 14+ for log storage, prompts, and evals, and optionally Redis 7+ for rate limiting and the prompt cache. This page covers deploying the gateway itself.

Ingate Cloud

Don't want to run infrastructure? The managed option requires no deployment at all: sign up at app.ingateai.com and point your requests at https://api.ingateai.com. See the Quickstart.

Docker

Build

bash
docker build -t ingate .

Multi-stage build: Go compile, then an Alpine runtime. The final image is ~15MB and runs as the non-root user ingate (UID 1000).

Run

bash
docker run -p 7100:7100 \
  -e INGATE_DATABASE_POSTGRESQL_URL=postgres://user:pass@db:5432/ingate \
  -e INGATE_DATABASE_REDIS_URL=redis://cache:6379 \
  ingate

Docker Compose (Full Stack)

bash
docker compose up

Starts Ingate + PostgreSQL + Redis with health-check dependencies.

Configuration in Containers

Use environment variables, which take precedence over config files:

bash
# Server
INGATE_SERVER_PORT=7100
INGATE_SERVER_CORS_ORIGINS=https://app.example.com
INGATE_SERVER_ADMIN_AUTH=true

# Providers
INGATE_PROVIDERS_OPENAI_API_KEY=sk-...
INGATE_PROVIDERS_OPENAI_ENABLED=true

# Database
INGATE_DATABASE_POSTGRESQL_URL=postgres://...
INGATE_DATABASE_REDIS_URL=redis://...

# Auth
INGATE_AUTH_ENABLED=true

Or mount a config file:

bash
docker run -v /path/to/ingate.yaml:/home/ingate/ingate.yaml ingate

See Configuration for the full option reference and env var mapping.

Database Migrations

Migrations are embedded in the binary and run automatically on startup. No external migration tool needed.

The tracking table schema_migrations prevents re-running applied migrations. This is safe for rolling deployments: multiple instances starting simultaneously will not conflict.

Multi-Instance Deployment

Ingate supports running multiple instances behind a load balancer.

What works automatically:

  • Proxy routing (stateless)
  • Logging pipeline (each instance writes to the same PostgreSQL)
  • API endpoints (stateless, query the same database)

Background workers use distributed locks:

  • Eval scheduler: PostgreSQL advisory lock eval-scheduler
  • Retention worker: PostgreSQL advisory lock retention-worker

Only one instance runs each background job at a time. Others skip silently.

Health Checks

bash
GET /healthz

Returns 200 when healthy, 503 when degraded. Includes per-component status.

Kubernetes Probes

yaml
livenessProbe:
  httpGet:
    path: /healthz
    port: 7100
  initialDelaySeconds: 5
  periodSeconds: 15

readinessProbe:
  httpGet:
    path: /healthz
    port: 7100
  initialDelaySeconds: 3
  periodSeconds: 10

Managed Databases

PostgreSQL

The pgx driver supports all connection string parameters:

bash
postgres://user:pass@host:5432/db?sslmode=require&sslrootcert=/path/to/ca.pem
ParameterExampleDescription
sslmoderequire, verify-fullSSL mode
sslrootcert/path/to/ca.pemCA certificate for verification
sslcert/path/to/client.pemClient certificate (mTLS)
sslkey/path/to/client.keyClient key (mTLS)

Redis

bash
redis://[:password@]host:6379[/db]
rediss://[:password@]host:6380[/db]    # TLS

The rediss:// scheme enables TLS automatically.

Graceful Shutdown

On SIGTERM or SIGINT, Ingate shuts down in order:

  1. Stop accepting new HTTP connections (30s drain timeout)
  2. Drain eval pipeline (process buffered tasks)
  3. Drain logging pipeline (flush to PostgreSQL)
  4. Close database connections

Container orchestrators should set terminationGracePeriodSeconds: 45 to allow a full drain.

Resource Requirements

ProfileCPU / RAMPostgreSQLRedis
Minimal (development)1 CPU, 256MB RAMShared instanceOptional
Production (per instance)2 CPU, 512MB RAMDedicated or managed (10+ connections)Shared or managed (rate limiting + cache)

Ingate's memory footprint scales with:

  • Logging pipeline buffer (logging.buffer_size × ~2KB per entry)
  • Eval pipeline buffer (256 × ~1KB per task)
  • Active concurrent proxy connections