Medusa Deploy logo

Medusa Deploy

Organization
OrcaQubits
medusa-deploy

Deploy Medusa v2 to production — build process, server vs worker mode, environment variables, hosting options, Redis caching, database configuration, and production checklist. Use when deploying Medusa applications.

Overview

PublisherOrcaQubits
Repositoryagentic-commerce-skills-plugins
Skill namemedusa-deploy
Stars
40
Forks
17
Bundled files
Instructions only
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • Self-contained

    Everything the model needs lives in the instructions — no extra files to sync.

  • Open source

    Published by OrcaQubits on GitHub. Read the source before you install it.

Installation

Install the Medusa Deploy AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/OrcaQubits/agentic-commerce-skills-plugins/tree/main/medusa-commerce/skills/medusa-deploy
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/OrcaQubits/agentic-commerce-skills-plugins.git /tmp/agentic-commerce-skills-plugins
mkdir -p .claude/skills
cp -r /tmp/agentic-commerce-skills-plugins/medusa-commerce/skills/medusa-deploy .claude/skills/medusa-deploy
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Medusa Deploy in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Medusa Deploy on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Medusa Deploy is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Medusa v2 Deployment

Before writing code

Fetch live docs:

  1. Web-search site:docs.medusajs.com deployment production for production deployment guides
  2. Web-search site:docs.medusajs.com medusa build for build process details
  3. Fetch https://docs.medusajs.com/resources/medusa-cli for CLI command reference
  4. Web-search site:docs.medusajs.com environment variables configuration for env var reference
  5. Web-search site:docs.medusajs.com redis cache events for Redis caching and event bus setup

Build Process

Build Commands

CommandPurpose
npx medusa buildCompile server + admin dashboard for production
npx medusa db:migrateRun pending database migrations
npx medusa startStart the production server
npx medusa workerStart the background worker process

The build step compiles TypeScript, bundles admin extensions (Vite), and prepares the .medusa/ output directory.

Build Output Structure

.medusa/
├── server/           — Compiled server code
│   ├── src/          — Custom modules, routes, workflows
│   └── medusa-config.js
└── admin/            — Bundled admin dashboard (static)

Server vs Worker Mode

Medusa v2 supports running the server and background workers as separate processes:

ModeCommandHandles
Servernpx medusa startHTTP requests, API routes, admin dashboard
Workernpx medusa workerWorkflows, scheduled jobs, event subscribers
CombinedDefault start behaviorBoth server and worker (single process)

When to Separate

  • Development — combined mode is fine
  • Production — separate for reliability and independent scaling
  • High traffic — scale server instances independently from workers
  • Worker mode requires Redis for job queue communication between processes

Environment Variables

Required Variables

VariablePurposeExample
DATABASE_URLPostgreSQL connection stringpostgres://user:pass@host:5432/medusa
COOKIE_SECRETSession cookie signingRandom 32+ character string
JWT_SECRETJWT token signingRandom 32+ character string
NODE_ENVRuntime environmentproduction

Optional but Recommended

VariablePurposeDefault
REDIS_URLRedis connection for cache/events/workersNone (in-memory)
STORE_CORSStore API CORS originshttp://localhost:8000
ADMIN_CORSAdmin API CORS originshttp://localhost:9000
AUTH_CORSAuth route CORS originsCombination of store + admin
PORTServer listen port9000
MEDUSA_ADMIN_ONBOARDING_TYPEAdmin onboarding flowdefault
MEDUSA_WORKER_MODEserver, worker, or sharedshared

Database Configuration

PostgreSQL Requirements

  • PostgreSQL required (see official docs for version compatibility)
  • Enable SSL in production: append ?sslmode=require to DATABASE_URL
  • Connection pooling recommended for high-traffic deployments

Migration Workflow

bash
# Generate migration after DML model changes
npx medusa db:generate <module_name>
# Apply migrations
npx medusa db:migrate
  • Always run migrations before starting the new server version
  • Back up the database before running migrations in production
  • Test migrations against a staging database first

Redis Configuration

Redis serves three roles in production Medusa:

RolePurposeRequired?
Event BusPub/sub for event-driven subscribersRecommended
CacheModule data caching layerRecommended
Worker QueueJob queue for background workflowsRequired for worker mode

Configure in medusa-config.ts by registering the Redis modules:

ts
// Fetch live docs for Redis module registration
// in medusa-config.ts modules array
  • Use separate Redis databases (db index) for cache vs events vs queues
  • Set appropriate maxmemory and eviction policies for cache
  • Monitor Redis memory usage and connection count in production

Hosting Options

PlatformTypeNotes
RailwayPaaSOne-click deploy, managed PostgreSQL and Redis
DigitalOcean App PlatformPaaSManaged infrastructure, auto-scaling
AWS (EC2/ECS/Fargate)IaaS/CaaSFull control, use with RDS and ElastiCache
Google Cloud RunServerless containersAuto-scaling, pay-per-use
RenderPaaSSimple deploy, managed databases
Self-hosted (Docker)ContainerFull control, use Docker Compose or Kubernetes
VercelServerlessAdmin/storefront hosting only (not the Medusa server)

Docker Deployment

dockerfile
# 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.

Production Checklist

Pre-Deploy

  • Set NODE_ENV=production
  • Configure unique COOKIE_SECRET and JWT_SECRET
  • Set DATABASE_URL with SSL mode enabled
  • Configure REDIS_URL for events, cache, and worker queue
  • Set CORS variables (STORE_CORS, ADMIN_CORS, AUTH_CORS)
  • Run npx medusa build successfully
  • Run npx medusa db:migrate against production database

Infrastructure

  • PostgreSQL with automated backups and point-in-time recovery
  • Redis with persistence enabled (RDB or AOF)
  • HTTPS termination (TLS certificate) via reverse proxy or load balancer
  • Health check endpoint configured for load balancer
  • Log aggregation (stdout/stderr to centralized logging)

Post-Deploy

  • Verify admin dashboard loads and login works
  • Verify store API responds with publishable key
  • Confirm background workers are processing jobs
  • Test payment provider webhooks reach the server
  • Monitor error rates and response times

Scaling Strategies

Horizontal Scaling

  • Run multiple server instances behind a load balancer
  • Use Redis-backed sessions for sticky-session-free scaling
  • Run multiple worker instances for parallel job processing

Vertical Scaling

  • Increase PostgreSQL connection pool size for heavier workloads
  • Allocate more memory to Redis for larger cache datasets
  • Use --max-old-space-size for Node.js memory limits

Best Practices

  • Separate server and worker — run as independent processes in production; scale each based on demand; use Redis as the communication backbone
  • Environment variable hygiene — never commit secrets to source control; use platform-native secret management (AWS Secrets Manager, Railway variables, etc.); rotate secrets periodically
  • Database management — always test migrations on staging first; automate backups; use connection pooling (PgBouncer) for high concurrency
  • Monitoring — track API response times, worker queue depth, database connection count, and Redis memory; set alerts for anomalies

Fetch the Medusa deployment documentation for exact build flags, Docker configuration, and platform-specific deployment guides before deploying.

Frequently asked questions

What does the Medusa Deploy AI skill do?

Deploy Medusa v2 to production — build process, server vs worker mode, environment variables, hosting options, Redis caching, database configuration, and production checklist. Use when deploying Medusa applications.

Why use Medusa Deploy on TypingMind?

Because you install it once and use it with any model. Medusa Deploy is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Medusa Deploy in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/OrcaQubits/agentic-commerce-skills-plugins/tree/main/medusa-commerce/skills/medusa-deploy. TypingMind reads its SKILL.md and installs it as a skill you can enable per chat.

Which AI models can use Medusa Deploy?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Medusa Deploy?

As many as you like. As long as a model supports skills, you can use Medusa Deploy with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Medusa Deploy AI skill free?

Yes. It is published on GitHub by OrcaQubits under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇