The best way to control Claude Code, Codex and more from any computer or phone

main
mdx 135 lines 7.48 KB
Raw
1 ---
2 title: Railway
3 description: Deploy Effect programs to Railway as Projects, Services, databases, Volumes, and Buckets.
4 ---
5
6 A Project is a workspace-scoped namespace. A Service is a container —
7 a public image, an Effect program Alchemy bundles, or a canvas
8 Function. Postgres, MySQL, Mongo, Redis, Volumes, Variables, and
9 Buckets live in the same TypeScript program.
10
11 The production environment is created with the Project. Extra
12 environments (staging) are a separate resource. Workspace is **not**
13 a resource — Alchemy uses `me.workspace ?? me.workspaces[0]`.
14
15 [Set up your workspace and API token](/railway/setup), then start the
16 [tutorial](/railway/tutorial/part-1).
17
18 ## Compute
19
20 - **[Projects](/railway/compute/projects)** — the parent for every
21 other resource. Alchemy generates a unique name unless you pass
22 one. `https://railway.com/project/{projectId}` is the dashboard.
23 - **[Services](/railway/compute/services)** — a container in a
24 Project. Pass `image` for a public tag (`hashicorp/http-echo`),
25 `main` for an Effect program, or `repo` for GitHub.
26 `healthcheck` / `cronSchedule` / `buildCommand` match Railway IaC.
27 `url` is `https://{name}.up.railway.app`. Railway load-balances
28 public traffic; Alchemy does not pin a replica count.
29 - **[Functions, templates & VMs](/railway/compute/functions)** —
30 Effect-native canvas Functions (`main`, no registry), inline
31 `source` / cron, marketplace templates, sandboxes, and cloud
32 agents.
33 - **[Environments](/railway/compute/environments)** — extra deploy
34 environments under a Project. Do **not** recreate production —
35 it is `project.environmentId`.
36 - **[Regions](/railway/compute/regions)** — where a Service, Volume,
37 or database instance runs (`us-west2`, `us-east4`, …). Buckets use
38 a shorter set (`sjc`, `iad`, `ams`, `sin`).
39
40 ## Frontend
41
42 - **[Websites](/railway/frontend/websites)** — Vite, Astro,
43 Next.js, Nuxt, React Router, SolidStart, SvelteKit, TanStack
44 Start, Waku, Octane, Foldkit, Vocs, and StaticSite. Each builds
45 your app and deploys a
46 [Service](/railway/compute/services) from a generated Dockerfile
47 Railway builds. URL is `*.up.railway.app` or a
48 [custom domain](/railway/networking#custom-domains).
49 - [`Vite`](/railway/frontend/vite), [`Astro`](/railway/frontend/astro),
50 [`Next.js`](/railway/frontend/nextjs), [`Nuxt`](/railway/frontend/nuxt),
51 [`React Router`](/railway/frontend/react-router),
52 [`SolidStart`](/railway/frontend/solidstart),
53 [`SvelteKit`](/railway/frontend/sveltekit),
54 [`TanStack Start`](/railway/frontend/tanstack-start),
55 [`Waku`](/railway/frontend/waku),
56 [`Octane`](/railway/frontend/octane), [`Foldkit`](/railway/frontend/foldkit),
57 [`Vocs`](/railway/frontend/vocs),
58 [`StaticSite`](/railway/frontend/static-site).
59
60 ## Data
61
62 - **[Volumes](/railway/data/volumes)** — block disk in a Project.
63 Create one, then mount it into a Service with
64 `MountVolume(volume, { path })`. Snapshot with `VolumeBackup`.
65 - **[Postgres](/railway/data/postgres)** — official SSL Postgres
66 image, a Volume, `DATABASE_URL`, and an optional public TCP proxy.
67 Bind `ConnectPostgres` on a Service; pass the connection string
68 to Drizzle or SQL.
69 - **[MySQL](/railway/data/mysql)** — official `mysql` image,
70 `MYSQL_URL`, `ConnectMySQL`.
71 - **[Mongo](/railway/data/mongo)** — official `mongo` image,
72 `MONGO_URL`, `ConnectMongo`.
73 - **[Redis](/railway/data/redis)** — `redis:7` or `bitnami/redis`.
74 Bind `ReadWriteRedis` on a Service.
75 - **[Buckets](/railway/data/buckets)** — S3-compatible object
76 storage. Bind `PutObject` / `GetObject` on a Service.
77
78 ## Variables
79
80 - **[Variables](/railway/data/variables)** — `Config.Redacted` in a
81 Service for values from `.env`. `Railway.Variable` when Railway
82 should own a value shared across services. `Railway.ref(Db,
83 "DATABASE_URL")` emits `${{Db.DATABASE_URL}}` (IaC
84 `db.env.DATABASE_URL`). The plaintext is never stored in
85 attributes.
86
87 ## Networking
88
89 - **[Custom domains, TCP & private networks](/railway/networking)** —
90 your hostname on a Service (`CustomDomain`), public TCP for
91 Postgres/MySQL/Mongo/Redis (`TcpProxy` on `*.proxy.rlwy.net`), and
92 named private meshes (`PrivateNetwork` + `PrivateNetworkEndpoint`).
93 HTTP Services already get a generated `*.up.railway.app` domain.
94
95 ## What are you building?
96
97 | You're building | Reach for |
98 | ---------------------------- | ------------------------------------------------------------------------- |
99 | An HTTP API on Railway | [Project](/railway/compute/projects) + [Service](/railway/compute/services) |
100 | A Vite SPA | [`Website.Vite`](/railway/frontend/vite) |
101 | An SSR site (Astro, Next, Nuxt, …) | [`Website`](/railway/frontend/websites) |
102 | A raw container | [Service](/railway/compute/services) with an `image` |
103 | An Effect Function (no registry) | [Function](/railway/compute/functions) |
104 | A canvas / cron Function | [Function](/railway/compute/functions) with `source` |
105 | A background worker | [Service](/railway/compute/services) with `ServerHost.run` |
106 | Persistent disk | [Volume](/railway/data/volumes) + `MountVolume` (one volume per service) |
107 | Volume snapshot | [VolumeBackup](/railway/data/volumes#backups) |
108 | Postgres | [Postgres](/railway/data/postgres) + `ConnectPostgres` |
109 | MySQL | [MySQL](/railway/data/mysql) + `ConnectMySQL` |
110 | Mongo | [Mongo](/railway/data/mongo) + `ConnectMongo` |
111 | Redis | [Redis](/railway/data/redis) + `ReadRedis` / `WriteRedis` / `ReadWriteRedis` |
112 | Object storage | [Bucket](/railway/data/buckets) + `PutObject` / `GetObject` |
113 | Staging next to production | [Environment](/railway/compute/environments) |
114 | Config / API tokens | [`Config.Redacted`](/railway/data/variables). [`Railway.Variable`](/railway/data/variables) when Railway should own it |
115 | Cross-service env | [`Railway.ref`](/railway/data/variables#variable-references) |
116 | Your own domain | [CustomDomain](/railway/networking#custom-domains) |
117 | Laptop access to Postgres | [TcpProxy](/railway/networking#tcp-proxies) (or Postgres `public: true`) |
118 | Custom private DNS | [PrivateNetwork](/railway/networking#private-networks) |
119 | Trusted call between Services | [Schemaless RPC](/railway/compute/services#schemaless-rpc) — `bindService` / `bindFunction`, private mesh only |
120
121 ## Where next
122
123 - [Setup](/railway/setup) — create a Railway workspace, generate an
124 account token, and connect alchemy.
125 - [Tutorial](/railway/tutorial/part-1) — from empty directory to a
126 Project running an HTTP Service with a mounted Volume and a
127 Variable.
128 - [Websites](/railway/frontend/websites) — Vite, Astro, Next.js, and
129 other framework sites as a container Service.
130 - `examples/railway-service` — every resource and binding in one
131 stack (Project, Environment, Variable, Volume, Postgres, MySQL,
132 Redis, Bucket, TcpProxy, image Service, Effect Function, canvas
133 cron Function, Effect Api + Worker, `Railway.ref`, canvas Group).
134 - [Providers reference](/providers) — generated API docs for every
135 Railway resource Alchemy ships.