---
title: "Deploy Mercur (Self-Hosted Multi-Vendor Marketplace on Medusa)"
description: "Self-hosted multi-vendor marketplace on Medusa: admin and seller panels."
category: "Other"
url: https://railway.com/deploy/mercur-multi-vendor-marketplace
---

# Deploy Mercur (Self-Hosted Multi-Vendor Marketplace on Medusa)

Self-hosted multi-vendor marketplace on Medusa: admin and seller panels.

**[Deploy Mercur (Self-Hosted Multi-Vendor Marketplace on Medusa) on Railway](https://railway.com/template/mercur-multi-vendor-marketplace)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/mercur-multi-vendor-marketplace/manifest.json

- **Creator:** blueorange
- **Category:** Other

## Template content

### Postgres https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18

### Redis https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/svg/redis.svg

- **Image:** redis:8.2
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

### mercur-worker https://raw.githubusercontent.com/mercurjs/mercur/main/apps/vendor/public/logo.svg

- **Source:** https://github.com/gridalpha/mercur-railway

### mercur-server https://raw.githubusercontent.com/mercurjs/mercur/main/apps/vendor/public/logo.svg

- **Source:** https://github.com/gridalpha/mercur-railway
- **Public domain:** Yes

## Buckets

- **mercur-media**

## Documentation

# Deploy and Host Mercur on Railway

![Mercur, the open-source multi-vendor marketplace](https://raw.githubusercontent.com/mercurjs/mercur/main/apps/vendor/public/logo.svg)

Mercur is an open-source multi-vendor marketplace platform built on **Medusa**, the commerce engine with 36,000+ GitHub stars. It gives you a marketplace backend with an operator admin panel, a vendor panel where sellers manage their own products and orders, and the APIs for your storefront. This template deploys Mercur on Railway as a server and worker pair with Postgres, Redis and object storage for product images. Sharetribe's Live plan is $199–259/month. Your own Mercur marketplace runs for about $15–30/month, with no transaction fees and full control over the code.

---

## What This Template Deploys

| Service | Purpose |
|---|---|
| **mercur-server** | The Medusa backend with Mercur's modules on port `9000` with a public HTTPS domain. It serves the Store, Admin and Vendor APIs, the admin panel at `/dashboard` and the vendor panel at `/seller`. |
| **mercur-worker** | The same app in worker mode: scheduled jobs, event subscribers and long-running workflows, with no public domain. |
| **Postgres** | Postgres 18 with products, vendors, orders, customers and settings, on a persistent volume. |
| **Redis** | Event bus, workflow engine and locking for the server and worker. |
| **Bucket** | A Railway Bucket (`mercur-media`) for product images and uploads, served through short-lived signed links. |

Both app services build from the same repository and differ only in `MEDUSA_WORKER_MODE`. Only the server runs database migrations; the worker waits for the schema, so the two never race each other.

---

## About Hosting Mercur

A multi-vendor marketplace is much more than a store. Vendors need their own logins, catalogues, orders and payouts; the operator needs commission rules, approvals and oversight; and the backend needs background jobs for events, emails and imports. Mercur adds all of that on top of Medusa's commerce engine. However, it publishes no ready-made image: you scaffold a project and build it yourself, and its default setup expects tools and a file layout that most hosts don't provide.

This template packages a working build. It pins the dependencies that break with npm, stores uploads in object storage so the server and worker see the same files, trusts Railway's proxy correctly, and adds security headers to the panels. On Railway, the server gets HTTPS automatically, Postgres and Redis run on the private network, and the first admin is created at deploy time.

**No storefront is included.** You get the backend, the admin panel and the vendor panel. Connect your own storefront (for example a Next.js app) to the Store API, or use the API from a mobile app.

**Demo data on first boot.** The server seeds a demo marketplace with three sample sellers, using a generated password rather than upstream's hard-coded one. Set `MERCUR_SEED_DEMO_DATA=false` before the first deploy to start empty.

Typical cost: **~$15–30/month** on Railway for the server, worker, Postgres, Redis and storage. Sharetribe Live costs $199/month billed yearly, or $259 monthly.

---

## Deploy Mercur in Under 15 Minutes

1. Set `MEDUSA_ADMIN_EMAIL` to your email, then click **Deploy on Railway**. The first build takes about 8–12 minutes.
2. Copy `MEDUSA_ADMIN_PASSWORD` from the mercur-server service's Variables tab.
3. Open `https://your-app.up.railway.app/dashboard` and sign in as the marketplace operator.
4. Review the demo sellers and products, or remove them and invite your own vendors.
5. Sellers sign in at `/seller` to manage their catalogue and orders. Connect your storefront to the Store API.

No monorepo build on your laptop. No package-manager surprises. No transaction fees.

---

## Common Use Cases

- **Multi-vendor marketplace.** Let many sellers list and sell products under your brand.
- **Self-hosted Sharetribe alternative.** Own the platform and the code instead of paying a monthly platform fee.
- **B2B marketplaces.** Connect suppliers and buyers, with vendor-managed catalogues.
- **Niche and local marketplaces.** Handmade goods, local food producers, rentals or second-hand items.
- **Headless commerce.** Build your own storefront and apps on Medusa's APIs.
- **Marketplace MVPs.** Launch with real seller and admin panels from day one.
- **Agencies building marketplaces for clients.** Start from a working backend and customise it.

---

## Configuration

| Variable | Required | Description |
|---|---|---|
| `MEDUSA_ADMIN_EMAIL` | ✅ Set | `admin@example.com` by default. Change it to your email before deploying. |
| `MEDUSA_ADMIN_PASSWORD` | 🔐 Auto-generated | Password for the first marketplace admin. |
| `MERCUR_SEED_SELLER_PASSWORD` | 🔐 Auto-generated | Password for the three demo sellers. |
| `JWT_SECRET`, `COOKIE_SECRET` | 🔐 Auto-generated | Sign API tokens and session cookies. The worker uses the server's values. |
| `MERCUR_BACKEND_URL` | ✅ Auto-injected | Public URL of mercur-server. It's built into the panels at build time. |
| `MERCUR_VENDOR_URL` | ✅ Auto-injected | The vendor panel URL, `/seller` on the same domain. |
| `MEDUSA_WORKER_MODE` | ✅ Set | `server` on mercur-server and `worker` on mercur-worker. |
| `DATABASE_URL`, `REDIS_URL` | ✅ Auto-injected | Postgres and Redis on the private network. |
| `S3_BUCKET`, `S3_ENDPOINT`, `S3_ACCESS_KEY_ID`, `S3_SECRET_ACCESS_KEY` | ✅ Auto-injected | The Railway Bucket for uploads. |
| `NODE_OPTIONS` | Optional | `--max-old-space-size=4096`, the Node heap ceiling. |

**Using a custom domain?** Add it to mercur-server, update `MERCUR_BACKEND_URL` and `MERCUR_VENDOR_URL`, and redeploy both services. The panels need a rebuild to pick up the new URL.

**Payments and commissions.** Mercur and Medusa support payment providers such as Stripe through plugins. Configure your provider and commission rules in the admin panel before inviting real sellers.

---

## Mercur on Railway vs. Alternatives

| | Mercur on Railway | Sharetribe | CS-Cart Multi-Vendor | Shopify with marketplace apps |
|---|---|---|---|---|
| **Monthly cost** | ~$15–30 usage | $199 yearly or $259 monthly (Live) | Paid licence plus hosting | Shopify plan plus app fees |
| **Self-hosted** | ✅ Yes | ❌ No | ✅ Yes | ❌ No |
| **Vendor panel included** | ✅ Yes | ✅ Yes | ✅ Yes | ⚠️ Via app |
| **Platform transaction fees** | ✅ None | ✅ None on Live | ✅ None | ⚠️ Depends on payment setup |
| **Headless API for any storefront** | ✅ Medusa APIs | ⚠️ Limited | ⚠️ Limited | ✅ Storefront API |
| **Full code access** | ✅ Yes | ❌ No | ⚠️ Licensed source | ❌ No |
| **License** | ✅ MIT | ❌ Proprietary | ❌ Proprietary | ❌ Proprietary |

---

## Dependencies for Mercur Hosting

- Railway account. Pro is recommended for two Node services and the build.
- A payment provider account, such as Stripe, for real transactions.
- A storefront: build your own or use a Medusa-compatible starter.

### Deployment Dependencies

- [Mercur on GitHub](https://github.com/mercurjs/mercur): source code and releases
- [Mercur Documentation](https://docs.mercurjs.com): marketplace features and setup
- [Medusa Documentation](https://docs.medusajs.com): the commerce engine underneath
- [Railway Volumes Documentation](https://docs.railway.com/volumes): persistence for Postgres and Redis

### Implementation Details

The repository is Mercur's basic template with Railway changes: a committed npm lockfile, dependency pins that npm needs, uploads in object storage so the worker and server share files, a wider proxy trust setting, and security headers on the admin and vendor panels. The server entrypoint migrates, creates the first admin and seeds demo data once, then starts Medusa. The worker waits for the schema before starting.

Upgrading Mercur means updating the vendored source, so treat the repository as your own project from here on.

---

## Frequently Asked Questions

**What is Mercur?**
An open-source multi-vendor marketplace platform built on Medusa. It adds vendors, a vendor panel, commissions and marketplace workflows on top of Medusa's commerce engine.

**How much does it cost compared to Sharetribe?**
About $15–30/month on Railway, with no platform fee. Sharetribe Live costs $199/month billed yearly, or $259 monthly, plus payment processing fees.

**Why does the admin panel show the wrong URL after I added a custom domain?**
The panels have their backend URL built in. Update `MERCUR_BACKEND_URL` and `MERCUR_VENDOR_URL`, then redeploy so the panels rebuild.

**Do I lose products or orders when Railway redeploys?**
No. Data is in Postgres on its volume and images are in the Railway Bucket. Redeploys keep everything.

**Is a storefront included?**
No. The template includes the backend, admin panel and vendor panel. Connect any storefront to the Store API.

**How do I remove the demo sellers?**
Delete them in the admin panel, or set `MERCUR_SEED_DEMO_DATA=false` before the first deploy so they're never created.

---

## Why Deploy and Host Mercur on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Mercur on Railway, you get a working multi-vendor marketplace backend with admin and vendor panels, background workers and object storage, on code you fully own.


## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/mercur-multi-vendor-marketplace
