Skip to main content
The Supabase integration connects a Supabase project you own to your Lovable project and uses it as your app’s backend. When connected, Lovable builds full-stack features directly from chat: it designs your database schema, runs migrations, deploys edge functions, and wires your app’s UI to your data, all against your own Supabase project.
Do I need Supabase? No. Lovable Cloud is the built-in backend and is enabled by default, so most projects never need a separate Supabase account. Lovable Cloud utilizes Supabase’s open-source foundation, so you get the same database, auth, storage, and edge function capabilities without any setup.Connect your own Supabase project when you want direct ownership of the backend: your own Supabase account and billing, full access to the Supabase dashboard, or an existing Supabase project you already use.
The Supabase integration is available on all plans.

Supabase or Lovable Cloud?

Switching between the two is not automatic. There is no one-click migration from Lovable Cloud to Supabase or from Supabase to Lovable Cloud, so it’s worth deciding early which backend you want a project to use. See the Lovable Cloud documentation for details on exporting Cloud data.

What you can build

With Supabase connected, you can prompt Lovable to build complete backend features:
  • Store and query data: Lovable designs tables and relationships from a plain-language description and connects your UI to them.
  • Sign users in: email and password authentication, social logins, and access control backed by Supabase Auth.
  • Upload and serve files: images, documents, and other media stored in Supabase Storage buckets.
  • Run server-side code: Supabase Edge Functions for payments, emails, AI features, scheduled tasks, and external API calls.
  • Keep secrets safe: API keys for services like Stripe or Resend are stored securely in your Supabase project, never in your app’s code.
  • Update in real time: live chat, feeds, and dashboards using Supabase’s real-time subscriptions.
For the full picture of everything the Supabase platform offers, see the Supabase documentation.

Prerequisites

  • A Supabase account. Sign up or sign in; the free tier is enough to get started.
  • A Supabase project to connect, or a Supabase organization where you can create one.

Connect Supabase to Lovable

Connecting involves two separate actions, often done by different people:
  1. Link a Supabase organization to your Lovable workspace. A workspace owner or admin does this once per organization. Linked organizations become available to everyone in the workspace.
  2. Connect a Lovable project to a Supabase project. Anyone with edit access to the project can do this, using any project from a linked organization.
If you’re a workspace owner or admin doing this for the first time, the connect dialog walks you through both actions in one flow. You can link an organization from any of these places:
  • The Supabase connector page: open Connectors from the dashboard sidebar, select Supabase, and click Connect Supabase (or Manage Connected Organizations if the workspace already has one).
  • The connect dialog in a project: in the editor, open More → Cloud, click Already have a Supabase project? Connect it here, and use Add Organization.
  • When creating a project: on the dashboard, click + in the prompt box, open Databases, and choose Add Supabase organization.
Whichever you choose, a Supabase window opens where you sign in and authorize Lovable for the organization you pick. The organization then appears under Linked Supabase organizations and is available to every member of the workspace. Members don’t need their own Supabase accounts to connect projects from it.
Only workspace owners and admins can add or reconnect organizations. If these options are disabled for you, ask a workspace admin to link the organization first.

Connect your Lovable project to a Supabase project

When an organization is linked, anyone with edit access to a project can connect it. Start from either place:
  • When creating a new project: on the dashboard, click + in the prompt box, open Databases, and pick a Supabase project under the Supabase heading (or type “Supabase” in the menu search). The new Lovable project is created with that Supabase project as its backend.
  • In an existing project: connect from the Cloud view in the editor:
1

Open the connect dialog

In the editor, open More → Cloud and click Already have a Supabase project? Connect it here. The link appears on projects that don’t have a backend yet, next to the Enable Cloud option.In the Linked Supabase organizations dialog, click Continue.
2

Choose a Supabase project

The Connect project step lists the Supabase projects in your linked organizations. Click Connect next to the project you want to use.Don’t have a Supabase project yet? Click Create Project to open the Supabase dashboard, create one there, and then return to Lovable to connect it.
3

Verify the connection

After connecting, the Cloud view shows your Supabase project’s name and status, with quick links to the Supabase dashboard. You can now prompt Lovable to build backend features.
If the connect link shows Wait for Lovable to finish working, Lovable is still processing a request in this project. Wait for it to finish, then try again.

How Lovable works with your Supabase project

With Supabase connected, Lovable manages your backend from chat. You don’t need to write SQL or copy code into the Supabase dashboard.

Database

Supabase provides a hosted PostgreSQL database, so your app keeps the full power and scalability of SQL without you managing servers. Whenever a feature needs to store data, describe it in plain language and Lovable designs the tables, columns, and relationships for you:
Schema changes run as reviewed migrations: Lovable writes the SQL, shows it to you, and asks for your approval in chat before running it. After you approve, Lovable executes the migration on your Supabase project, saves the migration file in your project’s code (under supabase/migrations/), and regenerates the TypeScript types your app uses. Lovable also asks for your approval before inserting or changing data. Reading data for debugging (for example, checking why a page is empty) does not modify anything. You can always work with your data directly in the Supabase dashboard as well: the Table Editor shows rows in a spreadsheet-like view where you can inspect and edit records, and the SQL Editor lets you run your own queries. Real-time updates: Supabase can stream database changes to your app, which enables features like live chat, notifications, or dashboards that update for all users without refreshing. Prompt Lovable to make a feature update in real time and it wires up the subscription:

Authentication

Prompt Lovable to add signup and login flows backed by Supabase Auth:
Lovable wires the pages to your Supabase project, so users who register through your app appear under Authentication in the Supabase dashboard, where you can also add test users manually. Authentication settings themselves live in your Supabase project, not in Lovable. To offer social logins (such as Google or GitHub), enable the provider in your Supabase dashboard’s Authentication settings and supply the OAuth credentials the provider requires. Then prompt Lovable to add the matching sign-in button and flow to your app:
While testing, turn off email confirmation in your Supabase dashboard’s Authentication settings so test accounts can sign in immediately. Re-enable it before launching to real users.

Edge functions

Supabase Edge Functions are serverless functions: small pieces of backend code that run on Supabase’s infrastructure, without you provisioning or managing a server. They’re the right tool whenever your app needs logic that can’t or shouldn’t run in the user’s browser. Typical uses:
  • AI features: calling a model API to summarize, classify, or chat.
  • Sending emails or notifications: for example, a welcome email on signup via an email API like Resend.
  • Processing payments: creating checkout sessions and handling webhooks with Stripe.
  • Scheduled tasks: recurring jobs like a nightly cleanup or a daily summary.
  • Calling external APIs with secret keys: anything that uses credentials you can’t expose in frontend code.
You don’t write these functions yourself. Describe the behavior in chat, and Lovable writes the function, deploys it to your Supabase project, and updates your app to call it:
When a function fails, Lovable reads its logs and surfaces the error in chat to help you fix it. You can also monitor your functions yourself in the Supabase dashboard under Edge Functions, where each function has its own logs.

Secrets

Many backend features depend on secret API keys, such as a Stripe secret key for payments or a Resend key for email. When a feature needs one, Lovable detects it and prompts you to enter the value through a secure input. Secrets are stored in your Supabase project, where your edge functions can read them; they never appear in your app’s code or repository, and Lovable does not read stored secret values back.
For example, when Lovable deploys a payment function, the function reads your Stripe secret key from Supabase’s secret store to authenticate with Stripe. You can manage stored secrets in the Supabase dashboard under your project’s Edge Functions settings.

Storage

Supabase Storage hosts files (images, videos, PDFs, and other media) alongside your database, organized into buckets with their own access permissions. Ask for a file upload feature and Lovable builds the upload logic and creates the buckets, asking for your approval before creating or changing buckets on your Supabase project:
Uploaded files are stored in a bucket in your Supabase project, and Lovable handles retrieving the file URLs to display them in your app. You can browse files and manage bucket permissions in the Supabase dashboard under Storage. Upload size limits follow your Supabase plan (on Supabase’s free tier, individual files are limited to 50 MB); see Supabase pricing for current limits.

Security checks

Lovable runs automated security checks against your database configuration, including Row Level Security (RLS) coverage, and flags issues it finds after schema changes.
Before going live, make sure every table has Row Level Security policies that restrict who can read and write each row. Ask Lovable to review your policies (for example, “Make sure users can only see and edit their own data”), and verify them yourself in the Supabase dashboard. Missing RLS policies are the most common way app data gets exposed.

Managing the connection

The connection has two levels, managed in different places: the project connection (which Supabase project a Lovable project uses) and the workspace’s linked organizations (which Supabase organizations the whole workspace can use).

Manage the project connection

In the editor, open More → Cloud on a connected project. From there you can:
  • See the connected project’s name and health status.
  • Jump to the Supabase dashboard: the project overview, user management, SQL editor, edge functions, and secrets.
  • Disconnect the project.
Your backend lives in Supabase, so day-to-day management of data, users, and files happens in the Supabase dashboard.

Manage linked organizations (workspace owners and admins)

Open Connectors from the dashboard sidebar, select Supabase, and use Manage Connected Organizations to link additional Supabase organizations or reconnect one whose access has expired. The Manage organizations button in a connected project’s Cloud view opens the same place.

Disconnect Supabase

1

Open the Cloud view

In the editor, open More → Cloud. The view shows your connected Supabase project.
2

Disconnect

Click Disconnect, then confirm in the Disconnect Supabase dialog.
Disconnecting stops Lovable from deploying edge functions and reading your database schema, but it does not change your code and does not delete anything in your Supabase project. You can reconnect to the same or a different Supabase project later.

Limitations

  • Each Lovable project connects to one Supabase project at a time.
  • There is no automatic migration between Lovable Cloud and your own Supabase project, in either direction.
  • Supabase usage limits (database size, file upload size, bandwidth) follow your Supabase plan. Check Supabase pricing for current limits.

Lovable features that require Lovable Cloud

Some Lovable features are built for Lovable Cloud backends and don’t apply when you bring your own Supabase project:
  • In-editor backend views: the Database, Users, Storage, Secrets, Jobs, Usage, and Logs views in the Cloud section. With your own Supabase project, you use the Supabase dashboard instead.
  • Managed infrastructure: daily backups with restore, pausing, and instance resizing from inside Lovable. You manage backups, compute, and billing in Supabase.
  • Built-in payments: Paddle and Stripe payments through Lovable require Lovable Cloud for webhooks and subscription data.
  • Custom emails: sending your app’s emails from your own domain requires Lovable Cloud.
  • Configuring auth through Lovable: enabling social login providers and changing auth settings from chat, including managed Google authentication and SAML SSO for your app’s users, works on Lovable Cloud only. On your own Supabase project, configure these in the Supabase dashboard.
  • Signed-in browser testing: Lovable can test your app as a logged-in user on Lovable Cloud only; with your own Supabase project it tests pages that don’t require signing in.
  • Sensitive data scanning: PII detection covers Lovable Cloud databases and storage.

Troubleshooting

Lovable can’t find the connected Supabase project. The linked project may have been deleted in the Supabase dashboard, or your workspace’s access to the Supabase organization may have changed.Click Disconnect to clear the broken link, or Manage organizations to reconnect the organization and pick a project again.
Projects that aren’t ready in Supabase (for example, paused or still provisioning) can’t be connected, and Lovable shows Check project status in Supabase. Open the Supabase dashboard, make sure the project is active, then try again.
Linking a Supabase organization requires workspace admin permissions. Ask a workspace owner or admin to link the organization; after that, anyone with edit access to a project can connect it.

FAQ

No. Lovable Cloud is the default backend and covers database, authentication, storage, edge functions, and AI features without a separate account. Connect your own Supabase project only if you want to own and manage the backend yourself.
Yes. Supabase is a separate platform with its own account and billing. Lovable credits cover the building work Lovable does; everything your backend consumes (database, storage, bandwidth) is billed by Supabase under your Supabase plan. Both platforms have free tiers, so you can start without paying.
Workspace owners and admins link Supabase organizations to the workspace. After an organization is linked, anyone with edit access to a project can connect it to a Supabase project from that organization, without needing their own Supabase account. Viewers can’t connect projects.
No. This was how the integration used to work, but Lovable now runs database migrations for you. It shows you the change, asks for approval in chat, executes the migration on your Supabase project, and keeps migration files and generated types in your project’s code.
There is no automatic migration in either direction. If you need to move, you’ll recreate the schema and move data manually: export your data from the current backend, connect the new one, and ask Lovable to rebuild the schema. For exporting from Lovable Cloud, see Lovable Cloud.
Yes. Each Lovable project connects to one Supabase project, but nothing stops several Lovable projects from connecting to the same Supabase project (for example, a customer app and an admin dashboard sharing one database). All of them read and write the same data, so design your schema and RLS policies with that in mind.
Yes. Ask Lovable to create an edge function that acts as a custom API endpoint or webhook for the external service; this works the same way on Lovable Cloud. With your own Supabase project, you additionally get direct access to Supabase’s auto-generated REST API and client libraries, so external tools can also read and write your data without going through an endpoint you build.
Lovable stops deploying edge functions and reading your database schema. Your code is not changed, and nothing is deleted from your Supabase project. You can reconnect later.