Deploy NextChat

Private chat UI for OpenAI, Claude, Gemini and more, behind an access code

Deploy NextChat

Deploy and Host NextChat on Railway

NextChat (formerly ChatGPT-Next-Web) is an open-source web chat interface for large language models. It works with OpenAI, Anthropic Claude, Google Gemini, DeepSeek, xAI and other providers, plus any OpenAI-compatible endpoint. It supports prompt templates ("masks"), Markdown, streaming replies and a responsive layout for desktop and mobile.

About Hosting NextChat

NextChat is a single Next.js server with no database. This template runs the official yidadaa/chatgpt-next-web image, pinned to release v2.16.1 by digest, behind a Railway domain with a health check on /. Chats and settings are stored in each visitor's browser, so the server needs no volume. The server's main job is to proxy chat requests to your AI provider. To stop the public URL from becoming an open proxy for your API key, the template generates a 32-character access code (CODE) at deploy time. Visitors must enter it before the server will use your provider keys. Add the provider keys you want after deploying.

Common Use Cases

  • A private ChatGPT-style chat page for yourself, a family or a small team, using your own API keys
  • One interface for several providers (OpenAI, Claude, Gemini, DeepSeek, xAI) or a self-hosted OpenAI-compatible model server
  • Sharing access with others through an access code without handing out the provider API key

Dependencies for NextChat Hosting

  • An API key from at least one supported AI provider (for example OpenAI, Anthropic or Google), or an OpenAI-compatible endpoint
  • No database or volume: chat history is kept in the browser

Deployment Dependencies

Implementation Details

After deploying, open the service's Variables tab to find the generated CODE. In NextChat, open Settings → Access Code and paste it. Then add at least one provider key, such as OPENAI_API_KEY, ANTHROPIC_API_KEY or GOOGLE_API_KEY, and Railway redeploys the service. CODE can hold several codes separated by commas, one per person.

Visitors who enter their own API key in Settings can chat without the access code, but they use their own key and never yours. Set HIDE_USER_API_KEY=1 to turn that option off. NextChat writes access codes and your server API keys to its deploy logs, so only give Railway project access to people you trust.

Why Deploy NextChat 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 NextChat 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

More templates in this category

View Template
Chat Chat
Chat Chat, your own unified chat and search to AI platform.

okisdev
117
View Template
Weaviate
Vector database with hybrid search and an API key-protected API

GitHub Locker
1
View Template
Möbius Personal AI OS
Self-hosted AI agent that builds and runs apps for you, with memory.

bento
1