---
title: "Deploy GPT-OSS 20B"
description: "[Jun '26] Self-host GPT-OSS 20B on Railway with a chat UI."
category: "AI/ML"
url: https://railway.com/deploy/gpt-oss-20b
---

# Deploy GPT-OSS 20B

[Jun '26] Self-host GPT-OSS 20B on Railway with a chat UI.

**[Deploy GPT-OSS 20B on Railway](https://railway.com/template/gpt-oss-20b)**

- **Creator:** Heimdall
- **Category:** AI/ML
- **Total deploys:** 11

## Template content

### GPT-OSS 20B https://devicons.railway.com/i/chatgpt.svg

- **Image:** ollama/ollama
- **Start command:** `bash -c "ollama serve & sleep 5 && ollama pull gpt-oss:20b && wait"`

### Open-WebUI https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/open-webui-light.svg

- **Image:** ghcr.io/open-webui/open-webui
- **Public domain:** Yes

## Documentation

![OSS](https://ollama.com/assets/library/gpt-oss/e9da5025-e172-441d-9f06-8dfa797da9b0)
# Deploy and Host GPT-OSS 20B on Railway

**GPT-OSS 20B** is a powerful open-weight, 20-billion-parameter large language model designed for reasoning, coding, and chat-based interactions. With this template, you can deploy it in minutes on **Railway**, complete with a built-in API and browser-based chat interface powered by **Ollama** and **OpenWebUI**.

![ChatUI](https://ollama.com/assets/library/gpt-oss/343d558d-a3bc-472e-9956-37fdc3cc4f6c)
---

## About Hosting GPT-OSS 20B

Hosting GPT-OSS 20B on Railway gives you a fully self-contained AI stack. It uses **Ollama** as the backend model server and **OpenWebUI** as the chat interface, preconfigured to run together automatically. Once deployed, Ollama will pull and serve the `gpt-oss:20b` model while OpenWebUI provides a clean interface for chat. You’ll also get a ready-to-use **API endpoint**, allowing you to call the model directly from any app, service, or workflow.

The setup includes persistent storage for models, so downloads only happen once, and can scale up easily by adjusting your Railway plan.
[![Deploy on Railway](https://railway.com/button.svg)](https://railway.com/deploy/tCe9Yx?referralCode=QXdhdr&amp;utm_medium=integration&amp;utm_source=template&amp;utm_campaign=generic)

---


## System Requirements

| Resource | Recommended | Notes |
|-----------|--------------|-------|
| **CPU** | 4 vCPUs + | Required for model inference |
| **RAM** | 24 GB + | GPT-OSS 20B (≈14 GB quantized) needs extra memory overhead |
| **Disk** | 20 GB + | Model stored at `/root/.ollama` |
| **Network** | Stable connection | Required for initial model download |

💡 **Railway Hosting Tip:** Railway’s free plan includes limited CPU and RAM, which may not be sufficient for large models like GPT-OSS 20B. You can deploy the stack ([Link](https://railway.com/deploy/ollama-openwebui-or-self-host-your-own-c?referralCode=QXdhdr&amp;utm_medium=integration&amp;utm_source=template&amp;utm_campaign=generic)) on the free tier to test configuration, but for actual model usage, upgrade to a **Pro Plan** with more RAM and compute.  
If you only want to explore the chat interface, try the **lightweight version** of this template (with smaller models like Mistral 7B or Gemma 2B).

---

## Common Use Cases

- 🧠 Host a **private ChatGPT-style assistant** using GPT-OSS 20B  
- ⚙️ Call the **API endpoint** from LangChain, Flowise, or any external application  
- 💬 Prototype and test **custom LLM agents or workflows** using open-weight models  

---

## Dependencies for GPT-OSS 20B Hosting

- **Ollama** — model server handling GPT-OSS 20B inference and API hosting  
- **OpenWebUI** — web-based chat interface for interacting with GPT-OSS 20B 

### Deployment Dependencies

- **GPT-OSS Models:** [ollama.com/library/gpt-oss](https://ollama.com/library/gpt-oss)  
- **Ollama Docs:** [docs.ollama.com](https://docs.ollama.com)  
- **OpenWebUI:** [github.com/open-webui/open-webui](https://github.com/open-webui/open-webui)  
- **Railway Docs:** [docs.railway.app](https://docs.railway.app)
- You can read more about the models here: [Link](https://openai.com/index/introducing-gpt-oss/)


---

## FAQ

**1. What is GPT-OSS 20B?**  
GPT-OSS 20B is an open-weight large language model with 20 billion parameters, built for text, reasoning, and code generation. It’s an open alternative to GPT-style models that can run locally via Ollama.

**2. Is GPT-OSS 20B free to use?**  
Yes, the model itself is open source and free. You only pay for the hosting resources used on Railway.

**3. Can I deploy GPT-OSS 20B on Railway’s free plan?**  
You can deploy it, but performance will be limited due to memory constraints. For smooth usage, upgrade to a **Pro Plan** with higher CPU and RAM.

**4. Do I need a GPU to run GPT-OSS 20B?**  
No — Ollama supports CPU inference, though GPU acceleration improves performance significantly.

**5. How can I access the GPT-OSS API?**  
After deployment, use the endpoint provided in Railway:  
```
http://.railway.internal:11434
```
You can send POST requests to `/api/generate` or connect directly from LangChain or other frameworks.

**6. What happens after redeploys?**  
Downloaded models remain stored in Railway’s persistent volume, so they don’t re-download each time.

---

## Why Deploy GPT-OSS 20B 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 GPT-OSS 20B 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

- [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/gpt-oss-20b
