Prisma Composer

Running locally

One command brings your whole app up on your machine — every service, its databases and buckets, wired together — with no cloud credentials. prisma dev runs the same pipeline a deploy runs, but against local stand-ins for Prisma Cloud, so what you run locally is what you ship. The logs come from the log operation in @prisma/composer/control, which you call from a short script; there is no prisma command for them.

You want to… Run
Bring the app up locally prisma dev
Hot reload a Next.js service nothing extra: prisma dev runs next dev for it (see Dev servers)
Start clean (wipe local data first) prisma dev --fresh
Run a second, clean copy, for tests prisma dev --environment test --fresh (see Environments)
Watch the running app's logs the log operation (see Logs)

module.ts is your entry file — the one whose default export is the app's root, built with appRoot(), the same file you pass to prisma deploy. No PRISMA_* variables and no prisma auth login are needed; local dev never talks to the platform. It runs as the environment dev unless you pass --environment, and each environment is a separate local copy of the app.

Bring it up

Local Postgres runs on @prisma/dev. @prisma/composer-prisma-cloud declares it as a dependency (^0.25.2) and resolves it from its own package, so nothing needs adding to your app and your app's own copy, if any, is not used. Releases before 0.21.0 crash on any Postgres message over 64 KiB, which is why Composer owns the version. Nothing about the emulator is needed for cloud deployment or a local app without Postgres resources.

prisma dev

It builds nothing for you (bring your own built output, same as deploy) — except that a service whose build adapter declares a dev server, such as every Next.js service, runs that dev server instead and needs no build at all (see Dev servers). It then stands the app up and prints the front door — every service's local URL:

dev: ready
storefront: http://localhost:3004
catalog.service: http://localhost:3000
orders.service: http://localhost:3003

dev prints ready only once every service accepts connections on its port, so a request to a printed URL right away connects. After a rebuild, dev waits the same way before it prints the URLs again. A service must listen on the port Composer gives it, unless it is declared with compute({ ..., listens: false }): such a service, like the cron module's scheduler, is running as soon as its process starts.

If a service exits before it listens, or does not listen within 30 seconds, dev fails instead of printing ready, and stops the app's other services. The message names the service, its port, and its log file, for example service "my-app.gateway" exited (code 1) before it accepted connections on its port 3001. Its log: …/svc_….log. On a first start it is in the message of prisma dev's error that the app could not be converged (DEV.CONVERGE_FAILED from the dev operation in @prisma/composer/control). On a warm start it is the message of the DEV.SERVICE_START_FAILED error.

A service that needs longer to start, for example one that runs migrations first, can have more time: set PRISMA_COMPOSER_SERVICE_READY_TIMEOUT_MS to the limit in milliseconds (the default is 30000). A value that is not a positive whole number fails with DEV.SERVICE_READY_TIMEOUT_INVALID. The compute emulator reads the variable when it starts, and a running emulator keeps the value it started with; --fresh does not restart it. To apply a new value, end the compute emulator's process (its PID is in compute.json in the emulators directory, see below), which stops the services of every app that uses it. The next prisma dev starts it again with the new value.

dev and the log operation retry a call to a local emulator only when they cannot connect to it. If that lasts a few seconds, they fail with DEV.EMULATOR_UNREACHABLE, which takes the place of DEV.SERVICE_START_FAILED, DEV.ATTACH_FAILED and LOG.ATTACH_FAILED for this case. An error the emulator returns, such as a service that failed to start, is not retried.

From here dev keeps running: it watches your built output and, when a service's build changes, restarts just that service. It prints the output of the services that run a dev server, and not that of the others — with several services running, streaming them all inline would bury the front door and the restart notices. Their logs are their own operation (below).

dev reads the composer section of prisma.config.ts once, when it starts, and watches the file. When the file changes, dev prints that it changed and must be restarted, and it stops rebuilding: until you stop dev and start it again, a build change only repeats that notice.

dev also watches your app definition files: your entry module and every file of yours it imports, directly or through other files, such as each module's module.ts, each service.ts and their helpers (files in node_modules are not included). When one of them changes, dev rebuilds and applies the change: an edit to wiring, an input or a binding takes effect without a restart. An edit that adds or removes a service, a database or another node, or that makes your root pass on an input field it did not pass on before, fails that rebuild with a message that says to restart dev; the running app is left as it was. An edit that changes which platform variables your app reads pauses rebuilds, with a message, until you restart dev. A file that an edit newly imports is watched from then on. Under Bun, one such import needs a restart: an import of a directory (./lib, meaning lib/index.ts) that you write before the directory or its index.ts exists. dev says so when you create the file.

Ctrl-C stops your app's service processes and its local Postgres servers, and exits; so does dev ending on SIGTERM or a failure. The data stays, and so do the ports, so the next prisma dev is a warm start — same ports, same data. --fresh is what wipes this app's local instances and data in this environment before starting.

Dev servers

A service whose build adapter declares a dev server runs it under prisma dev in place of its built artifact, so your edits are picked up by the framework's own hot reload instead of a rebuild and a restart:

There is no flag: prisma dev is the whole command. The output names each dev server before the app comes up, and its lines are prefixed with the service's address:

shop.web: runs `next dev` in apps/web
dev: ready
shop.web: http://localhost:3001
[shop.web] ▲ Next.js 16.4.0 (Turbopack)
[shop.web] - Local:         http://localhost:3001
[shop.web] ✓ Ready in 319ms
[shop.web]  GET /api/users 200 in 371ms

A dev server runs exactly where the artifact would have: on the service's instance, at its URL, with the environment a deployment gives it. Inside it, service.load() returns the same bindings (a local database is the local Postgres), service.input() the same input document, and service.port() the same port; you never set a COMPOSER_* variable yourself. On top of that it keeps your shell's environment (NODE_OPTIONS, proxy settings), which a deployed artifact does not; Composer's values win over the shell's.

Secrets come from the adapters in prisma.config.ts, not from the dev server's own .env loading. Composer reads each secret before the dev server starts, so a secret that is only in a .env that Next.js loads is unset as far as Composer knows: if the service requires it, prisma dev stops and names it; if it is optional, the service sees the field as absent. List dotenv() in config and secrets, so Composer reads the .env files itself:

// prisma.config.ts
import { defineConfig as composer, dotenv, environmentVariables } from '@prisma/composer/config';
import { nodeBuild } from '@prisma/composer/node/control';
import { prismaCloud, prismaState } from '@prisma/composer-prisma-cloud/control';
import { definePrismaConfig } from 'prisma/config';

export default definePrismaConfig({
  composer: composer({
    entry: './module.ts',
    extensions: [prismaCloud(), nodeBuild()],
    state: prismaState(),
    config: [dotenv(), environmentVariables()],
    secrets: [dotenv(), environmentVariables()],
  }),
});

.env.dev holds values only the environment dev reads. Without a config or secrets list, Composer reads the shell, so import 'dotenv/config' at the top of prisma.config.ts also works; remove it when you list dotenv(). A changed value restarts the dev server on the next prisma dev.

What else changes for such a service:

Two errors are specific to dev servers: DEV.DEV_SERVER_UNAVAILABLE when the dev server cannot be found (for Next.js, next is not installed in appDir), and DEV.DEV_SERVER_UNSUPPORTED when the service's package is too old to run one — the message names the package to update.

Run it in the background

prisma dev --detach does everything prisma dev does up to ready, prints the front door, and exits 0, leaving the app running. It does not watch for changes, and nothing stops the app until you run prisma dev stop:

prisma dev --detach
curl "$(prisma dev url my-app.gateway)"
prisma dev stop

This is the form for agents, scripts and CI, which then have no long-running process to manage. It combines with --fresh, --name and --environment; give prisma dev url and prisma dev stop the same --environment. If it fails before ready, it stops the whole app, including one an earlier --detach left running, and exits non-zero, as prisma dev does. A failed redeploy has already replaced that service's old process, so the previous app cannot be kept. Fix the build and run prisma dev --detach again. To pick up a rebuild, run prisma dev --detach again, or run prisma dev in the foreground: it takes over the running app, watches, and Ctrl-C stops it.

On a fresh start, each service gets the lowest free port from 3000 up, in dependency order: a service gets its port before the services that call it, and services with no dependency between them go in the order you provisioned them. A warm start keeps the ports services already have.

Each directory runs its own services, databases and buckets

The services, databases and buckets dev runs belong to the directory you run it in. Two checkouts of the same app, such as two git worktrees, run separate service processes on separate ports, with separate databases and separate buckets: a rebuild in one never restarts the other's services, and a row or an object written in one is not seen by the other. dev records which local instance backs each node in .prisma-composer/dev/emulator-instances.json.

A service or a database keeps its port in its directory from one dev to the next, even while it is stopped. If a local instance is gone, for example because a Composer upgrade discarded an emulator's state, the next dev creates it again, empty, and asks for the port it had; a Prisma ORM database's (postgres()) committed migrations then run again, as on a fresh start, while a rawPostgres() database stays empty. When another directory has taken that port, the instance gets the lowest free one and dev prints one line, naming a service or a database:

[dev] service "my-app.gateway" now uses port 3004: its previous port 3001 is in use
[dev] database "catalog" now uses port 51302: its previous port 51300 is in use

A directory keeps the local state of every app you run from it. Running a different app from the same directory (another entry file, or another --name) stops nothing: both apps run at once, each on its own ports. --fresh wipes only the app you start with it, in its environment.

A stopped service or database keeps its port reserved, and a database its data, so the instances of a checkout you delete keep theirs. There is no command to remove them yet.

Each environment is a separate local copy

prisma dev runs as the environment dev. --environment names another, and each name is a complete, separate local copy of the app, with its own services, databases, buckets and ports. Two environments of one app run at once in one directory, and starting one stops nothing. The common use is a clean copy for tests that leaves your working data alone:

prisma dev                                       # dev, with your working data
prisma dev --environment test --fresh --detach   # a clean copy; dev is untouched
prisma dev url my-app.gateway --environment test # test's URL
prisma dev stop --environment test

--fresh wipes only the environment it runs in. Everything local to one copy lives in .prisma-composer/dev/<environment>/: the record of its instances, its environment variable values, the key prisma dev hashes secret values with, the generated stack file, the unpacked artifacts and the bucket objects. The deploy engine keeps each copy's state in .alchemy/state/<app>/<environment>.

Environment names are case-sensitive, but on a case-insensitive filesystem, such as the default on macOS, Dev and dev would share one folder. So the first prisma dev in an environment records its exact name in its folder, and prisma dev, prisma dev url, prisma dev stop and the log operation refuse a name that differs from the recorded one with DEV.ENVIRONMENT_NAME_MISMATCH. Use the recorded name, or one that differs from it by more than case.

Upgrading from a version with one local copy per directory. The first prisma dev, prisma dev url or prisma dev stop after the upgrade moves the directory's existing local state into the environment dev, so your databases, bucket objects and ports are kept, and an app started with --detach before the upgrade can still be stopped. Keep @prisma/composer-prisma-cloud on the same Composer version as the prisma CLI: an older one would put every environment in one copy, so prisma dev refuses it with DEPS.EXTENSION_INCOMPATIBLE.

Finding a running node, and stopping the app

Ports differ from one directory and environment to the next, so don't hard-code localhost:3001. From another terminal in the same directory, ask where a node of the running app answers, by its address, which starts with the app name. It asks about the environment dev; pass --environment for another:

prisma dev url my-app.gateway

A service gives http://localhost:<port>, a database its connection string (with its local credentials), and a bucket its S3 endpoint followed by /<bucket>. A node inside a nested module has a longer address, such as my-app.catalog.database. The address names the app, so dev url does not load your entry file.

The URL alone goes to stdout, whether it is a terminal or a pipe, so a script uses it directly. Check the exit status first, so a failure does not run curl with an empty URL:

url=$(prisma dev url my-app.gateway) && curl "$url"

prisma dev url, prisma dev stop and prisma emulator list first ship in the prisma release after 8.0.0-rc.23, which already writes a command's plain data to a piped stdout. --json gives the full result, { address, kind, url, state }, or on failure the error with its code.

dev url only reports a node that is running, so the URL it prints answers. Otherwise it fails with a code a script can branch on:

prisma dev stop stops the app's service processes and database servers in one environment, as Ctrl-C does. It finds the app as prisma dev does, from your entry file or --name, and stops the environment dev unless you pass --environment. If that app never ran in that environment here, it fails with DEV.NOT_STARTED_HERE. Use it to stop an app started with --detach, or when prisma dev was killed without the chance to stop it. Data and ports are kept, so the next prisma dev is still a warm start. It lists what it stopped; when nothing of the app was running, it says so and still succeeds. Piped, it writes one line per node it stopped with two tab-separated fields: the node's address and its kind.

prisma emulator list shows every local emulator on the machine, whether it is running, and every instance on it, with the directory, app and address it belongs to. It works from any directory. Piped, it writes one line per instance with six tab-separated fields: the emulator's kind (service, database or bucket), the instance id, its URL, its state, the address of the node it runs, the absolute path of the directory prisma dev ran from and the environment. The last three are empty for an instance Composer did not label, and the environment is also empty for an instance created before each environment had its own copy. An emulator that is running but does not answer, or answers with an error, is shown with that error, and the others are still listed. prisma emulator start and prisma emulator stop are planned.

Each command's piped lines are listed in Piped output.

Prisma 7's prisma dev ls, prisma dev rm and prisma dev start fail with CLI.V7_COMMAND. Its --port, --db-port, --shadow-db-port and --debug on prisma dev, and --debug on prisma dev stop, fail with CLI.V7_FLAG. Both exit with status 2 and say why. dev ls points to prisma emulator list, dev start to prisma dev --detach, and dev rm to prisma dev --fresh, which deletes the app's local services, databases and buckets in one environment, and their data, then starts the app again. The flags point to the command's help. There is no port to pass: prisma dev gives each environment its own ports and keeps them between runs, and prisma dev url prints where a node answers. Each error also says how to keep using Prisma 7: install its CLI with npm install --save-dev @prisma/prisma7@7 and run the Prisma 7 command with prisma7, with a placeholder for each value it needs, such as prisma7 dev rm <name> or prisma7 dev --port <port>.

--fresh is also the fix when a framework upgrade leaves stale rows in this app's local dev state — the symptom is a plan-time error naming an unregistered resource type (for example No provider is registered for resource type 'PrismaComposer.Database'). Note --fresh wipes local data too — database contents, bucket objects, instance state — not just the resource bookkeeping; the next start rebuilds empty resources. Use it when the local data is disposable, which in a dev loop it usually is.

Piped output

When stdout is a pipe or a file, Composer's commands write data lines to it, one record per line. Everything else, such as progress, tables and warnings, goes to stderr, so prisma deploy > out.txt leaves only data lines in out.txt. --json gives each command's full result instead.

The rules for every line:

Command One line per Fields
prisma deploy deployed entity node address, entity kind (compute-service, postgres-database or bucket), entity id, URL (empty for an entity without one)
prisma deploy list deployed node node address, kind (project, service, postgres, bucket, module, or another resource's type), platform ID, URL
prisma dev stop node it stopped node address, node kind (service, database or bucket)
prisma dev url the node asked for URL
prisma emulator list emulator instance emulator kind (service, database or bucket), instance id, URL, state, node address, directory, environment

A command with nothing to report writes no lines and still exits 0: dev stop when nothing was running, and deploy for a node that published no entities (such as S3 credentials) or when the deploy wrote no report. Deploying says how to tell these apart.

The directory in emulator list is an absolute path, unlike the paths other prisma commands print, which are relative to the working directory. The list covers every app on the machine and runs from any directory, so a relative path would change with the directory you run it from and would not identify an app reliably.

Logs

The log operation tails the merged logs of the already-running app — one stream, each line tagged with the service it came from. Run a script like this from the directory you run prisma dev in:

// logs.ts
import { fileURLToPath } from 'node:url';
import { log } from '@prisma/composer/control';
import prismaConfig from './prisma.config.ts';

const stop = new AbortController();
process.on('SIGINT', () => stop.abort());

const result = await log({
  config: {
    value: prismaConfig.composer,
    file: fileURLToPath(new URL('./prisma.config.ts', import.meta.url)),
  },
  tail: 20,
  signal: stop.signal,
});
if (!result.ok) {
  console.error(result.failure.message);
  process.exit(1);
}
for await (const { service, line } of result.value.lines) {
  console.log(`[${service}] ${line}`);
}

The log operation reads no credentials. It follows live, like tail -f, until the signal aborts. It only reads the running app — it never builds, provisions, starts, or stops anything, so you can start and stop it freely alongside a running dev.

What's local vs. what's real

Everything above the cloud boundary is real: your actual service code, real databases you can migrate and query, real object storage. What's swapped are the providers underneath — local emulators stand in for Prisma Cloud, so no token, workspace, or network is involved. Five consequences worth knowing:

Windows isn't supported yet.

Where to go next