This repository contains two separate projects:
admin/- Medusa Admin Dashboardstorefront/- Frontend Storefront UI
- Node.js (v18 or later)
- PostgreSQL database server
- Redis server
-
Copy environment template files:
cp admin/.env.template admin/.env cp storefront/.env.template storefront/.env
-
Update the
.envfiles with your PostgreSQL and Redis connection details:In
admin/.env:DATABASE_URL=postgresql://postgres:postgres@localhost:5432/medusa-docker REDIS_URL=redis://localhost:6379
Run this once to install dependencies and build both projects:
npm run deployThis command runs:
npm install --legacy-peer-depsin bothadmin/andstorefront/- Builds both projects
- Runs database migrations for the admin
Open two separate terminals:
📦 Terminal 1: Start Admin
npm run start-adminAdmin will be available at: http://localhost:9000
- Go to Settings in the admin panel
- Copy the publishable API key
- Update the
NEXT_PUBLIC_MEDUSA_PUBLISHABLE_KEYinstorefront/.env
🛍️ Terminal 2: Start Storefront
npm run start-storefrontStorefront will be available at: http://localhost:8000 (Port may vary depending on config.)
Note: If this setup seems too complex, consider using Option 2 (Docker setup) below which handles all dependencies automatically.
Docker provides an easier way to set up the entire project with all dependencies.
Run this command to start all services with Docker:
docker compose upThis will:
- Set up PostgreSQL database
- Set up Redis
- Build and start the Medusa admin backend
- Build and start the storefront
Once Docker Compose has finished startup:
- Admin Dashboard: http://localhost:9000
- Storefront: http://localhost:8000
- PostgreSQL: Available on
localhost:5432- User:
postgres - Password:
postgres - Database:
medusa-docker
- User:
- Redis: Available on
localhost:6379
To stop all services:
docker compose downTo stop and remove volumes (will delete database data):
docker compose down -v| Script | Description |
|---|---|
npm run deploy |
Installs and builds both admin & storefront |
npm run setup-admin |
Setup, install & build admin; run migrations |
npm run start-admin |
Starts admin server |
npm run setup-storefront |
Setup, install & build storefront |
npm run start-storefront |
Starts storefront server |
- No background processes are used in this setup — run servers in separate terminals (when not using Docker).
- When using Docker, all services are managed automatically.
- The Docker setup includes persistent volumes for the database and node_modules.
Feel free to open issues or PRs if you'd like to improve or extend this setup!
This Medusa starter is open source and available under the MIT License. See the LICENSE file for more information.
This starter includes the FrontendDesigner.jsx component in the admin interface which references or depends on the designmint designer, which is not open source. Users of this starter must separately obtain appropriate licensing for the designmint designer component. See the NOTICE file for more details about third-party components.