Medusa DTC Starter
by Medusa
A production-ready starter for direct-to-consumer ecommerce stores powered by Medusa and Next.js. Includes a fully featured storefront with product browsing, cart, checkout, customer accounts, and order management.

Medusa DTC Starter
Documentation | Website
Building blocks for digital commerce
Medusa DTC Starter
A production-ready monorepo starter for direct-to-consumer ecommerce stores powered by Medusa and Next.js. Includes a fully featured storefront with product browsing, cart, checkout, customer accounts, and order management.
Features
- All of Medusa's commerce features
- Multi-region support with automatic country detection
- Product catalog with variant selection
- Cart with promotion codes
- Multi-step checkout with shipping and payment
- Customer accounts with order history and address management
- Order transfer between accounts
Getting Started
Deploy with Medusa Cloud
The fastest way to get started is deploying with Medusa Cloud:
- Create a Medusa Cloud account
- Deploy this starter directly from your dashboard
Local Installation
**Prerequisites:
- Node.js v20+
- PostgreSQL v15+
- pnpm v10+
- Clone the repository and install dependencies:
1git clone https://github.com/medusajs/dtc-starter.git2cd dtc-starter3pnpm install- Set up environment variables for the backend:
cp apps/backend/.env.template apps/backend/.env- Set the database URL in :
1# Replace with actual database URL, make sure the database exists.2DATABASE_URL=postgres://postgres:@localhost:5432/medusa-dtc-starter- Run migrations:
1cd apps/backend2pnpm medusa db:migrate- Add admin user:
1cd apps/backend2pnpm medusa user -e admin@test.com -p supersecret- Start Medusa backend:
1cd apps/backend2pnpm dev-
Open the admin dashboard at and log in. Retrieve your publishable API key at Settings > Publishable API key.
-
Set up environment variables for the storefront:
cp apps/storefront/.env.template apps/storefront/.env.local- Update with your Medusa publishable API key:
NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEY=pk_6c3...- Start storefront:
1cd apps/storefront2pnpm devThe storefront runs on .
You can slo run the following command from the root to start both backend and storefront:
pnpm devConfiguration
The storefront is configured via environment variables in :
| Variable | Description | Default |
|---|---|---|
| Publishable API key from your Medusa backend | — | |
| URL of your Medusa backend | ||
| Default region country code | ||
| Base URL of the storefront | ||
| Stripe publishable key (optional) | — |