Medusa.js Installation and Setup
Medusa 2.x requires Node.js 20+, PostgreSQL 15+, Redis 7+. Official CLI create-medusa-app deploys backend and optionally Next.js Storefront and Admin Dashboard.
Quick Start
npx create-medusa-app@latest mystore
# Interactive setup asks:
# - Project name
# - Need Next.js Storefront?
# - Need Admin Dashboard?
# - PostgreSQL connection string
Manual Installation
mkdir mystore && cd mystore
npm init -y
npm install @medusajs/medusa @medusajs/framework
npx medusa new . --skip-db
# Environment variables (.env)
DATABASE_URL=postgresql://medusa:password@localhost:5432/medusa_db
REDIS_URL=redis://localhost:6379
JWT_SECRET=$(openssl rand -base64 32)
COOKIE_SECRET=$(openssl rand -base64 32)
STORE_CORS=http://localhost:8000
ADMIN_CORS=http://localhost:9000
AUTH_CORS=http://localhost:9000,http://localhost:8000
# Migrations and seed
npx medusa db:create
npx medusa db:migrate
npx medusa user -e [email protected] -p AdminPass123 --invite
# Run dev server
npx medusa dev
Admin Dashboard Setup
npm create @medusajs/admin-vite-plugin@latest medusa-admin
cd medusa-admin
npm install
npm run dev # http://localhost:9000
Timeline: basic install + environment setup + first run — 2–4 hours; production deploy with Docker and SSL — 1 day.







