OffRail
Self Host

Docker

Run OffRail as a single Docker container — the fastest way to a working instance.

The unified Docker image bundles every service — UI, API, Gateway, PostgreSQL, and Redis — into a single container. It's the fastest way to get a working instance and is ideal for trying OffRail out or running a single low-traffic deployment.

For production, run each service separately with Docker Compose or deploy to Kubernetes with managed Postgres and Redis.

Prerequisites

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

Run the container

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

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

Docker creates 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.

Pin to a specific version instead of latest using the latest release tag.

Accessing your instance

Management commands

# View logs
docker logs offrail

# Restart the container
docker restart offrail

# Stop the container
docker stop offrail

Required configuration

At minimum, set these environment variables:

# 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-...

OffRail supports multiple API keys per provider for load balancing — provide comma-separated values. See Docker Compose for details. Provider env vars also support optional __ENTERPRISE / __PLANS suffix overrides used only for enterprise-plan or plan-based (Chat plan) organizations — see Enterprise and plan provider env overrides.

Next steps

Once your instance 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

How is this guide?

On this page

Ready for production?

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

Explore Enterprise