Prisma ORM 8 is here.Read the docs

create-db: temporary Postgres from the terminal, no sign-up

Open in ChatGPT

Create a temporary Prisma Postgres database from the terminal with one command and no sign-up, for prototypes, tests and coding agents. Claim it with a Prisma account to keep it on the Free plan.

create-db is an open-source CLI tool that creates a temporary Prisma Postgres database from your terminal with a single command, so you or a coding agent have a connection string in seconds.

  • One command: npx create-db@latest prints a standard postgres:// connection string. Add --json when an agent needs machine-readable output.
  • No sign-up to start: You need no account and no credit card to create a temporary database.
  • Keep for free: Claim the database with a Prisma account, using the claim URL in the CLI output. A Free workspace includes 2 GB of storage and 200,000 operations a month.
  • Lifetime: Until you claim it, 24 hours by default; --ttl sets 30m or 1h to 24h.

Prerequisites

To use npx create-db, you need:

  • Node.js 20.12 or newer (we recommend the latest LTS version).
  • npm (comes with Node.js) to run npx commands.

You don't need a Prisma account to create a temporary database. To keep one, claim it with a Prisma account (details below).

The create-db web application provides a browser-based interface for creating and managing your databases.

Key features:

  • No installation required - works directly in your web browser
  • Visual interface for database management
  • Connection string display and copying
  • Built-in schema viewer and editor
  • Direct integration with Prisma Studio
  • Database claiming workflow

Getting started:

  1. Visit create-db.prisma.io in your web browser
  2. Click "Create with the web interface"
  3. Modify your schema and interact with the Studio
  4. Copy the provided connection strings for your project
  5. Claim your database to make it permanent

Option 2: Using the CLI

You can create a database using one of the following options:

Option 1: Quick start with default settings

Run the following command in your terminal:

bunx create-db@latest

  • The @latest tag automatically downloads and runs the latest version of the tool, so no global installation is required.
  • After a few seconds, you'll receive a connection string and a claim URL.
  • By default, create-db detects your approximate location and provisions the database in the closest available region, falling back to us-east-1 if detection fails. To choose a region yourself, use the --region flag. See the section below to view all the CLI options.

Option 2: Choose a region interactively

If you want to select a region manually:

bunx create-db@latest --interactive

  • This opens a region selection menu (for example, us-east-1, eu-west-3).
  • Alternatively, you can use the shorthand -i:
bunx create-db@latest -i

To view all options and regions:

bunx create-db@latest --help

CLI output walkthrough

Here is an example output:

┌  🚀 Creating a Prisma Postgres database
│
◇  Database created successfully!
│
│
●  Database Connection
│
│
│    Connection String:
│
│    postgres://<username>:<password>@db.prisma.io:5432/postgres?sslmode=require
│
│
◆  Claim Your Database
│
│    Keep your database for free:
│
│    https://create-db.prisma.io/claim?projectID=proj_...&utm_source=create-db&utm_medium=cli
│
│    Database will be deleted on <date and time 24 hours from now> if not claimed.
│
└  Done!

Once you have the output, check your .env file before you add the connection string. If it has no DATABASE_URL yet, or you mean to move the project to the new database, add the string as DATABASE_URL:

DATABASE_URL="postgres://<username>:<password>@db.prisma.io:5432/postgres?sslmode=require"

If the file already has a DATABASE_URL for a database you want to keep, leave that line as it is. Instead, set the new string on each command that should use the temporary database, in the variable your app or Prisma config reads. In bash or zsh:

Terminal
DATABASE_URL="<connection string>" npm test

In PowerShell, set the variable, run the command, then restore the previous value:

PowerShell
$previousDatabaseUrl = $Env:DATABASE_URL
$Env:DATABASE_URL = "<connection string>"
npm test
$Env:DATABASE_URL = $previousDatabaseUrl

By default, dotenv does not replace a variable that is already set, so a project that loads .env with dotenv uses the value on the command. If the project calls dotenv with override: true, the .env value replaces it, so check that setting first. For Prisma ORM 7 CLI commands, Verify the upgrade shows the same pattern with --url.

If you don't have a .env file yet, you can skip the copy step by creating the database with npx create-db@latest --env .env instead. This creates the file with DATABASE_URL and CLAIM_URL, then prints a confirmation and the claim URL with its deletion time. On a file that already exists, --env appends both lines without removing an existing DATABASE_URL, which leaves two DATABASE_URL lines in the file. If the project already has a database, set the string on the command as shown above instead.

You can now follow the Prisma Postgres quickstart guide to connect your Prisma project to this database.

If you're using other tools or libraries, use the standard PostgreSQL connection string with any PostgreSQL-compatible client, such as psql, pgAdmin, node-postgres, or an ORM of your choice. Detailed instructions are available in Connecting to your database.

Use create-db with coding agents

Coding agents such as Claude Code, Cursor, and Codex can create a database for a task without a human signing up first. Run the command with --json so the agent gets machine-readable output:

bunx create-db@latest --json
{
  "success": true,
  "connectionString": "postgres://<username>:<password>@db.prisma.io:5432/postgres?sslmode=require",
  "claimUrl": "https://create-db.prisma.io/claim?projectID=proj_...&utm_source=create-db&utm_medium=cli",
  "deletionDate": "2026-10-13T08:44:59.650Z",
  "region": "eu-west-3",
  "name": "2026-10-12T08:44:55.985Z",
  "projectId": "proj_...",
  "nextStep": "The database is deleted at 2026-10-13T08:44:59.650Z unless the user claims it, which keeps it for free. Give the user this claim URL: https://create-db.prisma.io/claim?projectID=proj_...&utm_source=create-db&utm_medium=cli"
}

The agent reads connectionString and sets it as DATABASE_URL for the task. Keep it out of the .env file your team shares, so the agent never points at a database someone else is using.

If the service returns an error, the JSON has "success": false and a message, and the command exits with code 1. If a flag value is invalid or the service can't be reached, the command prints an error to stderr instead of JSON and exits with code 1.

To write DATABASE_URL and CLAIM_URL to a separate env file instead of printing JSON, or to let the database expire sooner than 24 hours:

bunx create-db@latest --env .env.local
bunx create-db@latest --json --ttl 1h

When an agent creates databases:

  • Create one database per task, not one per test run. Database creation is rate-limited per IP address.
  • Show the human the claim URL and the deletion time every time. The database is deleted unless someone claims it, and claiming needs a Prisma account, so a person has to do it. --json returns them as claimUrl and deletionDate, with a nextStep that says the same; --env and --quiet print them in a claim line (--quiet on stderr).
  • Treat the database as disposable until it is claimed: it is deleted when its time to live runs out.

To make this the agent's default, add a short block to your project's AGENTS.md:

## Database rules

- For a task that needs a scratch database, run `npx create-db@latest --json` and use `connectionString` as `DATABASE_URL` for that task only, never in the shared `.env`.
- Create one database per task. It is deleted after 24 hours unless claimed.
- Every time you create one, show me the `claimUrl` and when it is deleted. Claiming needs my Prisma account.

Claude Code doesn't always read AGENTS.md, for example when your project also has a CLAUDE.md. Add the line @AGENTS.md to a CLAUDE.md next to your AGENTS.md so Claude Code imports these rules.

For the reasoning behind these rules and more examples, see Give your agent a database and What to put in your AGENTS.md so your agent handles the database right.

Claiming your database

Databases created with npx create-db are temporary. A database is deleted 24 hours after creation unless you claim it. With --ttl, it is deleted after the time you set instead (30 minutes to 24 hours), and the CLI output shows that deletion time.

You can prevent this by claiming the database using the claim URL shown in the CLI output:

◆  Claim Your Database
│
│    Keep your database for free:
│
│    https://create-db.prisma.io/claim?projectID=proj_...&utm_source=create-db&utm_medium=cli
│
│    Database will be deleted on <date and time 24 hours from now> if not claimed.

To claim your database and make it permanent:

  1. Copy the claim URL from the CLI output.
  2. Open it in your browser and click Claim database.
  3. Log in to Prisma with GitHub or Google, or sign up if you don't have an account yet.
  4. Choose a Workspace that has capacity for creating new projects.
  5. Click Authorize Prisma Create DB to confirm.
  6. You'll be redirected to a success page. Then, click Go use your database to view and manage the claimed database in your workspace.

When you claim a database:

  • It's moved into a workspace in your Prisma account (Console).
  • It's no longer auto-deleted.
  • You can continue using it as a permanent database instance.

Available CLI options

Here are the CLI flags for the npx create-db command:

FlagShorthandDescription
--region <region>-rAWS region for the database.
Available regions: ap-southeast-1, ap-northeast-1, eu-central-1, eu-west-3, us-east-1, us-west-1. Without it, create-db picks the region closest to you (fallback us-east-1).
--interactive-iRun in interactive mode to select a region.
--json-jOutput machine-readable JSON.
--env <file>-eWrite DATABASE_URL and CLAIM_URL to the specified .env file and print the claim URL and deletion time. If the file exists, the two lines are appended.
--ttl <duration>-tAuto-delete after 30m, or 1h to 24h. The default and maximum is 24h.
--copy-cCopy the connection string to your clipboard.
--quiet-qOnly output the connection string on stdout. The claim URL and deletion time go to stderr.
--open-oOpen the claim URL in your browser.
--help-hDisplay help for the command.

To list the regions you can create a database in, run the regions subcommand. Add --json for machine-readable output.

bunx create-db@latest regions
●  Available Prisma Postgres regions:
│
│
│    ap-southeast-1 - Asia Pacific (Singapore)
│
│    ap-northeast-1 - Asia Pacific (Tokyo)
│
│    eu-central-1 - Europe (Frankfurt)
│
│    eu-west-3 - Europe (Paris)
│
│    us-east-1 - US East (N. Virginia)
│
│    us-west-1 - US West (N. California)

To view all CLI options, use the --help or -h flag. The output lists the commands, then the options of the default create command:

bunx create-db@latest --help
Usage: create-db [options] [command]

Instantly create a temporary Prisma Postgres database
Available subcommands: create (default), regions

Options:
  -V, --version      output the version number
  -h, --help         display help for command

Commands:
  create [options]   Create a new Prisma Postgres database
  regions [options]  List available Prisma Postgres regions

Usage: create-db create [options]

Create a new Prisma Postgres database

Options:
  -r, --region [string]        AWS region for the database; Alias: r (choices:
                               "ap-southeast-1", "ap-northeast-1",
                               "eu-central-1", "eu-west-3", "us-east-1",
                               "us-west-1")
  -i, --interactive [boolean]  Run in interactive mode to select a region;
                               Alias: i (default: false)
  -j, --json [boolean]         Output machine-readable JSON; Alias: j (default:
                               false)
  -e, --env [string]           Write DATABASE_URL and CLAIM_URL to the specified
                               .env file; Alias: e
  -t, --ttl [string]           Auto-delete after (30m, 1h-24h); Alias: t
  -c, --copy [boolean]         Copy the connection string to your clipboard;
                               Alias: c (default: false)
  -q, --quiet [boolean]        Only output the connection string; Alias: q
                               (default: false)
  -o, --open [boolean]         Open the claim URL in your browser; Alias: o
                               (default: false)
  -h, --help                   display help for command

On this page