---
title: "Deploy WrenAI"
description: "GenBI stack for natural language database queries & SQL charts & AI Insight"
category: "Other"
url: https://railway.com/deploy/wrenai
---

# Deploy WrenAI

GenBI stack for natural language database queries & SQL charts & AI Insight

**[Deploy WrenAI on Railway](https://railway.com/template/wrenai)**

- **Category:** Other

## Template content

### wren-ui

- **Image:** ghcr.io/canner/wren-ui:latest
- **Public domain:** Yes

### qdrant

- **Image:** qdrant/qdrant:latest
- **Public domain:** Yes

### wren-engine

- **Image:** ghcr.io/canner/wren-engine
- **Public domain:** Yes

### ibis-server

- **Image:** ghcr.io/canner/wren-engine-ibis:latest
- **Public domain:** Yes

### wren-ai-service

- **Image:** ghcr.io/canner/wren-ai-service:latest
- **Public domain:** Yes

## Documentation

# 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`, and `qdrant`

### Deployment Dependencies

* [Wren AI Documentation](https://docs.getwren.ai/oss/installation?utm_source=chatgpt.com)
* [Wren AI GitHub Repository](https://github.com/Canner/wren-ai?utm_source=chatgpt.com)
* [Railway Services Documentation](https://docs.railway.com/services?utm_source=chatgpt.com)
* [Railway Variables Reference](https://docs.railway.com/variables/reference?utm_source=chatgpt.com)
* [Railway Volumes Reference](https://docs.railway.com/volumes/reference?utm_source=chatgpt.com)

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

```docker
ghcr.io/canner/wren-engine:latest
```

Configure port `8080` and add a Railway Volume mounted at:

```text
/usr/src/app/etc
```

Set:

```env
NODE_ENV=production
```

Create `/usr/src/app/etc/config.properties` with:

```properties
node.environment=production
wren.directory=/usr/src/app/etc/mdl
```

#### `wren-ui`

Use:

```docker
ghcr.io/canner/wren-ui:latest
```

Configure port `3000` and add a Railway Volume mounted at:

```text
/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:

```env
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:

```docker
ghcr.io/canner/wren-engine-ibis:latest
```

Configure port `8000`.

Set:

```env
WREN_ENGINE_ENDPOINT=http://${{wren-engine.RAILWAY_PRIVATE_DOMAIN}}:8080
```

#### `wren-ai-service`

Use:

```docker
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:

```env
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:

```yaml
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:

```docker
qdrant/qdrant:latest
```

Configure ports `6333` and `6334`.

Add a Railway Volume mounted at:

```text
/qdrant/storage
```

Set:

```env
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:

```text
${{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:

```text
http://qdrant:6333
```

Instead, use:

```text
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:

1. Create `qdrant` and its volume at `/qdrant/storage`.
2. Deploy `wren-engine` and add its volume at `/usr/src/app/etc`.
3. Create `/usr/src/app/etc/config.properties`.
4. Deploy `ibis-server`.
5. Deploy `wren-ai-service`.
6. Add `OPENAI_API_KEY` to `wren-ai-service`.
7. Create `/app/config.yaml` with the Railway Qdrant reference.
8. Deploy `wren-ui` and add its volume at `/app/data`.
9. Enable public networking for `wren-ui`.
10. Generate a Railway domain for `wren-ui`.
11. 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.


## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — [Jul'26] Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/wrenai
