# Create a new app with PostgreSQL (/docs/prisma-orm/quickstart/postgresql) > 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. Create a new Prisma ORM project with PostgreSQL using create-prisma@latest. Location: Prisma ORM > Quickstart > Create a new app with PostgreSQL This page uses PostgreSQL. [Use MongoDB instead](https://www.prisma.io/docs/prisma-orm/quickstart/mongodb). Create a Prisma ORM app with PostgreSQL and run your first query against seeded data. > [!NOTE] > Using Prisma ORM 7? > > Prisma ORM 8 is a release candidate. Prisma ORM 7 remains fully supported; its docs live at [/orm/v7](https://www.prisma.io/docs/orm/v7) and its setup paths at [/v7/getting-started](https://www.prisma.io/docs/v7/getting-started). > > For what release candidate means, when the final release is expected, and how to stay on version 7, see [Release status](https://www.prisma.io/docs/orm/release-status). For the Prisma ORM 8 name of every Prisma ORM 7 API, see [Coming from Prisma ORM 7](https://www.prisma.io/docs/orm/coming-from-prisma-orm-7). ## Quick start [#quick-start] You need Node.js 22.18 or newer on the 22 line, 24.11 or newer on the 24 line, or 26 or newer; Node.js 24 is recommended. The npm that ships with your Node.js release works; on Node.js 22 that is npm 10. [Supported versions](https://www.prisma.io/docs/orm/supported-versions) has every floor. #### bun ```bash bun create prisma@latest --provider postgres --no-deploy ``` #### pnpm ```bash pnpm create prisma@latest --provider postgres --no-deploy ``` #### yarn ```bash yarn create prisma@latest --provider postgres --no-deploy ``` #### npm ```bash npm create prisma@latest -- --provider postgres --no-deploy ``` The command preselects PostgreSQL and prompts you for the project name, the template, the contract authoring style (PSL or TypeScript), your package manager, and whether to install agent skills. If you would rather add Prisma ORM to a project by hand, without the generated template, follow [Set up Prisma ORM from scratch](https://www.prisma.io/docs/prisma-orm/from-scratch). Setup gives you the app template, a starter contract, `prisma-8.md`, project-level Prisma ORM skills for your coding agent, and package scripts for the database steps below. Answer no at the skills prompt, or pass `--skills none`, to skip the agent skill files; to remove them later, see [`skills sync`](https://www.prisma.io/docs/cli/skills) and the [`skills` config section](https://www.prisma.io/docs/cli/configuration#agent-skills). Sample users are seeded automatically the first time the app queries the database, so there is no separate seed step. Next, get a PostgreSQL database, connect the app to it, and run your first query. To keep everything on your machine, skip to [Run with a local database instead](#run-with-a-local-database-instead). ### 1. Get a database [#1-get-a-database] If you already have a PostgreSQL database, go to [step 2](#2-set-the-database-connection) with its connection string. If you don't, create a [Prisma Postgres](https://www.prisma.io/docs/postgres) database from the terminal, without an account or with a free one. **Without an account:** run [`npx create-db`](https://www.prisma.io/docs/postgres/npx-create-db) to create a temporary Prisma Postgres database. It prints a connection string and a claim URL: ```bash npx create-db@latest ``` The temporary database is deleted after 24 hours unless you claim it with a free Prisma account, using the claim URL in the same output. **With a free Prisma account:** to keep the database from the start, sign in from the generated project directory, create a project, and create a database in it. If you have no account yet, [create one](https://console.prisma.io/sign-up?utm_source=docs\&utm_medium=content\&utm_content=orm-quickstart-postgresql) first; the Free plan needs no credit card. ```bash npx prisma auth login npx prisma project create my-app-db npx prisma postgres create my-db ``` `auth login` opens your browser, and `project create` links the directory to the new project. Name the project differently from your app, so that it does not collide with the project a later deploy creates. `postgres create` prints the connection string once; mint another later with `npx prisma postgres connection create my-db` if you need one. See [`postgres`](https://www.prisma.io/docs/cli/postgres). ### 2. Set the database connection [#2-set-the-database-connection] Export `DATABASE_URL` in the shell you run the commands from, with the connection string from step 1 as its value. The generated scripts read the variable from the environment, not from `.env`. ```bash export DATABASE_URL="" ``` A PostgreSQL connection string has the form `postgresql://username:password@host:5432/database?sslmode=require`. Without a database to connect to, `npm run db:init` in step 3 stops with `CONFIG.DB_CONNECTION_REQUIRED` when `DATABASE_URL` is not set, or with `DRIVER.CONNECTION_FAILED` when it is still a placeholder. ### 3. Initialize the database [#3-initialize-the-database] From the generated project directory, run `db:init` to apply the starter contract to PostgreSQL and sign the database. #### bun ```bash bun run db:init ``` #### pnpm ```bash pnpm run db:init ``` #### yarn ```bash yarn db:init ``` #### npm ```bash npm run db:init ``` The output includes a summary like `Applied 5 operation(s) across 1 contract space`, followed by the operations and the marker it wrote. ### 4. Run the app [#4-run-the-app] Start the app and confirm the sample query runs successfully. #### bun ```bash bun run dev ``` #### pnpm ```bash pnpm run dev ``` #### yarn ```bash yarn dev ``` #### npm ```bash npm run dev ``` Use the URL or terminal output shown by your template. You should see the seeded users returned from PostgreSQL. If the response is `Could not query users yet`, `DATABASE_URL` is not set in the environment the app runs in; export it in the same shell and restart. ## Run with a local database instead [#run-with-a-local-database-instead] [Prisma Composer](https://www.prisma.io/docs/composer) builds the app, starts a local Prisma Postgres database, and applies the starter contract for you, so you need no connection string and none of the steps above. #### bun ```bash bun run dev:composer ``` #### pnpm ```bash pnpm run dev:composer ``` #### yarn ```bash yarn dev:composer ``` #### npm ```bash npm run dev:composer ``` Open the URL the command prints. You should see the seeded users returned from PostgreSQL. For other ways to run the database locally, see [A database on your machine](https://www.prisma.io/docs/prisma-orm/local-database). ## Next steps [#next-steps] * Open `src/prisma/contract.prisma` or `src/prisma/contract.ts` and change the starter model. * If you already have an app, follow [Add Prisma ORM and PostgreSQL to an existing app](https://www.prisma.io/docs/prisma-orm/quickstart/existing-app/postgresql) when its database is empty, or [Add Prisma ORM to an existing PostgreSQL database](https://www.prisma.io/docs/prisma-orm/add-to-existing-project/postgresql) when the database already has tables. * Read the [Prisma ORM overview](https://www.prisma.io/docs/orm) when you want the concepts behind contracts, query APIs, and migrations. ## Related pages - [`Create a new app with MongoDB`](https://www.prisma.io/docs/prisma-orm/quickstart/mongodb): Create a new Prisma ORM project with MongoDB using create-prisma@latest.