Requires
Declares required resource dependencies. The app will not start without them. Value is an array; each entry is a string (shorthand) or an object.
A string shorthand (requires: [postgres]) expands to [{ type: "postgres" }].
An object entry is one of two kinds, distinguished by its marker field: a backing service (has type:) that the provider provisions and wires, or a host capability (has host:) that the provider grants or refuses — see Host capabilities.
| Field | Type | Required | Description |
|---|---|---|---|
name |
string |
no | Resource name for expression references (defaults to type) |
type |
string |
yes | Resource type (see Resource Property Vocabulary) |
version |
string |
no | Version constraint using semver ranges (e.g. >=15, ^7.0, 20.x) |
config |
map<string, any> |
no | Resource provisioning hints (platform-interpreted) |
set_env |
map<string, string> |
no | Maps resource properties to app env vars using $ expressions |
requires:
- type: postgres
version: ">=15"
set_env:
DATABASE_URL: $url
DB_HOST: $host
DB_PASSWORD: $passwordResource naming
By default, a resource's name is its type. Expression references like $postgres.host use this name. When an app requires multiple instances of the same type, use the name field to distinguish them:
requires:
- type: postgres
name: primary-db
set_env:
PRIMARY_DB_URL: $url
- type: postgres
name: analytics-db
set_env:
ANALYTICS_DB_URL: $urlReferences use the name: $primary-db.host, $analytics-db.host. Without name, two resources of the same type would be ambiguous.
Version constraints
The version field uses semver range syntax (as defined by node-semver):
| Syntax | Meaning |
|---|---|
>=15 |
Version 15 or higher |
^7.0 |
Compatible with 7.x (>=7.0.0, <8.0.0) |
~2.1.0 |
Approximately 2.1.x (>=2.1.0, <2.2.0) |
20.x |
Any 20.x version |
15.2.0 |
Exact version |
Resource configuration
The config map passes provisioning hints to the platform. Keys and semantics are resource-type-specific:
requires:
- type: postgres
version: ">=15"
config:
extensions: [pgvector, postgis]
shared_buffers: 256MB
- type: redis
config:
maxmemory: 256mb
maxmemory-policy: allkeys-lruThe platform interprets these hints when provisioning the resource. Unknown keys are ignored by platforms that don't support them.
Expression wiring
Values in set_env use the expression syntax. Inside a requires or supports block, bare $prop references resolve against the enclosing resource's property vocabulary.
Real-world examples: See how Ghost, Metabase, and Miniflux declare their database requirements. Browse all apps →
Host capabilities
A requires/supports entry can request a host capability — a privileged grant from the machine the app runs on — instead of a backing service. A capability entry is marked with host:. The provider grants it (mounts or forwards the underlying coordinate and populates the capability's properties) or refuses the deployment with a clear message; it never provisions anything. See PROVIDERS.md for the provider-side contract.
requires:
- postgres # backing service → provision + wire
- host: { container_runtime: docker } # capability → grant or refuse
set_env:
DOCKER_HOST: $url
supports:
- host: { container_runtime: any } # optional — deploy, probe, degrade| Field | Type | Required | Description |
|---|---|---|---|
host |
map<string, string | bool> |
yes | Capability name → interface value (see Capability vocabulary) |
set_env |
map<string, string> |
no | Maps capability properties to app env vars using $ expressions |
Rules:
- The
host:marker is required on every privileged entry. An entry's kind is machine-extractable from the file itself: a bare string ortype:entry is a backing service; ahost:entry is a capability. Anyone — tooling or a human reviewer — can list an app's full privilege surface with zero extra tooling.launchfile validateprints it ashost capabilities requested: […]. - The value names an interface, never a product.
container_runtime: dockermeans "the Docker Engine API" — a Podman-compatible socket satisfies it — exactly asrequires: postgresnames a wire protocol, not a vendor.container_runtime: anyis runtime-agnostic. The vocabulary is open: unknown capability names and values are tolerated by parsers; a provider that cannot grant a required capability it does not understand refuses. - Required vs optional is
requiresvssupports. A capability inrequiresmust be granted or the provider refuses to deploy the component. A capability insupportsis optional: the app deploys without it, probes its env vars at startup, and degrades gracefully. - Wiring uses
set_env, exactly as for backing services. A granted capability exposes provider-supplied properties (below); bare$propreferences inside the entry resolve against the enclosing capability's properties.
Capability properties
Like resource properties, a granted capability exposes a standard set of properties the provider computes from how it granted the capability:
| Capability | Property | Meaning |
|---|---|---|
container_runtime |
$socket |
Filesystem path of the runtime socket (e.g. /var/run/docker.sock) |
container_runtime |
$url |
DOCKER_HOST-style connection string (e.g. unix:///var/run/docker.sock, tcp://10.0.0.5:2376) |
container_runtime |
$api |
HTTP(S) API endpoint URL, when the runtime is reachable over the network |
Properties a provider cannot supply resolve to the empty string, matching unknown resource properties.
Capability vocabulary
| Capability | Values | Meaning |
|---|---|---|
container_runtime |
docker, any |
Access to a container-runtime control API. docker = the Docker Engine API (any compatible socket satisfies it, including Podman's); any = runtime-agnostic. |
network |
host |
Must share the host network stack |
filesystem |
read-write, read-only |
Host filesystem access |
privileged |
true |
Elevated privileges (e.g. device access) |
network, filesystem, and privileged are the entry-form spelling of the legacy host block keys — they are grant/refuse capabilities like any other. That block is deprecated in launch/v1 and removed in launch/v2 (D-58); entries are the form to write. Existing files using the block stay valid and keep their meaning for the whole of launch/v1 — see Migrating off the host: block.