# Supabase

> Connect self-hosted Directus to Supabase Postgres and Supabase Storage, and use Directus Labs starters with a Supabase database.

You use [Supabase](https://supabase.com) for Postgres, storage, authentication, and related backend services. You run **Directus** (self-hosted) when you need a **data studio**, **REST and GraphQL APIs**, and **role-based access** on top of that same database so your team can manage and publish structured content without replacing Supabase for your application code.

Directus and Supabase [summarized their stacks as complementary](https://directus.com/resources/how-directus-and-supabase-are-partnering-to-support-backend-developers) (Supabase for developer infrastructure, Directus for shared data and content work across roles). A common split is **Supabase for your product** and **self-hosted Directus** for admin and marketing CMS tasks. Keep Directus auth and permissions separate from your app's Supabase client.

Use the guides below to connect Directus to **Supabase Postgres** and, **optionally**, **Supabase Storage**. Storage drivers live in [Files](/configuration/files) (`supabase` and `s3`). The storage guide covers the Supabase-side steps for the S3-compatible path.

## Documentation

**Connect Supabase Postgres to Directus →**

You connect self-hosted Directus to a Supabase-hosted Postgres database: connection strings, `DB_*` environment variables, SSL, and checks that the instance is healthy.

**Use Supabase Storage with Directus →**

You configure Directus to write uploads to Supabase Storage through the S3-compatible API.

## Directus Labs starters

The **Directus starter templates** ship frontends (Next.js, Nuxt, Astro, SvelteKit, and others) with Directus. To run a starter against Supabase:

1. Follow the starter README to run or deploy the template.
2. Replace default or bundled Postgres `DB_*` values in `docker-compose` or env files (for example under `_shared`) with your Supabase connection and SSL settings from [Connect Supabase Postgres to Directus](/guides/integrations/supabase/connect-supabase-postgres-to-directus).
3. Set the starter's Directus URL variables (for example `NEXT_PUBLIC_DIRECTUS_URL` or `DIRECTUS_URL`) to your running Directus base URL.
4. Add variables from [Use Supabase Storage with Directus](/guides/integrations/supabase/use-supabase-storage-with-directus) when you want uploads in Supabase Storage.

Read the [starters repository](https://github.com/directus-labs/starters) for framework-specific commands. These guides cover only the Supabase-specific configuration.
