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

main
mdx 103 lines 2.48 KB
Raw
1 ---
2 title: Regions
3 description: Where Railway Services, Volumes, Postgres, and Buckets live.
4 ---
5
6 A region is a Railway datacenter. [Services](/railway/compute/services),
7 [Volumes](/railway/data/volumes), [Postgres](/railway/data/postgres),
8 [MySQL](/railway/data/mysql), and [Mongo](/railway/data/mongo)
9 take `region` as a Google-style code (`us-west2`, `us-east4`, …).
10 [Buckets](/railway/data/buckets) use a shorter set (`sjc`, `iad`,
11 `ams`, `sin`). A [Project](/railway/compute/projects) is not pinned
12 to a region.
13
14 Omit `region` and Railway picks the default for that resource.
15
16 ## Pin a Service
17
18 ```typescript
19 export default class Api extends Railway.Service<Api>()(
20 "Api",
21 {
22 project: Site,
23 main: import.meta.url,
24 region: "us-west2",
25 port: 3000,
26 },
27 Effect.gen(function* () {
28 return {
29 fetch: Effect.succeed(HttpServerResponse.text("hello")),
30 };
31 }),
32 ) {}
33 ```
34
35 Updating `region` on a Service is in place.
36
37 ## Pin Postgres
38
39 Postgres `region` is shared by the service instance and its Volume.
40 Changing it **replaces** Postgres.
41
42 ```typescript
43 const db = yield* Railway.Postgres("Db", {
44 project: site,
45 region: "us-west2",
46 });
47 ```
48
49 ## Volumes stay in the region
50
51 A Volume is created in one region. Changing `region` replaces the
52 Volume. Attach it to a Service in the same region.
53
54 ```typescript
55 const data = yield* Railway.Volume("Data", {
56 project: site,
57 mountPath: "/data",
58 region: "us-west2",
59 });
60 ```
61
62 ## Bucket regions
63
64 Buckets speak S3. Their region codes are short:
65
66 ```typescript
67 const data = yield* Railway.Bucket("Data", {
68 project: site,
69 region: "sjc",
70 });
71 ```
72
73 Default is `sjc`. Changing `region` replaces the Bucket.
74
75 | Code | Location |
76 | --- | --- |
77 | `sjc` | San Jose, California (US) |
78 | `iad` | Ashburn, Virginia (US) |
79 | `ams` | Amsterdam, Netherlands |
80 | `sin` | Singapore |
81
82 ## Service region codes
83
84 Railway uses Google Cloud region names for compute. This list is
85 what Railway published as of 2026. See
86 [Railway regions](https://docs.railway.com/reference/regions) for
87 the live set.
88
89 | Code | Location |
90 | --- | --- |
91 | `us-west1` | Oregon, USA |
92 | `us-west2` | California, USA |
93 | `us-east4` | Virginia, USA |
94 | `europe-west4` | Amsterdam, Netherlands |
95 | `asia-southeast1` | Singapore |
96
97 ## Where next
98
99 [Services](/railway/compute/services) pin `region` on the class.
100 [Volumes](/railway/data/volumes) replace on region change.
101 [Postgres](/railway/data/postgres) is a container + volume in one
102 region. [Buckets](/railway/data/buckets) use `sjc` / `iad` / `ams` /
103 `sin`.