---
title: "Deploy Chat UI Pro Stack: Self Hosted HuggingChat with Bifrost and Mongo"
description: "The open chat app behind HuggingChat, on any model, with its own database."
category: "AI/ML"
url: https://railway.com/deploy/chat-ui-pro-stack-self-hosted-huggingcha
---

# Deploy Chat UI Pro Stack: Self Hosted HuggingChat with Bifrost and Mongo

The open chat app behind HuggingChat, on any model, with its own database.

**[Deploy Chat UI Pro Stack: Self Hosted HuggingChat with Bifrost and Mongo on Railway](https://railway.com/template/chat-ui-pro-stack-self-hosted-huggingcha)**

- **Creator:** Maxim AI's Projects
- **Category:** AI/ML
- **Total deploys:** 6

## Template content

### Bifrost https://framerusercontent.com/images/k49dViw06yckDjJt5uERdfTSjU.png

- **Image:** maximhq/bifrost:latest
- **Health check:** /health
- **Public domain:** Yes

### ChatUI https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/hugging-face.png

- **Image:** ghcr.io/huggingface/chat-ui:latest
- **Public domain:** Yes

### Postgres https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18

### MongoDB https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/mongodb.svg

- **Image:** mongo:7

## Documentation

# Deploy and Host Hugging Face Chat UI with Railway

Hugging Face Chat UI is the open source codebase that powers HuggingChat, a fast, self hosted chat interface for any OpenAI compatible model. This Pro Stack template runs it on Railway with MongoDB for storage and the Bifrost AI gateway in front, so every model call flows through one governed endpoint while conversations, users, and settings persist in your own database.

## About Hosting Hugging Face Chat UI

The stack is four services: Chat UI, MongoDB, the Bifrost AI gateway, and Postgres. Chat UI serves the SvelteKit chat interface and stores all conversations, users, settings, and assistants in MongoDB. Bifrost holds your real provider keys and handles routing, failover, virtual keys, budgets, and request logging, with Postgres storing its configuration and logs. Chat UI points at Bifrost through a single base URL environment variable and automatically discovers whatever models Bifrost serves, so the app never holds a real provider key itself.

## Common Use Cases

- Run a private, self hosted HuggingChat style interface for a team across any model provider.
- Keep conversations, users, and settings in your own MongoDB instead of a third party service.
- Put budgets and rate limits on shared AI usage so a single team cannot run up an unbounded bill.
- Switch or fail over between model providers centrally in Bifrost without touching the chat app.

## Dependencies for Hugging Face Chat UI Hosting

- MongoDB for conversations, users, settings, and assistants.
- Postgres for Bifrost configuration and request log storage.

### Deployment Dependencies

- Chat UI: https://github.com/huggingface/chat-ui
- Bifrost docs: https://docs.getbifrost.ai
- Bifrost Docker Hub: https://hub.docker.com/r/maximhq/bifrost

### Why Deploy Hugging Face Chat UI 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.

Running Chat UI with Bifrost on Railway gives you a private, multi model chat backed by your own database, with budgets, failover, and a request log under every message from day one.

## 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/chat-ui-pro-stack-self-hosted-huggingcha
