Skip to content

Apps

A Fly.App is a global namespace in your account. It contains Machines, Services, Secrets, IPs, and certificates.

Alchemy generates a unique name unless you pass one.

const site = yield* Fly.App("Site");

url is https://{appName}.fly.dev. Nothing answers there until a Service or Machine publishes a proxy service and the App has an IP assignment.

Pass name when you need a stable fly.dev hostname.

const site = yield* Fly.App("Site", {
name: "my-site",
});

Org defaults to the current token. Pass orgSlug to pin it.

const site = yield* Fly.App("Site", {
name: "my-site",
orgSlug: "my-org",
});

enableSubdomains: true turns on *.{appName}.fly.dev.

const site = yield* Fly.App("Site", {
name: "my-site",
orgSlug: "my-org",
enableSubdomains: true,
});

network is an optional 6PN name.

const site = yield* Fly.App("Site", {
name: "my-site",
orgSlug: "my-org",
enableSubdomains: true,
network: "private",
});

Declare the App once. Pass it into every child.

src/app.ts
import * as Fly from "alchemy/Fly";
export const Site = Fly.App("Site");

Resource-valued props accept the resource or an Effect producing it. Do not unwrap it just to pass it along.

alchemy destroy deletes children, then the App.

The tutorial deploys an App from an empty directory. Services run in the App. Machines run a raw image. The App reference lists every prop.