Deploy bolt.diy AI App Builder + Auth Gateway
AI full stack app builder behind a password gateway, bring any LLM key
bolt-gateway
Just deployed
bolt-diy
Just deployed
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
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 |
# 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:
- Open the bolt-gateway service, copy
BOLT_PASSWORDfrom its Variables tab, then open its public URL and sign in asadmin. - 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. - 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.
Template Content
bolt-gateway
caddy:2.11-alpine
