Skip to content

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.

  • 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 image for a public tag (hashicorp/http-echo), main for an Effect program, or repo for GitHub. healthcheck / cronSchedule / buildCommand match Railway IaC. url is https://{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), inline source / 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).
  • Volumes — block disk in a Project. Create one, then mount it into a Service with MountVolume(volume, { path }). Snapshot with VolumeBackup.
  • Postgres — official SSL Postgres image, a Volume, DATABASE_URL, and an optional public TCP proxy. Bind ConnectPostgres on a Service; pass the connection string to Drizzle or SQL.
  • MySQL — official mysql image, MYSQL_URL, ConnectMySQL.
  • Mongo — official mongo image, MONGO_URL, ConnectMongo.
  • Redisredis:7 or bitnami/redis. Bind ReadWriteRedis on a Service.
  • Buckets — S3-compatible object storage. Bind PutObject / GetObject on a Service.
  • VariablesConfig.redacted in a Service for values from .env. Railway.Variable when Railway should own a value shared across services. Railway.ref(Db, "DATABASE_URL") emits ${{Db.DATABASE_URL}} (IaC db.env.DATABASE_URL). The plaintext is never stored in attributes.
  • Custom domains, TCP & private networks — your hostname on a Service (CustomDomain), public TCP for Postgres/MySQL/Mongo/Redis (TcpProxy on *.proxy.rlwy.net), and named private meshes (PrivateNetwork + PrivateNetworkEndpoint). HTTP Services already get a generated *.up.railway.app domain.
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 RPCbindService / bindFunction, private mesh only
  • 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.