apps/docs/content/docs.v6/postgres/introduction/npx-create-db.mdx
create-db is an open-source CLI tool that provisions temporary Prisma Postgres databases with a single command.
To use npx create-db, you need:
16 or higher (we recommend the latest LTS version).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).
The create-db web application provides a browser-based interface for creating and managing your databases.
You can create a database using one of the following options:
Run the following command in your terminal:
npx create-db@latest
@latest tag automatically downloads and runs the latest version of the tool, hence, no global installation required.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.If you want to select a region manually:
npx create-db@latest --interactive
us-east-1, eu-west-3).-i:npx create-db@latest -i
To view all options and regions:
npx create-db@latest --help
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!
│
● Database Connection
│ Connection String:
│ postgresql://<username>:<password>@db.prisma.io:5432/postgres
│
◆ Claim your database →
│ Keep your database for free:
│ https://create-db.prisma.io?projectID=proj_...
└
Once you have the output, take the connection string and add it to your .env file as DATABASE_URL:
DATABASE_URL="postgresql://<username>:<password>@db.prisma.io:5432/postgres"
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.
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:
When you claim a database:
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). |
--json | -j | Output machine-readable JSON and exit. |
--help | -h | Show this help message. |
To view all CLI options use the --help or -h flag:
npx create-db@latest --help
npx create-db@latest [options]
Options:
--region <region>, -r <region> 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
--help, -h Show this help message