---
title: "Deploy Open WebUI"
description: "Open WebUI on Postgres with pgvector, admin account set at deploy time"
category: "AI/ML"
url: https://railway.com/deploy/open-webui-8
---

# Deploy Open WebUI

Open WebUI on Postgres with pgvector, admin account set at deploy time

**[Deploy Open WebUI on Railway](https://railway.com/template/open-webui-8)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/open-webui-8/manifest.json

- **Creator:** Dektion Studio
- **Category:** AI/ML
- **Total deploys:** 2

## Template content

### Postgres https://devicons.railway.com/i/postgresql.svg

- **Image:** pgvector/pgvector:pg17

### Open WebUI https://raw.githubusercontent.com/open-webui/open-webui/8bd8b4fac5e059578ac0c74b3c18d11139f88b7d/static/favicon.png

- **Image:** ghcr.io/open-webui/open-webui:v0.11.4
- **Health check:** /health
- **Public domain:** Yes

## Documentation

# Deploy and Host Open WebUI on Railway

[Open WebUI](https://github.com/open-webui/open-webui) is a self-hosted AI chat interface: models from OpenAI-compatible APIs or Ollama, document chat (RAG), tools, web search and accounts for a team.

This template runs the official image (v0.11.4) with Postgres and pgvector, which holds both the app's database and the embeddings of your documents.

## About Hosting Open WebUI

Open WebUI makes the first account that signs up the admin, which is a race on a public URL. It can also create the admin itself at startup from `WEBUI_ADMIN_EMAIL` and `WEBUI_ADMIN_PASSWORD` and then turn sign-up off, so this template uses that: the deploy form asks for your email and the password is generated. Open `OPEN_WEBUI_URL` and sign in with them. Add people from the admin panel, or open sign-up there.

`OPENROUTER_API_KEY` is optional. With it, every OpenRouter model shows up in the model list and uploaded documents are embedded through OpenRouter (`openai/text-embedding-3-small`). Without it, add a connection in Admin Settings; chat and document search need a key either way.

I first ran document embeddings on Open WebUI's built-in local model. That worked, but idle RAM went from 0.73 GB to 0.92 GB, too close to the 1 GB per service that Railway's trial allows, so the template sends embeddings to OpenRouter.

Before publishing I tested it end to end on a fresh deploy. Signing up returned 403 and the admin signed in with the admin role. With an OpenRouter key, 459 models were listed and a chat completion with `openai/gpt-4o-mini` answered. A text file I uploaded finished processing. After a restart the admin signed in again and the saved chat was still there.

## Common Use Cases

- A private ChatGPT-style interface for a team, with any model on OpenRouter or your own API connections
- Upload documents and chat about them, with the embeddings stored in your own Postgres

## Dependencies for Open WebUI Hosting

An OpenRouter key, or another OpenAI-compatible API you add as a connection in Admin Settings.

### Deployment Dependencies

- Open WebUI: https://github.com/open-webui/open-webui
- Docs: https://docs.openwebui.com
- Image: `ghcr.io/open-webui/open-webui:v0.11.4`

### Implementation Details

```
WEBUI_ADMIN_EMAIL / WEBUI_ADMIN_PASSWORD   # admin created at first start, then sign-up is off
ENABLE_SIGNUP=false
DATABASE_URL + VECTOR_DB=pgvector          # one Postgres for app data and embeddings
OPENAI_API_BASE_URL=https://openrouter.ai/api/v1, OPENAI_API_KEY=OPENROUTER_API_KEY
RAG_EMBEDDING_ENGINE=openai                # embeddings through OpenRouter
WEBUI_SECRET_KEY                           # generated
```

Uploads and caches live on a volume at `/app/backend/data`. Open WebUI saves most settings in the database on first start, so later changes belong in Admin Settings rather than in these variables.

To upgrade, change the image tag on the Open WebUI service to a newer release.

Idle, Open WebUI used 0.73 GB of RAM and Postgres 0.10 GB.

## Why Deploy Open WebUI on Railway?

You get your own chat interface on a public HTTPS address with nobody able to claim the admin account, and your conversations and documents stay in a Postgres you control. Idle RAM for both services comes to about $8 a month; model usage is billed by your provider.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.
- [Hermes Agent | OpenClaw Alternative with Dashboard](https://railway.com/deploy/hermes-agent-or-openclaw-alternative-wit) — Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

Open this page in a browser: https://railway.com/deploy/open-webui-8
