Railway
A Project is a workspace-scoped namespace. A Service is a container — a public image, an Effect program Alchemy bundles, or a canvas Function. Postgres, MySQL, Mongo, Redis, Volumes, Variables, and Buckets live in the same TypeScript program.
The production environment is created with the Project. Extra
environments (staging) are a separate resource. Workspace is not
a resource — Alchemy uses me.workspace ?? me.workspaces[0].
Set up your workspace and API token, then start the tutorial.
Compute
Section titled “Compute”- Projects — the parent for every
other resource. Alchemy generates a unique name unless you pass
one.
https://railway.com/project/{projectId}is the dashboard. - Services — a container in a
Project. Pass
imagefor a public tag (hashicorp/http-echo),mainfor an Effect program, orrepofor GitHub.healthcheck/cronSchedule/buildCommandmatch Railway IaC.urlishttps://{name}.up.railway.app. Railway load-balances public traffic; Alchemy does not pin a replica count. - Functions, templates & VMs —
Effect-native canvas Functions (
main, no registry), inlinesource/ cron, marketplace templates, sandboxes, and cloud agents. - Environments — extra deploy
environments under a Project. Do not recreate production —
it is
project.environmentId. - Regions — where a Service, Volume,
or database instance runs (
us-west2,us-east4, …). Buckets use a shorter set (sjc,iad,ams,sin).
Frontend
Section titled “Frontend”- Websites — Vite, Astro,
Next.js, Nuxt, React Router, SolidStart, SvelteKit, TanStack
Start, Waku, Octane, Foldkit, Vocs, and StaticSite. Each builds
your app and deploys a
Service from a generated Dockerfile
Railway builds. URL is
*.up.railway.appor a custom domain. Vite,Astro,Next.js,Nuxt,React Router,SolidStart,SvelteKit,TanStack Start,Waku,Octane,Foldkit,Vocs,StaticSite.
- Volumes — block disk in a Project.
Create one, then mount it into a Service with
MountVolume(volume, { path }). Snapshot withVolumeBackup. - Postgres — official SSL Postgres
image, a Volume,
DATABASE_URL, and an optional public TCP proxy. BindConnectPostgreson a Service; pass the connection string to Drizzle or SQL. - MySQL — official
mysqlimage,MYSQL_URL,ConnectMySQL. - Mongo — official
mongoimage,MONGO_URL,ConnectMongo. - Redis —
redis:7orbitnami/redis. BindReadWriteRedison a Service. - Buckets — S3-compatible object
storage. Bind
PutObject/GetObjecton a Service.
Variables
Section titled “Variables”- Variables —
Config.redactedin a Service for values from.env.Railway.Variablewhen Railway should own a value shared across services.Railway.ref(Db, "DATABASE_URL")emits${{Db.DATABASE_URL}}(IaCdb.env.DATABASE_URL). The plaintext is never stored in attributes.
Networking
Section titled “Networking”- Custom domains, TCP & private networks —
your hostname on a Service (
CustomDomain), public TCP for Postgres/MySQL/Mongo/Redis (TcpProxyon*.proxy.rlwy.net), and named private meshes (PrivateNetwork+PrivateNetworkEndpoint). HTTP Services already get a generated*.up.railway.appdomain.
What are you building?
Section titled “What are you building?”| You’re building | Reach for |
|---|---|
| An HTTP API on Railway | Project + Service |
| A Vite SPA | Website.Vite |
| An SSR site (Astro, Next, Nuxt, …) | Website |
| A raw container | Service with an image |
| An Effect Function (no registry) | Function |
| A canvas / cron Function | Function with source |
| A background worker | Service with ServerHost.run |
| Persistent disk | Volume + MountVolume (one volume per service) |
| Volume snapshot | VolumeBackup |
| Postgres | Postgres + ConnectPostgres |
| MySQL | MySQL + ConnectMySQL |
| Mongo | Mongo + ConnectMongo |
| Redis | Redis + ReadRedis / WriteRedis / ReadWriteRedis |
| Object storage | Bucket + PutObject / GetObject |
| Staging next to production | Environment |
| Config / API tokens | Config.redacted. Railway.Variable when Railway should own it |
| Cross-service env | Railway.ref |
| Your own domain | CustomDomain |
| Laptop access to Postgres | TcpProxy (or Postgres public: true) |
| Custom private DNS | PrivateNetwork |
| Trusted call between Services | Schemaless RPC — bindService / bindFunction, private mesh only |
Where next
Section titled “Where next”- Setup — create a Railway workspace, generate an account token, and connect alchemy.
- Tutorial — from empty directory to a Project running an HTTP Service with a mounted Volume and a Variable.
- Websites — Vite, Astro, Next.js, and other framework sites as a container Service.
examples/railway-service— every resource and binding in one stack (Project, Environment, Variable, Volume, Postgres, MySQL, Redis, Bucket, TcpProxy, image Service, Effect Function, canvas cron Function, Effect Api + Worker,Railway.ref, canvas Group).- Providers reference — generated API docs for every Railway resource Alchemy ships.