1---
2title: Regions
3description: Where Fly Machines, Volumes, Postgres, and Redis live. Alchemy defaults to iad.
4---
5
6A region is a Fly.io datacenter. [Machines](/fly/compute/machines),
7[Volumes](/fly/data/volumes), [Postgres](/fly/data/postgres)
8clusters, and a [Redis](/fly/data/redis) primary live in one. An
9[App](/fly/compute/apps) is global. It is not pinned to a region.
10
11Alchemy defaults to `iad` (Ashburn, Virginia). Pass `region` to put
12a [Service](/fly/compute/services), Machine, or Postgres cluster
13somewhere else.
14
15## Pin a Service
16
17```typescript
18export default class Api extends Fly.Service<Api>()(
19 "Api",
20 { main: import.meta.url, region: "lhr", port: 3000 },
21 Effect.gen(function* () {
22 return {
23 fetch: Effect.succeed(HttpServerResponse.text("hello")),
24 };
25 }),
26) {}
27```
28
29`count` Machines run in that region.
30
31:::caution[Changing `region` moves the Machines]
32The Service keeps its App and hostname. Machines are created in the
33new region and the old ones are deleted. A Volume does not move with
34them.
35:::
36
37## Pin a Machine
38
39```typescript
40const web = yield* Fly.Machine("Web", {
41 app: Site,
42 region: "syd",
43 image: "nginx:alpine",
44});
45```
46
47Each Machine resource is one VM in one region. To run in two
48regions, declare two Machines.
49
50:::caution[Changing `region` replaces the Machine]
51The Machine is created in the new region. The old one is deleted.
52:::
53
54## Volumes stay in the region
55
56A Volume is created in the parent Service or Machine's region. It
57cannot move and cannot attach to a Machine in another region.
58
59Restore into a new region from a
60[`VolumeSnapshot`](/providers/fly/volumesnapshot) with `snapshotId`
61on the mount.
62
63## Several regions, one hostname
64
65Pass a list to `region` to run the same Service in several regions
66behind one hostname. `count` Machines run in each region, and Fly's
67Anycast proxy sends each request to the nearest healthy Machine.
68
69```typescript
70export default class Api extends Fly.Service<Api>()(
71 "Api",
72 { main: import.meta.url, region: ["iad", "lhr"], count: 2 },
73 Effect.gen(function* () {
74 return {
75 fetch: Effect.succeed(HttpServerResponse.text("hello")),
76 };
77 }),
78) {}
79```
80
81This runs four Machines: two in `iad` and two in `lhr`. `api.regions`
82is `["iad", "lhr"]`, and `api.url` serves from both.
83
84Adding or removing a region updates the Service in place. Its App and
85hostname stay the same, Machines in regions you keep are left alone,
86and a removed region's Machines are deleted. A Volume from
87`MountVolume` is created in each Machine's own region.
88
89## Which region is this?
90
91Fly sets `FLY_REGION` on the Machine. Read it in a Service with
92`Config`.
93
94```typescript
95import * as Config from "effect/Config";
96
97const region = yield* Config.String("FLY_REGION");
98```
99
100## Region codes
101
102Codes are three letters. This list is what Fly published as of
103August 2026. Run `fly platform regions` or see
104[Fly's regions](https://fly.io/docs/reference/regions/) for the
105live set.
106
107| Code | Location |
108| --- | --- |
109| `ams` | Amsterdam, Netherlands |
110| `arn` | Stockholm, Sweden |
111| `bom` | Mumbai, India |
112| `cdg` | Paris, France |
113| `dfw` | Dallas, Texas (US) |
114| `ewr` | Secaucus, NJ (US) |
115| `fra` | Frankfurt, Germany |
116| `gru` | São Paulo, Brazil |
117| `iad` | Ashburn, Virginia (US) |
118| `jnb` | Johannesburg, South Africa |
119| `lax` | Los Angeles, California (US) |
120| `lhr` | London, United Kingdom |
121| `nrt` | Tokyo, Japan |
122| `ord` | Chicago, Illinois (US) |
123| `sin` | Singapore |
124| `sjc` | San Jose, California (US) |
125| `syd` | Sydney, Australia |
126| `yyz` | Toronto, Canada |
127
128A dedicated [`IpAssignment`](/fly/networking) can take `region`
129too. Shared Anycast (`shared_v4`) ignores it.
130
131## Postgres is regional
132
133The cluster lives in one region. Pass `region` on
134[`Fly.Postgres`](/fly/data/postgres), not on the App.
135
136```typescript
137const db = yield* Fly.Postgres("Db", {
138 region: "iad",
139});
140```
141
142:::caution[Changing `region` replaces the cluster]
143A new cluster is created in the new region. The old cluster is
144deleted. Data is not copied.
145:::
146
147## Redis primary
148
149[`Fly.Redis`](/fly/data/redis) takes `primaryRegion`. Default is
150`iad`. Read replicas are extra regions on `readRegions`.
151
152```typescript
153const cache = yield* Fly.Redis("Cache", {
154 primaryRegion: "iad",
155 readRegions: ["sjc"],
156});
157```
158
159:::caution[Changing `primaryRegion` replaces Redis]
160The primary region is immutable. The old database is deleted first.
161:::
162
163## Where next
164
165[Services](/fly/compute/services) pin `region` on the class.
166[Machines](/fly/compute/machines) pin it on the resource.
167[Volumes](/fly/data/volumes) follow the parent.
168[Postgres](/fly/data/postgres) is a billed cluster in one region.
169[Redis](/fly/data/redis) pins `primaryRegion`.