| 1 | --- |
| 2 | title: Fly |
| 3 | description: Deploy Effect programs to Fly.io as Apps, Machines, Services, and Sprites. |
| 4 | --- |
| 5 | |
| 6 | A Service is an Effect program running in Fly Machines inside its own |
| 7 | App, with its own `{name}.fly.dev` hostname. An App is a globally |
| 8 | unique namespace. A Machine is a Firecracker VM running a container. |
| 9 | A Sprite is an Effect program in an org-scoped sandbox that hibernates |
| 10 | when idle. |
| 11 | |
| 12 | Disks, managed data, secrets, IPs, and certificates are declared in |
| 13 | the same TypeScript program. |
| 14 | |
| 15 | [Set up your org and API token](/fly/setup), then start the |
| 16 | [tutorial](/fly/tutorial/part-1). |
| 17 | |
| 18 | ## Compute |
| 19 | |
| 20 | - **[Apps](/fly/compute/apps)** — the namespace for Machines, |
| 21 | Secrets, IPs, and certificates. Services create their own; declare |
| 22 | one for Machines, App-level Secrets, custom domains, or to group |
| 23 | Services. `https://{appName}.fly.dev` is the public URL. |
| 24 | - **[Machines](/fly/compute/machines)** — a Firecracker VM running a |
| 25 | container image. Use this when you already have an image |
| 26 | (`nginx:alpine`, a registry tag). Region, guest size, proxy |
| 27 | services, env, and mounts are all props. |
| 28 | - **[Services](/fly/compute/services)** — an Effect program running |
| 29 | in Machines in its own App. Public by default at `api.url`, or |
| 30 | private with `public: false`. Alchemy bundles |
| 31 | `main`, builds the image, and updates in place when the hash |
| 32 | changes. Set `count` to scale. |
| 33 | - **[Connect Services](/fly/compute/connecting-services)** — Services |
| 34 | calling each other's methods with `Fly.bindService` on a |
| 35 | stack-scoped private network (`Fly.stackNetwork`), behind one public |
| 36 | gateway. |
| 37 | - **[Sprites](/fly/compute/sprites)** — an Effect program in a Fly |
| 38 | Sprite. Org-scoped, no parent App. Hibernates when idle. Alchemy |
| 39 | writes the bundle onto the Sprite. No Docker image. |
| 40 | - **[Regions](/fly/compute/regions)** — the datacenter a Machine, |
| 41 | Volume, Postgres cluster, or Redis primary lives in. Default |
| 42 | `iad`. Changing `region` replaces the resource. |
| 43 | |
| 44 | ## Frontend |
| 45 | |
| 46 | - **[Websites](/fly/frontend/websites)** — Vite, Astro, Next.js, |
| 47 | Nuxt, React Router, SolidStart, SvelteKit, TanStack Start, Waku, |
| 48 | Octane, Foldkit, Vocs, and StaticSite. Each builds your app and |
| 49 | deploys a Node [Service](/fly/compute/services) on a Fly App |
| 50 | (`https://{app}.fly.dev`). |
| 51 | - [`Vite`](/fly/frontend/vite), [`Astro`](/fly/frontend/astro), |
| 52 | [`Next.js`](/fly/frontend/nextjs), [`Nuxt`](/fly/frontend/nuxt), |
| 53 | [`React Router`](/fly/frontend/react-router), |
| 54 | [`SolidStart`](/fly/frontend/solidstart), |
| 55 | [`SvelteKit`](/fly/frontend/sveltekit), |
| 56 | [`TanStack Start`](/fly/frontend/tanstack-start), |
| 57 | [`Waku`](/fly/frontend/waku), |
| 58 | [`Octane`](/fly/frontend/octane), [`Foldkit`](/fly/frontend/foldkit), |
| 59 | [`Vocs`](/fly/frontend/vocs), |
| 60 | [`StaticSite`](/fly/frontend/static-site). |
| 61 | |
| 62 | ## Data |
| 63 | |
| 64 | - **[Volumes](/fly/data/volumes)** — region-local block storage. |
| 65 | Mount one into a Service with `MountVolume({ path, sizeGb })`, or |
| 66 | pass `mounts` on a Machine. A Volume attaches to **one** Machine; |
| 67 | `count: N` creates N disks, not one shared disk. |
| 68 | - **[Postgres](/fly/data/postgres)** — billed Managed Postgres. |
| 69 | Bind `ConnectPostgres` on a Service; pass the connection string |
| 70 | to Drizzle or SQL. `migrations` is the same surface as Neon. |
| 71 | - **[Redis](/fly/data/redis)** — Upstash Redis. Bind |
| 72 | `ReadWriteRedis` on a Service. |
| 73 | - **[Tigris](/fly/data/tigris)** — S3-compatible object storage |
| 74 | (`Fly.Bucket`). Bind `PutObject` / `GetObject` on a Service. |
| 75 | |
| 76 | ## Secrets |
| 77 | |
| 78 | - **[Secrets](/fly/data/secrets)** — `Config.Redacted` in a Service |
| 79 | for values from `.env`. `Fly.Secret` when Fly should own a value |
| 80 | shared across Machines. KMS keys are `SecretKey` plus `Encrypt` / |
| 81 | `Decrypt` / `Sign` / `Verify`. |
| 82 | |
| 83 | ## Networking |
| 84 | |
| 85 | - **[IPs & certificates](/fly/networking)** — public and private |
| 86 | Services, addresses (`IpAssignment`) for Apps you declare, plus |
| 87 | ACME or uploaded TLS certificates for your own hostname. |
| 88 | |
| 89 | ## What are you building? |
| 90 | |
| 91 | | You're building | Reach for | |
| 92 | | ---------------------------- | ------------------------------------------------------------------------- | |
| 93 | | An HTTP API on Fly | [Service](/fly/compute/services) | |
| 94 | | An internal API | [Service](/fly/compute/services#private-services) with `public: false` | |
| 95 | | Several Services talking privately | [Connect Services](/fly/compute/connecting-services): `Fly.bindService` + `Fly.stackNetwork` | |
| 96 | | A Vite SPA | [`Website.Vite`](/fly/frontend/vite) | |
| 97 | | An SSR site (Astro, Next, Nuxt, …) | [`Website`](/fly/frontend/websites) | |
| 98 | | A sandbox that can sleep | [Sprite](/fly/compute/sprites) | |
| 99 | | A raw container | [Machine](/fly/compute/machines) with an `image` | |
| 100 | | A background worker | [Service](/fly/compute/services) with `ServerHost.run` | |
| 101 | | Persistent disk | [MountVolume](/fly/data/volumes) or Machine `mounts` | |
| 102 | | Managed Postgres | [Postgres](/fly/data/postgres) + `ConnectPostgres` | |
| 103 | | Upstash Redis | [Redis](/fly/data/redis) + `ReadRedis` / `WriteRedis` / `ReadWriteRedis` | |
| 104 | | Object storage | [Tigris](/fly/data/tigris) + `PutObject` / `GetObject` | |
| 105 | | N replicas behind fly.dev | Service `count`, or more [Machine](/fly/compute/machines) resources | |
| 106 | | Restore a disk | [VolumeSnapshot](/fly/data/volumes#snapshots) + mount `snapshotId` | |
| 107 | | Config / API tokens | [`Config.Redacted`](/fly/data/secrets). [`Fly.Secret`](/fly/data/secrets) when Fly should own it | |
| 108 | | Sign / encrypt in-app | [SecretKey](/fly/data/secrets#kms-keys) + `Encrypt` / `Sign` | |
| 109 | | Addresses on your own App | [IpAssignment](/fly/networking#addresses-for-a-shared-app) `type: "shared_v4"` | |
| 110 | | Your own domain | [Certificate](/fly/networking#use-your-own-hostname) (ACME) | |
| 111 | |
| 112 | ## Where next |
| 113 | |
| 114 | - [Setup](/fly/setup) — create a Fly org, generate an API token, and |
| 115 | connect alchemy. |
| 116 | - [Tutorial](/fly/tutorial/part-1) — from empty directory to a |
| 117 | public HTTP Service with a mounted Volume and a secret. |
| 118 | - [Websites](/fly/frontend/websites) — Vite, Astro, Next.js, and |
| 119 | other framework sites as a Node Service. |
| 120 | - [Providers reference](/providers) — generated API docs for every |
| 121 | Fly resource Alchemy ships. |