Deployment guide

Self-host Saleor Commerce: Headless E-commerce on VPS

Deploy on a VPS Cloud →

Tutorial

Self-host Saleor Commerce: Headless E-commerce on VPS

Self-hosting5 min read6 steps

Shopify charges a percentage of every transaction. WooCommerce forces you into a WordPress template system. Saleor Commerce takes a different approach: it exposes everything through a single GraphQL API and lets you build whatever frontend you want — a Next.js storefront, a React Native app, a kiosk display — without touching the backend. Saleor is open source under BSD-3-Clause (23 000+ GitHub stars), built with Python and Django, and deployable on a single VPS with Docker Compose. On ServOrbit, seven containers start automatically: PostgreSQL 15, Valkey 8, the Django API, a Celery worker, the React admin dashboard, and Nginx routing traffic through a single exposed port.

Contents· Why headless e-commerce? Decoupling the storefront from the backend1/6
  1. 01Why headless e-commerce? Decoupling the storefront from the backend
  2. 02What Saleor gives you on a ServOrbit VPS
  3. 03Stack architecture: seven containers, one exposed port
  4. 04Deploying from the ServOrbit Marketplace
  5. 05Connecting a payment gateway
  6. 06Saleor vs PrestaShop vs WooCommerce: which to choose?

Why headless e-commerce? Decoupling the storefront from the backend

Traditional e-commerce platforms bundle the storefront and the backend together. Your theme, your cart, your checkout logic — they all run in the same PHP process, shaped by the platform's template system. This works well until you need something the platform doesn't support: a custom mobile app, a B2B pricing tier, a storefront that pre-renders 50 000 product pages at build time.

Headless e-commerce separates these concerns. The backend manages your catalog, orders, customers and payments via an API. The frontend is yours: build it in Next.js, React Native, Astro, or anything that speaks HTTP and GraphQL. Change your storefront without touching your order history. Scale your API layer independently from your CDN-fronted static site.

Saleor takes this to its logical conclusion. There is no built-in storefront. The entire product surface is the GraphQL API. The React admin dashboard is for administration, not for selling.

What Saleor gives you on a ServOrbit VPS

  • Full GraphQL API — products, variants, attributes, collections, orders, customers, payments, shipping: everything is queryable and mutable via a single GraphQL endpoint.
  • Native multi-channel — a Moroccan store in MAD, a French store in EUR, a B2B wholesale catalog: independent channels, shared product catalog, single admin dashboard.
  • React admin dashboard included — manage your catalog, inventory, promotions, orders and customer accounts without writing code.
  • Celery worker for background tasks — outbound webhooks, email notifications, async order processing: nothing blocks the HTTP request path.
  • PostgreSQL 15 + Valkey 8 — battle-tested relational database and a fast cache/broker, both in ephemeral containers with persistent Docker volumes.
  • BSD-3-Clause licence — no per-transaction fee, no features behind a paid tier, fully auditable source code.

Stack architecture: seven containers, one exposed port

The Saleor stack on ServOrbit runs as seven Docker Compose services:

1. db — PostgreSQL 15, persistent data in a named volume.
2. cache — Valkey 8, Django cache on database 0 and Celery broker on database 1.
3. init — runs once: applies database migrations, generates the RSA key pair for JWT signing, creates the admin account.
4. api — Uvicorn + Django, serves the GraphQL API on port 8000 (loopback only).
5. worker — Celery, processes the async task queue (webhooks, email, order events).
6. dashboard — pre-compiled React app, the admin UI.
7. proxy — Nginx, the single entry point. Routes /graphql/, /static/, /media/, /thumbnail/, /plugins/ to the API container; everything else to the dashboard.

Only the Nginx proxy exposes a port on 127.0.0.1, behind the reverse proxy managed by ServOrbit. The API never receives direct external traffic.

Deploying from the ServOrbit Marketplace

  1. Order a VPS with 4 GB RAM

    the full stack (API, Celery, PostgreSQL, Valkey, dashboard) runs comfortably in 4 GB. 2 GB is the hard minimum, but PostgreSQL will be tight under concurrent requests.

  2. Attach your domain before deploying

    Saleor binds the dashboard API URL and Django's ALLOWED_CLIENT_HOSTS to your domain at first boot. This value cannot be changed without recreating volumes. Do it before, not after.

  3. Launch the deployment

    in your ServOrbit dashboard: Marketplace → E-commerce → Saleor → Deploy. The init container applies migrations, generates the RSA key and creates [email protected] with the password shown in your client area.

  4. Wait 90–120 seconds

    first boot pulls the images (~1 GB total) and runs schema migrations. The API is ready when the Nginx healthcheck passes.

  5. Create a sales channel

    in the admin dashboard (https://your-domain/), go to Catalogue → Channels → Create channel. Set a name, a currency (MAD, EUR…) and a country. You cannot create products without at least one channel.

  6. Connect your storefront

    point your Next.js (or any GraphQL client) frontend at https://your-domain/graphql/. The interactive GraphQL schema browser is available at that endpoint in debug mode.

Connecting a payment gateway

Saleor handles payments through Saleor Apps — small services that implement Saleor's webhook payment protocol and connect to your PSP. The official ecosystem covers Stripe, Adyen and PayPal. For the Moroccan market, a CMI integration is possible via the Saleor App SDK, which exposes the necessary hooks (payment-gateway-initialize-session, transaction-process-session).

In the admin dashboard, go to Apps → Explore apps to install from the Saleor marketplace, or Apps → Install custom app to point at your own service. The app URL must be reachable from the Saleor server (HTTPS required in production).

Once installed, the app appears in Catalogue → Channels → your channel → Payment gateways.

Saleor vs PrestaShop vs WooCommerce: which to choose?

PrestaShop and WooCommerce are monolithic platforms: the theme, the cart and the API all live in the same PHP process. They are fast to get started with but difficult to customise deeply — you are working within the platform's template system.

Saleor is the opposite philosophy: no built-in theme, everything via GraphQL. You trade the "running store in ten minutes" experience for complete frontend freedom. It is the right choice when you have developers capable of building a Next.js or React Native storefront, or when your use case goes beyond what a standard theme supports.

On resource consumption: Saleor (Python/Django) uses more RAM than a lightweight WooCommerce install, but far less than Magento or Sylius in production. On a 4 GB VPS, the stack runs comfortably with room for PostgreSQL to breathe.

If you are looking for a no-code storefront you can style in an afternoon, PrestaShop or WooCommerce are better fits. If you are building a product — an app, a multi-channel platform, a custom checkout experience — Saleor gives you the API surface to do it cleanly.

Ready to launch your headless store?

ServOrbit deploys Saleor Commerce on Ubuntu 24.04 in one click — PostgreSQL, Valkey, Django API, Celery worker, React dashboard and Nginx proxy all pre-configured.

Need help?

Browse our help center and FAQ, or reach our team — callback, WhatsApp or email. Support in French, English and Arabic.

Message us on WhatsAppopens in a new tab