Deploy Medusa on TurboStack
Medusa is a Node.js headless commerce platform. Unlike applications that have a dedicated app_type, Medusa is deployed with the reverse-proxy pattern: each Node.js service runs as its own process and Nginx proxies requests to it. This pattern applies to any Node.js or containerized application, not just Medusa, so you can use the same approach for custom Node apps, separate storefronts, and admin dashboards.
Requirements
Note
There is no app_type for Medusa. You enable the reverse proxy per vhost with proxy_enabled: true and point it at the port your Node process listens on.
Configure it
- Set
webserver: nginxat the host level to provide the reverse proxy. - Set
postgresql_versionto the PostgreSQL release Medusa should use (for example"18"). - For each service, add a vhost with a unique
app_name, anodejs_version, andcert_type: letsencrypt. - Set
proxy_enabled: trueandproxy_upstream_portto the port the Node process listens on. Nginx will proxy public traffic to that port. - Repeat for each service - for example a storefront on port 8000 and the Medusa backend/admin on port 9000.
See Applications for supported deployment patterns and Publish for how to apply your host configuration.
Example configuration
webserver: nginx
postgresql_version: "17" # Medusa stores its data in PostgreSQL
system_users:
- username: prod
vhosts:
- server_name: shop.example.com www.shop.example.com
app_name: frontend
nodejs_version: "24" # Node.js runtime for the storefront
cert_type: letsencrypt
proxy_enabled: true # nginx proxies to the Node process
proxy_upstream_port: "8000"
- server_name: dashboard.shop.example.com
app_name: dashboard
nodejs_version: "24"
cert_type: letsencrypt
proxy_enabled: true
proxy_upstream_port: "9000" # Medusa backend/admin
Why these choices
- The reverse-proxy pattern (
proxy_enabled+proxy_upstream_port) works for any Node.js or containerized application. You keep full control over the runtime, while Nginx handles Transport Layer Security (TLS) and routing. - A separate vhost per
app_namelets the storefront and the backend/admin run as independent processes on their own ports and domains. nodejs_versionpins the Node.js runtime each service runs on.postgresql_versionis required because Medusa persists its data in PostgreSQL.cert_type: letsencryptissues and renews TLS certificates automatically for each domain.
Related
-
Technologies used: Node.js, PostgreSQL, Redis, Reverse proxy.
-
Setup example - end-to-end install over SSH.
-
Hosting reference - file layout, permissions & caching.
-
Best practices - performance & stability.
-
Troubleshooting - logs & common fixes.