supabaseDOCS
DatabaseFundamentalsConnecting to your database

Connect to your database

Supabase provides multiple methods to connect to your Postgres database, whether you're working on the frontend, backend, or using serverless functions.

Find your connection stringStep 1 of 3

Where does your code run?

How to connect to your Postgres databases

How you connect to your database depends on where you're connecting from:

  • For frontend applications, use the Data API
  • For Postgres clients, use a connection string — direct connection for single sessions or native commands, session mode for persistent clients on IPv4-only networks, transaction mode for temporary clients like serverless functions
ModeHost:PortIP versionBest for
Direct connectiondb.[project-id].supabase.co:5432IPv6 (IPv4 with add-on)Migrations, pg_dump, long-lived backend
Shared pooler — sessionaws-[region].pooler.supabase.com:5432IPv4Persistent backend on IPv4-only networks
Shared pooler — transactionaws-[region].pooler.supabase.com:6543IPv4Serverless and edge functions
Dedicated poolerdb.[project-id].supabase.co:6543IPv6 (IPv4 with add-on), paidHigh-performance app traffic

Quickstarts

Prisma
Drizzle
Postgres.js
pgAdmin
PSQL
DBeaver

Direct connection

The direct connection string connects directly to your Postgres instance. It is ideal for persistent servers, such as virtual machines and long-lasting containers.

postgresql://postgres:[YOUR-PASSWORD]@db.abcdefghijklmnopqrst.supabase.co:5432/postgres

Poolers

Supabase offers two poolers. The Shared Pooler (Supavisor) is multi-tenant, available on every project, and IPv4-only.

Pooler session mode

postgres://postgres.apbkobhfnmcqqzqeeqss:[YOUR-PASSWORD]@aws-[REGION].pooler.supabase.com:5432/postgres

Pooler transaction mode

postgres://postgres.apbkobhfnmcqqzqeeqss:[YOUR-PASSWORD]@aws-[REGION].pooler.supabase.com:6543/postgres

This page is a Design Engineer application prototype, not the real Supabase docs. Static content is condensed from the public Connect to your database guide for layout fidelity.