# Deno (/docs/guides/v8/runtimes/deno)

> For the complete Prisma documentation index, see [llms.txt](https://www.prisma.io/docs/llms.txt). A markdown version of any docs page is available by appending `.md` to its URL.

Run a minimal Prisma 8 and PostgreSQL app on Deno.

Location: Guides > v8 (RC) > Runtimes > Deno

## Introduction [#introduction]

In this guide, you scaffold a minimal Prisma 8 app for Deno, initialize a PostgreSQL database, and run the generated typed query. The app uses Deno-native tasks and explicit `.ts` extensions for relative imports.

Every command below was run end to end against a live Prisma Postgres database.

## Prerequisites [#prerequisites]

* [Deno](https://deno.com/) 2.0 or later (`deno --version`)

## Use with your agent [#use-with-your-agent]

Prefer to delegate this guide? Copy this prompt and hand it to your coding agent:

```text
Create and verify a minimal Prisma 8 app on Deno.

1. Run `deno run -A npm:create-prisma@latest my-deno-app --template minimal --provider postgres --package-manager deno --no-deploy --yes`.
2. Enter `my-deno-app`. Run `deno run -A npm:create-db@latest --env .env --ttl 24h` and show me the claim URL so I can keep the temporary database.
3. Run `deno task db:init`, then start `deno task dev` in the background.
4. Request `http://localhost:3000` and verify that it returns Alice, Bob, and Carol. The first request seeds these users automatically; do not add or run a separate seed command.
5. Do not deploy to Prisma Compute because it does not support Deno.

Use the generated tasks instead of invoking a Prisma CLI package directly.
```

## 1. Scaffold the project [#1-scaffold-the-project]

Run `create-prisma` through Deno and select the minimal PostgreSQL template:

```bash
deno run -A npm:create-prisma@latest my-deno-app --template minimal --provider postgres --package-manager deno --no-deploy
```

The command creates the app, installs its npm dependencies through Deno, and emits the Prisma contract artifacts. Deno support is currently limited to the minimal PostgreSQL template.

```bash
cd my-deno-app
```

The generated project includes:

* `deno.json` with npm compatibility enabled
* Deno-native `dev`, `build`, and Prisma tasks in `package.json`
* explicit `.ts` extensions on relative imports
* no Composer or Prisma Compute deployment files

## 2. Create and initialize the database [#2-create-and-initialize-the-database]

Create a temporary Prisma Postgres database and write its connection string to `.env`:

```bash
deno run -A npm:create-db@latest --env .env --ttl 24h
```

The command prints a claim URL. Open it within 24 hours to keep the database, or replace `DATABASE_URL` in `.env` with your own PostgreSQL connection string.

Apply the starter contract and sign the database:

```bash
deno task db:init
```

## 3. Run the app [#3-run-the-app]

Start the generated HTTP server:

```bash
deno task dev
```

Then request it from another terminal:

```bash
curl http://localhost:3000
```

The response contains the starter users:

```json no-copy
{
  "users": [
    { "email": "alice@prisma.io", "name": "Alice" },
    { "email": "bob@prisma.io", "name": "Bob" },
    { "email": "carol@prisma.io", "name": "Carol" }
  ]
}
```

The first request runs `src/prisma/seed.ts` through the generated query helper. Seeding is idempotent, so later requests read the same rows without creating duplicates. There is no separate seed command.

## 4. Understand the generated query [#4-understand-the-generated-query]

The generated `src/prisma/users.ts` connects the database, seeds on the first query, and reads from the PostgreSQL `public` namespace:

```ts title="src/prisma/users.ts"
import { db } from "./db.ts";
import { seed } from "./seed.ts";

export async function listUsers(limit = 10) {
  await seed();

  const users = await db.orm.public.User
    .select("id", "email", "username", "name", "createdAt")
    .take(limit)
    .all();

  return users.map((user) => ({
    id: String(user.id),
    email: user.email,
    username: user.username ?? null,
    name: user.name ?? null,
    createdAt: user.createdAt,
  }));
}
```

Deno requires the `.ts` extension on these relative imports. The generated files already include it.

After changing `src/prisma/contract.prisma`, regenerate the typed artifacts and update the database:

```bash
deno task contract:emit
deno task db:update
```

## Current limitations [#current-limitations]

* Prisma Compute does not support Deno deployments yet.
* The generated ORM tasks currently use the Deno-compatible Prisma 8 ORM CLI entry point. The consolidated `npm:prisma@next` CLI still loads Node-only credential storage under Deno, so use the generated tasks rather than invoking a CLI package directly.
* The generated commands use `-A` for the filesystem, environment, and network permissions required during setup and local development. You can replace it with a narrower allow list for your application after setup.

## Next steps [#next-steps]

* [Learn the fundamentals](https://www.prisma.io/docs/orm/v8/fundamentals/reading-data): filtering, sorting, pagination, and writes.
* [Read the Prisma 8 overview](https://www.prisma.io/docs/orm/v8) for contracts, typed queries, and migrations.
* [Use the Bun guide](https://www.prisma.io/docs/guides/v8/runtimes/bun) if you also target Bun.

## Related pages

- [`Bun`](https://www.prisma.io/docs/guides/v8/runtimes/bun): Scaffold a Prisma 8 app with Bun, run your first typed query, serve users over HTTP, and deploy to Prisma Compute.