Deploy Opik LLM Evals Full Stack
Opik LLM evals and tracing, full 7-service stack with basic auth on
Just deployed
opik-python-backend
Just deployed
opik-backend
Just deployed
Just deployed
ClickHouse
Just deployed
MySQL
Just deployed
Just deployed
Deploy and Host Opik on Railway
Opik is Comet's open source platform for LLM evaluation and observability. It records traces and spans from your LLM applications, scores them with LLM-as-a-judge and custom Python metrics, manages prompts and datasets, and runs experiments so you can compare model and prompt versions from one UI.
About Hosting Opik
Hosting Opik means running the full upstream stack: an nginx frontend that serves the React UI and proxies /api to the Java backend, a Python backend for custom metrics and the optimizer, MySQL for state (projects, prompts, datasets), ClickHouse for traces and spans, Redis for locks and queues, and MinIO for attachments. This template uses the official ghcr.io/comet-ml/opik/* images pinned to 2.2.59, replaces the upstream ZooKeeper container with ClickHouse Keeper embedded in the ClickHouse service (the analytics migrations use ON CLUSTER and ReplicatedMergeTree, so coordination is mandatory even on one node), and renders the nginx config at boot so the frontend reaches the backend over Railway's private network. Opik open source ships without authentication, so the template adds HTTP basic auth with a generated password in front of the UI and API.
Common Use Cases
- LLM tracing: log every prompt, completion, tool call and cost from Python or TypeScript apps, LangChain, LlamaIndex, OpenAI, Anthropic and more
- Evaluation: score traces with built in heuristics, LLM-as-a-judge or your own Python metrics
- Experiments: run a dataset through a prompt or agent and compare versions side by side
- Prompt management: version prompts in the Prompt Library and pull them from the SDK
- Self hosted observability: keep production traces inside your own Railway project
Dependencies for Opik Hosting
- MySQL 8.4: state database (included)
- ClickHouse 26.3 with embedded Keeper: analytics database for traces, spans and scores (included)
- Redis 7.2: distributed locks, streams and the optimizer queue (included)
- MinIO: S3 compatible attachment storage, private only (included)
- LLM provider keys: optional, added later in the UI under AI Providers for LLM-as-a-judge and the playground
Deployment Dependencies
- Opik self hosting guide
- Opik docker-compose deployment
- Opik SDK configuration
- Opik GitHub repository
Implementation Details
The public Opik service is nginx on port 5173 with /health open and everything else behind basic auth (user OPIK_AUTH_USER, password OPIK_AUTH_PASSWORD). The /api proxy also accepts the same password as a raw Authorization header, which is how the Opik SDK sends OPIK_API_KEY. The backend start command waits for MySQL, ClickHouse and Redis, runs the Liquibase migrations for both databases, then starts the API. Nothing external is required at boot.
# Opik (frontend)
PORT=5173
OPIK_BACKEND_HOST=${{opik-backend.RAILWAY_PRIVATE_DOMAIN}}:8080
OPIK_AUTH_PASSWORD=${{secret(32)}}
# opik-backend
STATE_DB_URL=${{MySQL.RAILWAY_PRIVATE_DOMAIN}}:3306/opik?createDatabaseIfNotExist=true&...
ANALYTICS_DB_HOST=${{ClickHouse.RAILWAY_PRIVATE_DOMAIN}}
REDIS_URL=${{Redis.REDIS_URL}}
S3_URL=http://${{MinIO.RAILWAY_PRIVATE_DOMAIN}}:9000
OPIK_USAGE_REPORT_ENABLED=false
After deploy, open the Opik service domain, sign in with the basic auth user and password from the Opik service variables, and point the SDK at it:
export OPIK_URL_OVERRIDE=https:///api
export OPIK_API_KEY=
export OPIK_WORKSPACE=default
Why Deploy Opik on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying Opik on Railway, you get the complete seven service stack with generated secrets, persistent volumes for every database, health checks on every application service, managed SSL on the UI, and private networking between the frontend, backends and data stores.
Template Content
opik-python-backend
ghcr.io/comet-ml/opik/opik-python-backend:2.2.59opik-backend
ghcr.io/comet-ml/opik/opik-backend:2.2.59ClickHouse
clickhouse/clickhouse-server:26.3.16.16MySQL
mysql:8.4.2