Deploy WrenAI
GenBI stack for natural language database queries & SQL charts & AI Insight
wren-ui
Just deployed
/app/data
qdrant
Just deployed
/qdrant/storage
wren-engine
Just deployed
/usr/src/app/etc
ibis-server
Just deployed
wren-ai-service
Just deployed
Deploy and Host WrenAI on Railway
WrenAI is a Generative BI platform that lets users interact with data using natural language. It can translate questions into SQL, generate charts, and provide AI-powered insights. The Railway deployment runs WrenAI as a multi-service stack consisting of Wren UI, Wren Engine, Ibis Server, Wren AI Service, and Qdrant.
About Hosting WrenAI
Hosting WrenAI on Railway involves deploying five Docker-based services: wren-ui, wren-engine, ibis-server, wren-ai-service, and qdrant. The stack uses Railway private networking for communication between services, with Wren UI as the only publicly accessible service. Persistent Railway Volumes are required for Wren Engine configuration, Wren UI's SQLite database, and Qdrant's vector storage. Wren AI Service requires an OpenAI API key and a configuration file that points to the Qdrant service through its Railway private domain. No PostgreSQL or Redis service is required for this deployment. Railway provides the service networking, public HTTPS endpoint, container deployment, and persistent storage needed to run the complete WrenAI stack.
Common Use Cases
- Natural-language querying and exploration of business data
- Generating SQL queries, charts, and AI-powered data insights
- Building self-hosted Generative BI applications for data analysis
Dependencies for WrenAI Hosting
- OpenAI API key
- Qdrant vector database service
- Persistent Railway Volumes for application and vector data
- Five Railway services:
wren-ui,wren-engine,ibis-server,wren-ai-service, andqdrant
Deployment Dependencies
- Wren AI Documentation
- Wren AI GitHub Repository
- Railway Services Documentation
- Railway Variables Reference
- Railway Volumes Reference
Implementation Details
Deploy the following five services as Docker Image services. Railway supports public Docker images, including images hosted on GitHub Container Registry.
| Service | Image | Port | Public |
|---|---|---|---|
wren-engine | ghcr.io/canner/wren-engine:latest | 8080 | No |
wren-ui | ghcr.io/canner/wren-ui:latest | 3000 | Yes |
ibis-server | ghcr.io/canner/wren-engine-ibis:latest | 8000 | No |
wren-ai-service | ghcr.io/canner/wren-ai-service:latest | 5555 | No |
qdrant | qdrant/qdrant:latest | 6333, 6334 | No |
Only wren-ui should have a Railway public domain. The other services communicate through Railway's private networking.
wren-engine
Use:
ghcr.io/canner/wren-engine:latest
Configure port 8080 and add a Railway Volume mounted at:
/usr/src/app/etc
Set:
NODE_ENV=production
Create /usr/src/app/etc/config.properties with:
node.environment=production
wren.directory=/usr/src/app/etc/mdl
wren-ui
Use:
ghcr.io/canner/wren-ui:latest
Configure port 3000 and add a Railway Volume mounted at:
/app/data
Set the following variables:
| Variable | Required | Description |
|---|---|---|
DB_TYPE | Yes | Uses SQLite for the Wren UI database |
SQLITE_FILE | Yes | SQLite database path |
IBIS_SERVER_ENDPOINT | Yes | Private endpoint for Ibis Server |
WREN_AI_ENDPOINT | Yes | Private endpoint for Wren AI Service |
WREN_ENGINE_ENDPOINT | Yes | Private endpoint for Wren Engine |
Raw Editor:
DB_TYPE=sqlite
SQLITE_FILE=/app/data/db.sqlite3
IBIS_SERVER_ENDPOINT=http://${{ibis-server.RAILWAY_PRIVATE_DOMAIN}}:8000
WREN_AI_ENDPOINT=http://${{wren-ai-service.RAILWAY_PRIVATE_DOMAIN}}:5555
WREN_ENGINE_ENDPOINT=http://${{wren-engine.RAILWAY_PRIVATE_DOMAIN}}:8080
Enable Public Networking and generate a Railway domain for this service.
ibis-server
Use:
ghcr.io/canner/wren-engine-ibis:latest
Configure port 8000.
Set:
WREN_ENGINE_ENDPOINT=http://${{wren-engine.RAILWAY_PRIVATE_DOMAIN}}:8080
wren-ai-service
Use:
ghcr.io/canner/wren-ai-service:latest
Configure port 5555.
Set:
| Variable | Required | Description |
|---|---|---|
CONFIG_PATH | Yes | Location of the Wren AI configuration file |
PYTHONUNBUFFERED | Yes | Enables unbuffered Python output |
QDRANT_HOST | Yes | Private hostname of the Qdrant service |
SHOULD_FORCE_DEPLOY | Yes | Enables the documented deployment behavior |
WREN_AI_SERVICE_PORT | Yes | Wren AI Service port |
WREN_UI_ENDPOINT | Yes | Private Wren UI endpoint |
WREN_UI_PORT | Yes | Wren UI port |
OPENAI_API_KEY | Yes | OpenAI API key used when OpenAI is selected |
Raw Editor:
CONFIG_PATH=/app/config.yaml
PYTHONUNBUFFERED=1
QDRANT_HOST=${{qdrant.RAILWAY_PRIVATE_DOMAIN}}
SHOULD_FORCE_DEPLOY=1
WREN_AI_SERVICE_PORT=5555
WREN_UI_ENDPOINT=http://${{wren-ui.RAILWAY_PRIVATE_DOMAIN}}:3000
WREN_UI_PORT=3000
OPENAI_API_KEY=YOUR_KEY
Obtain the OpenAI API key from your OpenAI API account. Wren AI's installation documentation requires an OpenAI API key when OpenAI is selected.
Create /app/config.yaml and use the supplied Wren AI configuration. For the Qdrant document store, use the Railway private domain instead of the original service hostname:
type: document_store
provider: qdrant
location: http://${{qdrant.RAILWAY_PRIVATE_DOMAIN}}:6333
embedding_model_dim: 3072
timeout: 120
recreate_index: false
Do not place the OpenAI API key inside config.yaml. Store it as the OPENAI_API_KEY Railway variable.
qdrant
Use:
qdrant/qdrant:latest
Configure ports 6333 and 6334.
Add a Railway Volume mounted at:
/qdrant/storage
Set:
QDRANT__LOG_LEVEL=INFO
Persistent Storage
Create the following Railway Volumes:
| Service | Mount Path | Purpose |
|---|---|---|
wren-engine | /usr/src/app/etc | Wren Engine configuration and model directory |
wren-ui | /app/data | Persistent SQLite database |
qdrant | /qdrant/storage | Persistent vector database storage |
Railway Volumes provide persistent storage for data that must survive deployments.
Private Networking
Use Railway reference variables instead of Docker-style service hostnames. For example:
${{qdrant.RAILWAY_PRIVATE_DOMAIN}}
The service name must exactly match the Railway service name. This allows services to communicate over Railway's private network without exposing internal services publicly.
Do not use:
http://qdrant:6333
Instead, use:
http://${{qdrant.RAILWAY_PRIVATE_DOMAIN}}:6333
The same pattern is used for the Wren Engine, Ibis Server, Wren AI Service, and Wren UI endpoints.
Deployment Order
Deploy the services in this order:
- Create
qdrantand its volume at/qdrant/storage. - Deploy
wren-engineand add its volume at/usr/src/app/etc. - Create
/usr/src/app/etc/config.properties. - Deploy
ibis-server. - Deploy
wren-ai-service. - Add
OPENAI_API_KEYtowren-ai-service. - Create
/app/config.yamlwith the Railway Qdrant reference. - Deploy
wren-uiand add its volume at/app/data. - Enable public networking for
wren-ui. - Generate a Railway domain for
wren-ui. - Open the generated HTTPS domain.
Railway supports deploying public Docker images directly as service sources, and persistent data should be stored in Volumes rather than ephemeral service storage.
No PostgreSQL or Redis service is required for this deployment.
Why Deploy WrenAI 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 WrenAI on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.
Template Content
qdrant
qdrant/qdrant:latestwren-engine
ghcr.io/canner/wren-engineibis-server
ghcr.io/canner/wren-engine-ibis:latestwren-ai-service
ghcr.io/canner/wren-ai-service:latestOPENAI_API_KEY
