Blog/Connect Medusa JS to Supabase

How to Connect Medusa JS to Supabase: Step-by-Step Guide

[Published On August 14, 2025]

Medusa JS Supabse integration
Share

If you’re a new-gen developer or a vibe coder, chances are you’re already familiar with Supabase and its effortless ease of use. When it comes to integrating with Medusa, Supabase offers an easy way to set up your Postgres database, no need to mess around with Docker containers.


In this quick tutorial, I’ll show you how to connect Supabase postgres with Medusa JS in under 5 minutes.

Ready? Start the clock!

Create A Supabase Project

First, head over to Supabase and create a new project for your Medusa JS store.

In the 'Create a Project' dialog, choose a strong password and store it somewhere safe, you’ll need it later.

Also, choose the region closest to you, your customers, and where your storefront and Medusa dashboard will be hosted. This will help keep things fast!


It’ll take a couple of minutes for your Supabase project to set up. Once it’s ready, you’ll be taken to your project dashboard.

Once you’re on your project dashboard, click the Connect button at the top to view your database credentials.

We’ll use the Transaction pooler connection string. Copy it and replace [YOUR-PASSWORD] with the password you set earlier.

Create A New Medusa Project

In your terminal, run the following command to create a new Medusa.js project with the database URL.

1npx create-medusa-app@latest my-medusa-store --db-url "postgresql://postgres.[SUPABASE-PROJECT-ID]:[YOUR-PASSWORD]@aws-1-ca-central-1.pooler.supabase.com:6543/postgres"

If the connection is successful, you’ll see the project installation begin.

Once finished, you'll be directed to localhost:9000 to create your Medusa admin account!

Medusa JS signup screen

And that’s it! You’ve successfully integrated Supabase Postgres with Medusa JS.

Medusa Database Structure

To peek under the hood of your project, head back to Supabase and open the Table Editor tab, you’ll see a bunch of new tables created during migration.

These are the tables that power your app, covering functionality like carts, promotions, customers, and more!

Once you’re fully immersed in the world of Medusa, it’s often helpful to check the tables when tracking down an issue or bug. So make sure to get familiar with these tables and understand how they work!

Key Things to Keep in Mind

Speed

If you’re using a hosted Postgres service like Supabase, performance might be a bit slower. This is because every query has to travel over the internet instead of a local network.

Region

Make sure your Medusa backend, storefront, and Postgres are in the same region. This helps reduce network latency, so requests are processed faster and your Medusa eCommerce store feels more responsive.

Compute Size

For your Supabase project, choose hardware that fits your needs. You’ll pay extra for larger plans, but it’s well worth the cost if you’re taking the project into production.

Thu, Aug 14, 2025, 09:19 PM

© 2025 306 Technologies Ltd. All Rights Reserved.

[Technology Partners]
Shopify Partner | 306 TechnologiesVercel Partner | 306 TechnologiesBooqable Partner | 306 Technologies