---
title: "Deploy Mochi AI Chatbot"
description: "Self-hosted AI chatbot for Discord, Telegram, Slack and your website"
category: "Bots"
url: https://railway.com/deploy/mochi-ai-chatbot
---

# Deploy Mochi AI Chatbot

Self-hosted AI chatbot for Discord, Telegram, Slack and your website

**[Deploy Mochi AI Chatbot on Railway](https://railway.com/template/mochi-ai-chatbot)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/mochi-ai-chatbot/manifest.json

- **Creator:** BoyuanGao's Projects
- **Category:** Bots
- **Total deploys:** 1

## Template content

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

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

### am-young-fun/mochi:latest

- **Image:** ghcr.io/am-young-fun/mochi:latest
- **Public domain:** Yes

## Documentation

# Deploy and Host Mochi AI Chatbot on Railway

Mochi is an open source AI chatbot you run yourself. Give it a name, a personality and your own documents, then connect it to Discord, Telegram, Slack, QQ, LINE or a chat window on your website. It remembers the people it talks to, and a web dashboard shows exactly what it remembers and lets you make it forget.

More details: https://www.mochichatbot.com

## About Hosting Mochi AI Chatbot

This template deploys Mochi from its prebuilt Docker image together with a PostgreSQL database, so bots, memory, knowledge files and settings survive every redeploy without a volume. Railway gives it a public HTTPS address, which the website chat widget and the dashboard use. During deploy you can paste a Flatkey API key (new Flatkey accounts get $1 in free credit), or leave it empty and add it later in the dashboard. After the first deploy, open your Railway URL with /dashboard at the end, copy the one-time setup code from the service logs, and choose an admin password. Mochi needs one instance only.

## Common Use Cases

- An AI companion or character for your Discord server or Telegram group, with memory of each member
- A support bot that answers customer questions from your FAQ, documents or web pages, on your site or in LINE
- A website chat widget with an animated character, in any of the languages your visitors use

## Dependencies for Mochi AI Chatbot Hosting

- PostgreSQL (included in this template) for memory, knowledge bases and settings
- A Flatkey API key for the AI models (https://flatkey.ai)

### Deployment Dependencies

- Mochi on GitHub: https://github.com/AM-young-fun/Mochi-ai-chatbot
- Setup guide and video tutorial: https://www.mochichatbot.com
- Get a Flatkey key: https://flatkey.ai

### Implementation Details

Mochi runs the public image ghcr.io/am-young-fun/mochi:latest and reads its database from DATABASE_URL, which points at the template's PostgreSQL service. Each bot can use a different model for chat, images, memory and web search, and has its own daily token budget. Backups of a bot's memory, knowledge and settings can be downloaded and imported from the dashboard.

## Why Deploy Mochi AI Chatbot 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 Mochi AI Chatbot 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

- [Telegram JavaScript Bot](https://railway.com/deploy/5lRkWa) — A template for Telegram bot in JavaScript using grammY
- [Cobalt Tools [Updated Nov ’26]](https://railway.com/deploy/cobalt) — Cobalt Tools [Nov ’26] (Media Downloader, Converter & Automation) Self Host
- [Telegram Gateway](https://railway.com/deploy/railway-telegram-gateway) — Multi-bot Telegram webhook gateway with WebSocket event streaming

Open this page in a browser: https://railway.com/deploy/mochi-ai-chatbot
