Back to all templates
Medusa logo

Medusa

Application1024MB+ RAM

Open-source headless commerce platform

ecommerceheadlessstorenodejs

Deploy Medusa in 3 Steps

1

Connect Your VPS

Add your server credentials to Server Compass

2

Select Medusa

Choose from our template library

3

Deploy & Configure

Fill in settings and click Deploy

No Docker knowledge required
Step-by-step deployment guide

Deploy Medusa on a VPS with Server Compass

Use the Medusa template in Server Compass to deploy a self-hosted headless commerce backend with PostgreSQL and Redis, then verify the health endpoint in a browser.

About 8 minutesBrowser verified
1
Step 1

Open the server Apps tab

Select your VPS, open the Apps tab, and start a new app deployment.

Server Compass Apps tab before creating a Medusa app
2
Step 2

Choose an app template

Click New App and choose the template deployment path so Server Compass can load the built-in catalog.

Choosing to deploy an app from a Server Compass template
3
Step 3

Search for Medusa

Use the template picker search to find Medusa.

Searching for Medusa in the Server Compass template picker
4
Step 4

Select the Medusa template

Choose the Medusa template. Server Compass fills the app image, PostgreSQL service, Redis service, persistent storage, URLs, and secrets.

Medusa template selected in Server Compass
5
Step 5

Review the Medusa settings

Confirm the app name, compose services, and generated configuration.

Reviewing Medusa project settings and compose services
6
Step 6

Deploy Medusa

Review the generated environment values, confirm the port is available, and click Deploy Now.

Reviewing Medusa URLs, secrets, database settings, and port before deployment
7
Step 7

Watch the deployment progress

Keep the deployment modal open while Server Compass pulls images, starts services, and verifies the stack.

Server Compass deploying the Medusa template on the VPS
8
Step 8

Confirm Medusa is running

After deployment finishes, confirm the Medusa app is marked Running.

Medusa template running in the Server Compass Apps tab
9
Step 9

Open Medusa in the browser

Open the application URL in a browser. The Medusa health endpoint confirms the app is reachable.

The deployed Medusa health endpoint loaded in a browser

After Medusa Opens

  • Create the first Medusa admin user before production use.
  • Add a domain and HTTPS before connecting a storefront.
  • Back up PostgreSQL data before storing production catalog data.

Verified Result

Medusa loaded successfully and displayed the health endpoint with the OK health response.

Medusa deployment questions

What does the Medusa template deploy?

It deploys Medusa with PostgreSQL, Redis, and persistent local storage.

Which port did the tutorial use?

The tutorial used host port 9000, which maps to the Medusa web server on container port 9000.

DIY Deployment

Self-Host Medusa with Docker

Take the DIY route and deploy Medusa on your own server using Docker.

1

Connect to Your VPS via SSH

Fire up your terminal application and establish a connection to your remote server.

terminal
# Access your VPS
ssh root@YOUR_SERVER_IP

# With SSH key authentication
ssh -i ~/.ssh/your-private-key root@YOUR_SERVER_IP

First time? Ensure Docker is installed first: curl -fsSL https://get.docker.com | sh

2

Initialize Project Folder

Create a folder to house your Docker Compose configuration.

terminal
# Create and navigate to project directory
mkdir -p ~/apps/medusa
cd ~/apps/medusa
3

Create Docker Configuration

Define your services in a docker-compose.yml file:

docker-compose.yml
services:
  medusa:
    image: jaspreet237/medusajsv2:latest
    ports:
      - "9000:9000"
    environment:
      - DATABASE_URL=postgres://medusa:<your-db-password>@db:5432/medusa?ssl_mode=disable
      - NODE_ENV=development
      - PGSSLMODE=disable
      - REDIS_URL=redis://redis:6379
      - JWT_SECRET=<your-jwt-secret>
      - COOKIE_SECRET=<your-cookie-secret>
    command: sh -lc "printf '%s\n' 'DATABASE_URL=postgres://medusa:<your-db-password>@db:5432/medusa?ssl_mode=disable' 'NODE_ENV=development' 'PGSSLMODE=disable' 'REDIS_URL=redis://redis:6379' 'JWT_SECRET=<your-jwt-secret>' 'COOKIE_SECRET=<your-cookie-secret>' 'STORE_CORS=*' 'ADMIN_CORS=*' 'AUTH_CORS=*' > .env && cp .env .env.development && ./node_modules/.bin/medusa db:setup --no-interactive --execute-safe-links && npm run dev"
    restart: unless-stopped
    depends_on:
      db:
        condition: service_healthy
      redis:
        condition: service_started

  db:
    image: postgres:16-alpine
    environment:
      - POSTGRES_USER=medusa
      - POSTGRES_PASSWORD=<your-db-password>
      - POSTGRES_DB=medusa
    volumes:
      - postgres_data:/var/lib/postgresql/data
    restart: unless-stopped
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U medusa"]
      interval: 10s
      timeout: 5s
      retries: 5

  redis:
    image: redis:7-alpine
    restart: unless-stopped

volumes:
  postgres_data:
Configurable Options
PORTHost port(default: 9000)
JWT_SECRETJWT secret
COOKIE_SECRETCookie secret
DB_PASSWORDDB password
4

Execute the Deployment

Start your containers and verify they're running correctly.

terminal
# Launch the stack
docker compose up -d

# Verify container status
docker compose ps

# Follow the logs
docker compose logs --follow
5

Allow Network Access

Update UFW rules to allow traffic on the application port.

terminal
# Allow the application port through firewall
sudo ufw allow 9000/tcp
sudo ufw reload

# Access your app at:
# http://your-server-ip:9000
Skip the Terminal

Don't want to type commands? We've got you.

Forget SSH and YAML files. Deploy Medusa visually with Server Compass in just a few clicks.

  • No terminal required
  • Point-and-click setup
  • Auto SSL certificates
  • Rolling deployments
  • Health monitoring
  • Instant rollbacks
Download Server Compass$29 one-time • Lifetime license

After Deployment

After deploying Medusa with Server Compass, complete these steps to finish setup

1

Run migrations

2

Create admin user

3

Build storefront

Need help? Check out our documentation for detailed guides.

Medusa FAQ

Common questions about self-hosting Medusa

How do I deploy Medusa with Server Compass?

Simply download Server Compass, connect to your VPS, and select Medusa from the templates list. Fill in the required configuration and click Deploy. The entire process takes under 3 minutes.

What are the system requirements for Medusa?

Medusa requires a minimum of 1024MB RAM. We recommend a VPS with at least 2048MB RAM for optimal performance. Any modern Linux server with Docker support will work.

Can I migrate my existing Medusa data?

Yes! Server Compass provides volume mapping that allows you to import existing data. You can also use standard Medusa backup and restore procedures.

How do I update Medusa to the latest version?

Server Compass makes updates easy. Simply click the Update button in your deployment dashboard, and the latest Medusa image will be pulled and deployed with zero downtime.

Is Medusa free to self-host?

Medusa is open-source software. You only pay for your VPS hosting (typically $5-20/month) and optionally Server Compass ($29 one-time). No subscription fees or per-seat pricing.

Ready to Self-Host Medusa?

Download Server Compass and deploy Medusa to your VPS in under 3 minutes. No Docker expertise required.

Download Server Compass