Skip to content

Unlimited seats on Netlify Pro for $20/month → Learn more 👥

Getting started

Start using Netlify Database in just a few steps, no matter how far along you are in your building journey.

If you don’t have a project yet, start one of the following ways and Netlify Database will be set up as part of the project from day one.

Go to app.netlify.com/start and describe the application you want to build. Include the type of data you want to store and how you want to access it.

For example:

An app for managing my music collection. For each record, I want to store the title, artist name, year and medium (CD or vinyl). I want to be able to filter entries and search by any of these fields.

Agent Runners will scaffold the project, install @netlify/database, write the necessary migrations, and deploy your project to production.

Whenever you want to make any changes, you can describe them in a new agent run:

For each record, I also want to store the recording studio.

The AI agent will change the application code, create new migrations, apply them, and deploy the project to a preview URL for you to review. Once you’re happy with the result, click Publish to production and your production site is updated.

If you’d rather work from your terminal, the Netlify CLI’s netlify create command kicks off the same agent-driven setup, but in your local machine:

Terminal window
netlify create "An app for managing my music collection. For each record, I want to store the title, artist name, year and medium (CD or vinyl). I want to be able to filter entries and search by any of these fields"

Alternatively, you can let any AI agent you already use locally (Claude Code, Cursor, Codex, and others) build the project for you.

Netlify ships context files and skills that give those agents the right context for working with the platform — including for setting up Netlify Database — so a prompt like the one above gets turned into a working project with the database wired up correctly.

If you already have an existing project, you can add a database to it with just a few steps.

The netlify database init CLI command offers an interactive setup guide for adding Netlify Database to your project.

Terminal window
netlify database init

The command walks you through an interactive setup that:

  • Installs @netlify/database and any other packages you need for your chosen workflow
  • Lets you pick your preferred query style — Drizzle ORM for a type-safe query builder and schema-first migrations, or direct SQL with the @netlify/database package
  • Scaffolds a starter migration so you have a working schema to build on
  • Optionally seeds the database with sample data, so you can run a query end-to-end and see real results before writing any code yourself

When the command finishes, you have a project that’s wired up, populated with data, and ready for a first deploy.

From there, netlify dev starts a fully-featured local Postgres database on your machine, so you can iterate without touching the production database. Refer to Local development for more details.

If you prefer, you can set things up manually:

  1. Install the @netlify/database package:

    Terminal window
    npm install @netlify/database
  2. Optionally, install Drizzle ORM for a type-safe query builder and schema-first migration workflow.

  3. Write your first migration under netlify/database/migrations/.

  4. Write a function or edge function that interacts with the database.

  5. Run netlify dev or your Vite-based framework’s development server (refer to Local development for more information).

  6. Deploy. Netlify automatically provisions the database and applies your migration as part of the deploy lifecycle.

If you’d rather provision the database first and wire up your code afterward, you can also do that from the Netlify UI: navigate to the Database page in your project and select Create a database manually. Once the database is provisioned, follow the same steps above to install the package and write your first migration.