What happens when you click Deploy: a guide to Railway templates
A plain-English guide to one-click Railway templates. Required keys, generated secrets, volumes, custom domains, updates and keeping costs low.By chin · Oct 4, 2026 · 5 min read
Every template on this site has a Deploy button. One click later you have a running copy of an open-source app on Railway, often with its own database, domain and HTTPS certificate. This guide explains what happens behind that button, what you are asked for and why, and what to do after the app is live, so nothing surprises you later.
What a template actually is
A Railway template is a saved recipe for a project. It describes:
- the services to create: the app itself and anything it depends on, such as Postgres, Redis or MongoDB
- where each service comes from: a GitHub repository that Railway builds, or a ready-made Docker image
- the variables each service needs, with defaults where sensible
- volumes, so databases and uploads keep their data
- networking, meaning which services get a public URL
When you click Deploy, Railway turns that recipe into a new project in your account. You own the result: the services, the data, and the bill.
Step 1: the deploy screen
The deploy page lists the services that will be created and any variables that need your input. Variables come in three kinds:
- Required, no default. Typically API keys, such as
OPENAI_API_KEYorFIRECRAWL_API_KEY. Only you can supply these, so Railway won't deploy until they are filled in. Each template page on this site lists them under Before you deploy, so you can get the keys ready first. - Optional, with a default. Settings like titles, ports and feature flags. The defaults work, and you can change them later.
- Generated. Passwords and secrets that templates create automatically with Railway's
secret()function, so every deployment gets unique credentials. Nobody, including the template author, knows them.
Step 2: how services find each other
Multi-service templates are connected with reference variables. Instead of hard-coding a database URL, the app's variable points at the database service, for example
${{Postgres.DATABASE_URL}}. Railway fills in the real value at deploy time, and keeps it correct if credentials change.Services in one project talk over Railway's private network (
*.railway.internal host names). Traffic between your app and its database never crosses the public internet, and the database doesn't need a public URL at all.You can see every connection in the project canvas: each service is a box, and you can open any of them to inspect its variables, logs and metrics.
Step 3: data and volumes
Containers are disposable. Anything written to a container's disk is lost on the next deploy unless it's on a volume. Templates attach volumes where data lives:
- databases (Postgres, MongoDB, Redis) keep their data directories on volumes
- apps that store uploads mount a volume for them. LibreChat Lite, for example, puts both MongoDB and Meilisearch on volumes
- some apps keep only configuration on a volume. SearXNG stores its settings there, so your customisations survive redeploys
Check before relying on an app: open each service and look for an attached volume. If an app stores users or files and has no volume, attach one at the app's data directory (its README will say which). Our guide to self-hosted ChatGPT alternatives covers one such case.
Step 4: domains and HTTPS
Public services get a generated
*.up.railway.app domain with HTTPS. To use your own domain:- Open the service, then Settings → Networking → Custom Domain.
- Add the domain and create the DNS record Railway shows you.
- Railway issues and renews the TLS certificate automatically.
Some apps need to know their public URL, usually through a variable like
HOST_NAME, BASE_URL or CORS_ORIGIN. Update it when you switch domains.Step 5: lock it down
Most self-hosted apps assume they're private. Before you share a link:
- Turn on authentication where the app supports it. For example, Stirling-PDF has
DOCKER_ENABLE_SECURITY, and chat apps let you disable open registration. - Create the admin account immediately after deploying. On many apps, the first person to register becomes the admin.
- Keep API keys in variables, never in code or shared screenshots. For extra safety, Railway can seal a variable so its value can no longer be read back in the dashboard.
Updates: how your copy stays current
Your deployment doesn't change by itself when the template author updates the template, and that's a feature: nothing breaks unexpectedly.
- Image-based services run a specific Docker image tag. Redeploying pulls the latest version of that tag. Pin a specific version tag in the service settings if you want full control.
- Repository-based services build from the template's source repository. Railway can show when the upstream source has updates available. If you want to customise the code, eject the service to your own GitHub repository from its settings, and from then on you control every change.
Before upgrading anything with a database, read the app's release notes for migration steps.
Costs: what you pay for
Railway bills for the resources your services use (CPU, memory, storage and network egress) rather than a fixed price per app. A few habits keep spending predictable:
- Set a usage limit in your workspace settings, so a misbehaving service cannot run up a surprise bill.
- Watch the metrics tab for each service for the first few days, to see what it really uses.
- Remove what you don't use. Deleting a project stops all of its services, so delete experiments when you're done.
- Remember model costs. For AI templates, the API provider (OpenAI, OpenRouter, Groq and so on) bills you separately per token. Set spending caps there too.
Frequently asked questions
Do I need a credit card or a paid plan?
Railway has a trial and several plans. Check Railway's pricing page for current details, as resource allowances change over time.
Can I move a deployed template to another workspace?
Yes. Projects can be transferred between workspaces from the project settings.
What if a deploy fails?
Open the failing service and read its Deploy Logs. The most common causes are a missing or wrong API key, or a variable pointing at the wrong domain. Fix the variable and redeploy.
Who maintains these templates?
The templates on this site are published and maintained by chin. The apps themselves are open-source projects maintained by their own communities, and each template page links to its source.
Templates in this guide
More guides
- Build a self-hosted Perplexity alternative with Morphic, SearXNG and FirecrawlSelf-host an AI answer engine with cited sources. Compare Morphic, Open DeepResearch and Fireplexity, and add private search with SearXNG or Whoogle.
- How to self-host Excalidraw with real-time collaborationRun your own Excalidraw whiteboard with live, end-to-end encrypted collaboration on Railway. Covers how the two services fit together, setup, and common fixes.
- Self-hosted ChatGPT alternatives: Open WebUI vs LibreChat vs big-AGICompare three open-source ChatGPT-style interfaces you can self-host on Railway, where each one stores your chats, and which to pick for you or your team.
