---
title: "Deploy bolt.diy AI App Builder + Auth Gateway"
description: "AI full stack app builder behind a password gateway, bring any LLM key"
category: "AI/ML"
url: https://railway.com/deploy/boltdiy-ai-app-builder-auth-gateway
---

# Deploy bolt.diy AI App Builder + Auth Gateway

AI full stack app builder behind a password gateway, bring any LLM key

**[Deploy bolt.diy AI App Builder + Auth Gateway on Railway](https://railway.com/template/boltdiy-ai-app-builder-auth-gateway)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/boltdiy-ai-app-builder-auth-gateway/manifest.json

- **Creator:** Protemplate
- **Category:** AI/ML
- **Total deploys:** 2

## Template content

### bolt-gateway https://raw.githubusercontent.com/stackblitz-labs/bolt.diy/v1.0.3/public/favicon.svg

- **Image:** caddy:2.11-alpine
- **Start command:** `sh -c 'echo c2V0IC1lCjogIiR7UE9SVDo/UE9SVCBpcyByZXF1aXJlZH0iCjogIiR7Qk9MVF9VU0VSTkFNRTo/Qk9MVF9VU0VSTkFNRSBpcyByZXF1aXJlZH0iCjogIiR7Qk9MVF9QQVNTV09SRDo/Qk9MVF9QQVNTV09SRCBpcyByZXF1aXJlZH0iCjogIiR7VVBTVFJFQU06P1VQU1RSRUFNIGlzIHJlcXVpcmVkfSIKSEFTSD0iJChjYWRkeSBoYXNoLXBhc3N3b3JkIC0tcGxhaW50ZXh0ICIkQk9MVF9QQVNTV09SRCIpIgpwcmludGYgJyVzXG4nIFwKICAneycgXAogICcgIGF1dG9faHR0cHMgb2ZmJyBcCiAgJyAgYWRtaW4gb2ZmJyBcCiAgJyAgc2VydmVycyB7JyBcCiAgJyAgICBwcm90b2NvbHMgaDEgaDJjJyBcCiAgJyAgfScgXAogICd9JyBcCiAgIjokUE9SVCB7IiBcCiAgJyAgaGFuZGxlIC9nYXRld2F5LWhlYWx0aCB7JyBcCiAgJyAgICByZXNwb25kICJvayIgMjAwJyBcCiAgJyAgfScgXAogICcgIEBjcm9zc3NpdGVfYXBpIHsnIFwKICAnICAgIHBhdGggL2FwaS8qJyBcCiAgJyAgICBoZWFkZXIgU2VjLUZldGNoLVNpdGUgY3Jvc3Mtc2l0ZScgXAogICcgIH0nIFwKICAnICBoYW5kbGUgeycgXAogICcgICAgYmFzaWNfYXV0aCB7JyBcCiAgIiAgICAgICRCT0xUX1VTRVJOQU1FICRIQVNIIiBcCiAgJyAgICB9JyBcCiAgJyAgICByZXNwb25kIEBjcm9zc3NpdGVfYXBpICJjcm9zcy1zaXRlIEFQSSByZXF1ZXN0IGJsb2NrZWQiIDQwMycgXAogICIgICAgcmV2ZXJzZV9wcm94eSAkVVBTVFJFQU0geyIgXAogICcgICAgICBmbHVzaF9pbnRlcnZhbCAtMScgXAogICcgICAgfScgXAogICcgIH0nIFwKICAnfScgPiAvZXRjL2NhZGR5L0NhZGR5ZmlsZQpleGVjIGNhZGR5IHJ1biAtLWNvbmZpZyAvZXRjL2NhZGR5L0NhZGR5ZmlsZSAtLWFkYXB0ZXIgY2FkZHlmaWxlCg== | base64 -d > /tmp/start.sh && exec sh /tmp/start.sh'`
- **Health check:** /gateway-health
- **Public domain:** Yes

### bolt-diy https://raw.githubusercontent.com/stackblitz-labs/bolt.diy/v1.0.3/public/favicon.svg

- **Image:** ghcr.io/stackblitz-labs/bolt.diy:v1.0.3
- **Start command:** `pnpm run start`
- **Health check:** /api/health

## Documentation

# Deploy and Host bolt.diy on Railway

bolt.diy is the open source version of Bolt.new: describe an app in plain language and an AI model writes it, installs its packages and runs it live in your browser, with a code editor, terminal and preview side by side. You choose the model: OpenAI, Anthropic, Gemini, OpenRouter, DeepSeek, Groq, xAI, Mistral, any OpenAI compatible endpoint, or your own Ollama server.

## About Hosting bolt.diy

This template runs the official prebuilt image pinned to the current release, `ghcr.io/stackblitz-labs/bolt.diy:v1.0.3`, so nothing is compiled on Railway. bolt.diy has no login of its own and the server uses your provider keys for anyone who can reach it, so the app gets no public domain. A small Caddy gateway is the only way in: it asks for a username and a generated password, then proxies to bolt.diy over Railway's private network, streaming chat responses and keeping the cross origin isolation headers the in browser runtime needs.

The template also fixes the two things that break most bolt.diy deployments on Railway: Vite refusing unknown host names (which fails Railway's healthcheck and shows "Blocked request" on the public URL), and provider keys set as variables never reaching the app.

## Common Use Cases

- **Prototype full stack apps from a prompt** with the model and budget you choose
- **A private Bolt for a small team**, sharing one set of provider keys behind one password
- **Use your own gateway or local models**: point it at LiteLLM, OpenRouter or an Ollama service in the same Railway project

## Dependencies for bolt.diy Hosting

- **An LLM provider**: an API key or an OpenAI compatible / Ollama endpoint. Optional at deploy time; you can also paste keys in the bolt.diy settings
- **A Chromium based browser** (Chrome, Edge, Brave): generated apps run in StackBlitz WebContainers inside your browser

### Deployment Dependencies

- [bolt.diy GitHub repository](https://github.com/stackblitz-labs/bolt.diy)
- [Upstream Dockerfile and compose file](https://github.com/stackblitz-labs/bolt.diy/blob/v1.0.3/docker-compose.yaml)
- [Caddy basic_auth](https://caddyserver.com/docs/caddyfile/directives/basic_auth)

### Implementation Details

| Service | Image | Public | Purpose |
|---------|-------|--------|---------|
| bolt-gateway | `caddy:2.11-alpine` | yes | Password prompt and reverse proxy |
| bolt-diy | `ghcr.io/stackblitz-labs/bolt.diy:v1.0.3` | no | The app, port 5173, private only |

```env
# bolt-gateway
BOLT_USERNAME=admin
BOLT_PASSWORD=${{secret(24)}}
UPSTREAM=${{bolt-diy.RAILWAY_PRIVATE_DOMAIN}}:5173

# bolt-diy
CLOUDFLARE_INCLUDE_PROCESS_ENV=true
__VITE_ADDITIONAL_SERVER_ALLOWED_HOSTS=${{bolt-gateway.RAILWAY_PUBLIC_DOMAIN}},healthcheck.railway.app,.railway.internal
OPENAI_API_KEY=            # optional, as are ANTHROPIC_API_KEY, OPEN_ROUTER_API_KEY, OLLAMA_API_BASE_URL and others
```

First steps after deploy:

1. Open the **bolt-gateway** service, copy `BOLT_PASSWORD` from its Variables tab, then open its public URL and sign in as `admin`.
2. Pick a provider in the model selector. Either paste a key there (kept in your browser) or set it on the **bolt-diy** service, for example `OPENAI_API_KEY`, and let it redeploy.
3. Type a prompt. The app is generated and runs in your browser.

Good to know: your chats and projects are stored in your browser, not on the server, so use the export option in settings to back them up or move them to another browser. Any key set on the bolt-diy service is usable by everyone who knows the gateway password. If you add a custom domain to bolt-gateway, append it to `__VITE_ADDITIONAL_SERVER_ALLOWED_HOSTS` on bolt-diy.

## Why Deploy bolt.diy 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 bolt.diy on Railway, you get a pinned, prebuilt release behind a password, with health checks, managed SSL and private networking, and none of the host blocking or missing key problems that trip up a plain deploy.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [Weaviate](https://railway.com/deploy/weaviate-1) — Vector database with hybrid search and an API key-protected API
- [Möbius Personal AI OS](https://railway.com/deploy/mobius-v01-personal-ai-os) — Self-hosted AI agent that builds and runs apps for you, with memory.

Open this page in a browser: https://railway.com/deploy/boltdiy-ai-app-builder-auth-gateway
