npx create-db
create-db
is an open-source CLI tool that provisions temporary Prisma Postgres databases with a single command.
- Fast setup: No sign-up required to create a temporary production-ready Prisma Postgres database.
- Lifetime: Each database is available for 24 hours by default.
- Keep for free: You can claim a database (via the URL provided in the CLI output) to make it permanent.
Prerequisites
To use npx create-db
, you need:
- Node.js version
16
or higher (we recommend the latest LTS version). - npm (comes with Node.js) to run
npx
commands.
A Prisma Data Platform account is not required to create a temporary database. However, if you want to keep a database permanently, you can claim it (details below).
Getting started
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:
npx create-db@latest
- The
@latest
tag automatically downloads and runs the latest version of the tool, hence, no global installation required. - After a few seconds, you'll receive connection strings for both Prisma ORM projects and standard PostgreSQL.
- The default region is
us-east-1
. You can specify the region where you want to provision the database in using 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:
npx 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
:
npx create-db@latest -i
To view all options and regions:
npx create-db@latest --help
CLI output walkthrough
Here is an example output:
┌ 🚀 Creating a Prisma Postgres database
│
│ Provisioning a temporary database in us-east-1...
│
│ It will be automatically deleted in 24 hours, but you can claim it.
│
◇ Database created successfully!
│
● Connect to your database →
│
│ Use this connection string optimized for Prisma ORM:
│ prisma+postgres://accelerate.prisma-data.net/?api_key=...
│
│ Use this connection string for everything else:
│ postgresql://<username>:<password>@db.prisma.io:5432/postgres
│
◆ Claim your database →
│
│ Want to keep your database? Claim for free:
│ https://create-db.prisma.io?projectID=proj_...
└
Once you have the output, take the Prisma ORM-optimized connection string (prisma+postgres://...
) and add it to your .env
file as DATABASE_URL
:
DATABASE_URL="prisma+postgres://accelerate.prisma-data.net/?api_key=..."
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 (postgresql://...
) with any PostgreSQL-compatible client, such as psql
, pgAdmin
, node-postgres
, or an ORM of your choice. Detailed instructions are available in the guide for connecting via direct PostgreSQL connection string.
Claiming your database
By default, databases created with npx create-db
are temporary and will be automatically deleted after 24 hours.
You can prevent this by claiming the database using the claim URL shown in the CLI output:
◆ Claim your database →
│
│ Want to keep your database? Claim for free:
│
│ https://create-db.prisma.io?projectID=proj_...
│
│ Your database will be deleted on 7/24/2025, 2:25:41 AM if not claimed.
To claim your database and make it permanent:
- Copy the claim URL from the CLI output.
- Open it in your browser and click Claim database.
- Sign in to your (or create one if you don’t have it yet).
- Choose a Workspace that has capacity for creating new projects.
- Click Authorize Prisma Create DB to confirm.
- 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 your Prisma Data Platform account workspace.
- It's no longer auto-deleted after 24 hours.
- You can continue using it as a permanent database instance.
Available CLI options
Here are the CLI flags for the npx create-db
command:
Flag | Shorthand | Description |
---|---|---|
--region | -r | Specify a region. Available regions: ap-southeast-1 , ap-northeast-1 , eu-central-1 , eu-west-3 , us-east-1 , us-west-1 |
--interactive | -i | Run in interactive mode (select region from a list). |
--help | -h | Show this help message. |
To view all CLI options use the --help
or -h
flag:
npx create-db@latest --help