/medusa-commerce:medusa-deployfrom medusa-commerce
Guides deploying Medusa v2 to production including build process, server vs worker mode, environment variables, hosting options, Redis caching, and database configuration.
Ships in medusa-commerce. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Fetch live docs:
site:docs.medusajs.com deployment production for production deployment guidessite:docs.medusajs.com medusa build for build process detailshttps://docs.medusajs.com/resources/medusa-cli for CLI command referencesite:docs.medusajs.com environment variables configuration for env var referencesite:docs.medusajs.com redis cache events for Redis caching and event bus setup| Command | Purpose |
|---|---|
npx medusa build | Compile server + admin dashboard for production |
npx medusa db:migrate | Run pending database migrations |
npx medusa start | Start the production server |
npx medusa worker | Start the background worker process |
The build step compiles TypeScript, bundles admin extensions (Vite), and prepares the .medusa/ output directory.
.medusa/
├── server/ — Compiled server code
│ ├── src/ — Custom modules, routes, workflows
│ └── medusa-config.js
└── admin/ — Bundled admin dashboard (static)
Medusa v2 supports running the server and background workers as separate processes:
| Mode | Command | Handles |
|---|---|---|
| Server | npx medusa start | HTTP requests, API routes, admin dashboard |
| Worker | npx medusa worker | Workflows, scheduled jobs, event subscribers |
| Combined | Default start behavior | Both server and worker (single process) |
| Variable | Purpose | Example |
|---|---|---|
DATABASE_URL | PostgreSQL connection string | postgres://user:pass@host:5432/medusa |
COOKIE_SECRET | Session cookie signing | Random 32+ character string |
JWT_SECRET | JWT token signing | Random 32+ character string |
NODE_ENV | Runtime environment | production |
| Variable | Purpose | Default |
|---|---|---|
REDIS_URL | Redis connection for cache/events/workers | None (in-memory) |
STORE_CORS | Store API CORS origins | http://localhost:8000 |
ADMIN_CORS | Admin API CORS origins | http://localhost:9000 |
AUTH_CORS | Auth route CORS origins | Combination of store + admin |
PORT | Server listen port | 9000 |
MEDUSA_ADMIN_ONBOARDING_TYPE | Admin onboarding flow | default |
MEDUSA_WORKER_MODE | server, worker, or shared | shared |
?sslmode=require to DATABASE_URL# Generate migration after DML model changes
npx medusa db:generate <module_name>
# Apply migrations
npx medusa db:migrate
Redis serves three roles in production Medusa:
| Role | Purpose | Required? |
|---|---|---|
| Event Bus | Pub/sub for event-driven subscribers | Recommended |
| Cache | Module data caching layer | Recommended |
| Worker Queue | Job queue for background workflows | Required for worker mode |
Configure in medusa-config.ts by registering the Redis modules:
// Fetch live docs for Redis module registration
// in medusa-config.ts modules array
maxmemory and eviction policies for cache| Platform | Type | Notes |
|---|---|---|
| Railway | PaaS | One-click deploy, managed PostgreSQL and Redis |
| DigitalOcean App Platform | PaaS | Managed infrastructure, auto-scaling |
| AWS (EC2/ECS/Fargate) | IaaS/CaaS | Full control, use with RDS and ElastiCache |
| Google Cloud Run | Serverless containers | Auto-scaling, pay-per-use |
| Render | PaaS | Simple deploy, managed databases |
| Self-hosted (Docker) | Container | Full control, use Docker Compose or Kubernetes |
| Vercel | Serverless | Admin/storefront hosting only (not the Medusa server) |
# Fetch live docs for official Medusa Dockerfile
# and docker-compose.yml patterns
A typical Docker Compose setup includes three services: Medusa server, PostgreSQL, and Redis.
NODE_ENV=productionCOOKIE_SECRET and JWT_SECRETDATABASE_URL with SSL mode enabledREDIS_URL for events, cache, and worker queueSTORE_CORS, ADMIN_CORS, AUTH_CORS)npx medusa build successfullynpx medusa db:migrate against production database--max-old-space-size for Node.js memory limitsFetch the Medusa deployment documentation for exact build flags, Docker configuration, and platform-specific deployment guides before deploying.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
21 skills in this plugin
/medusa-adminExtend the Medusa v2 admin dashboard — widgets injected at zones, custom UI routes, Medusa UI components, and Admin API integration. Use when customizing the admin interface./medusa-api-routesCreate custom Medusa v2 API routes — file-based routing, HTTP method exports, middleware configuration, Zod validators, authentication middleware, and additional-data pattern. Use when adding REST endpoints./medusa-cart-checkoutImplement Medusa v2 cart and checkout — cart lifecycle, line items, shipping and payment selection, sales channels, and checkout completion flow. Use when building cart and checkout features.npx claudepluginhub orcaqubits/agentic-commerce-skills-plugins --plugin medusa-commerceOther plugins' skills for the same job