Shopify's standard themes cover most stores, but brands that want unusual designs, content-heavy experiences, very fast pages or integration with other systems often go "headless": they keep Shopify as the commerce engine and build their own frontend. Shopify offers its own hosting option for its Hydrogen framework, and many teams deploy to serverless platforms, but a VPS is a strong alternative when you want control over the runtime, caching and location, or to host several services together. This guide covers hosting a headless Shopify storefront on a VPS.
What Headless Commerce Means
| Layer | Who handles it |
|---|---|
| Products, inventory, pricing, orders | Shopify |
| Checkout and payments | Shopify checkout |
| Storefront design and pages | Your custom frontend |
| Content (blogs, landing pages) | Shopify or a separate CMS |
| Hosting the frontend | Your VPS |
The frontend communicates with Shopify through the Storefront API (GraphQL), using a public or private access token depending on the architecture. Server-side code can also use the Admin API for internal tasks, with stricter secret handling.
Choosing a Frontend Framework
- Next.js: widely used React framework with server rendering, static generation and incremental revalidation; runs on Node.js on a VPS.
- Hydrogen: Shopify's React framework built on Remix, designed for Shopify's Oxygen hosting but deployable elsewhere with an appropriate adapter.
- Remix, Nuxt, SvelteKit or Astro: all can build Shopify storefronts with the Storefront API.
Pick the framework your team knows well; hosting needs are similar. Our Next.js on VPS guide covers running Next.js in production.
VPS Architecture
- Nginx terminates HTTPS, compresses responses and proxies to the Node.js app.
- Node.js app runs under PM2 or in Docker, with one process per CPU core where the framework allows.
- Cache layer: the framework's data cache, plus Redis when several processes need a shared cache.
- Worker process for webhook handling, search indexing or syncing to other systems.
- CDN in front for static assets and, where safe, cached pages.
Caching and Revalidation
Calling the Storefront API on every request adds latency and risks rate limits. Cache product, collection and content data on your server and refresh it when it changes:
- Statically generate or cache product and collection pages with a revalidation interval.
- Subscribe to Shopify webhooks for product, inventory and collection updates, and revalidate the affected pages when they fire.
- Never cache cart contents or customer account pages across users.
- Show live inventory or price checks at the cart step if your catalogue changes quickly.
Handling Webhooks
Expose a webhook endpoint over HTTPS, verify each webhook's HMAC signature using your app's secret, respond quickly, and do heavier work in a background worker. Log deliveries and handle retries idempotently, since Shopify can deliver the same webhook more than once. Our background workers guide covers queues.
Cart and Checkout
The Storefront API manages carts; when shoppers check out, they are sent to Shopify's hosted checkout, which handles payments, taxes and order creation. That keeps card data and payment compliance with Shopify and your payment providers rather than on your VPS. Make sure your domain setup and any checkout customisation follow Shopify's current requirements.
Secrets and Tokens
- Store API tokens and webhook secrets in environment variables or a secrets file outside the repository.
- Use the public Storefront token only where browser exposure is intended; keep private tokens and Admin API credentials server-side.
- Grant API scopes that match what the storefront needs, nothing more.
- Rotate tokens when team members leave or if exposure is suspected.
Deployment
Build the application in CI, then deploy the built output to the VPS and restart processes with zero downtime (PM2 reload or rolling container replacement). Self-hosted platforms such as Coolify can automate builds and HTTPS (see our Coolify guide). Keep a previous build so you can roll back quickly.
Performance
- Use optimised images from Shopify's CDN with appropriate sizes and modern formats.
- Stream or server-render above-the-fold content.
- Minimise client-side JavaScript; heavy bundles slow mobile shoppers.
- Host the frontend near your customers (an Indian VPS for Indian shoppers).
- Cache aggressively and revalidate on change.
SEO Considerations
Server-render product and collection pages with proper titles, descriptions, canonical URLs and structured data, generate a sitemap from your catalogue, and set redirects for old URLs when migrating from a standard Shopify theme. Make sure the old storefront domain redirects correctly to avoid duplicate content.
Monitoring
Monitor response times, error rates, Node.js memory, cache hit rates and Storefront API errors or throttling. Alert on webhook failures, since stale data can show wrong prices or stock. Run external uptime checks on key pages and the cart.
Sizing
| Setup | Suggested resources |
|---|---|
| Single storefront, moderate traffic | 2 vCores / 8 GB |
| Busy storefront or several storefronts | 4 vCores / 16 GB |
| Storefronts plus CMS, search and other services | 8 vCores / 32 GB |
Example: A D2C Beauty Brand
A beauty brand built a Next.js storefront on Shopify's Storefront API with editorial content from a headless CMS. The storefront runs on a 4 vCore / 16 GB VPS in Noida under PM2 behind Nginx, with Redis caching shared across processes. Product webhooks trigger page revalidation, a worker syncs reviews, and a CDN serves static assets. Checkout runs on Shopify, so payment handling stays with Shopify and the brand's payment providers.
Common Mistakes
- Calling the Storefront API on every request with no caching.
- Ignoring webhook signature verification.
- Exposing private tokens in browser code.
- Caching carts or account pages across users.
- Losing SEO by not redirecting old URLs.
In Short
Headless Shopify keeps commerce and checkout on Shopify while you host a custom storefront. On a VPS, run your framework under PM2 or Docker behind Nginx, cache and revalidate with webhooks, protect tokens, use Shopify's checkout, add a CDN and monitor API errors.
SkyRainCloud Plans for This Workload
A headless storefront with server rendering runs well on 2 vCores / 8 GB; busy stores or several storefronts are more comfortable on 4 vCores / 16 GB, with a CDN in front.
AMD EPYC 7C13 VPS
Dedicated KVM vCores on AMD EPYC 7C13 (up to 3.70 GHz) with DDR4 ECC memory, NVMe SSD and an unmetered 1 Gbps port.
| Plan | vCores | RAM | Storage | Network | Price | Good for | Buy |
|---|---|---|---|---|---|---|---|
| VPS 1 — AMD | 2 | 8 GB DDR4 ECC | 40 GB NVMe SSD | 1 Gbps, unmetered | ₹649/month | Websites, small APIs, bots, staging and VPN servers | Order |
| VPS 2 — AMD | 4 | 16 GB DDR4 ECC | 80 GB NVMe SSD | 1 Gbps, unmetered | ₹1,299/month | WooCommerce, Node.js/Python backends, Docker Compose stacks, CI runners | Order |
| VPS 3 — AMD | 8 | 32 GB DDR4 ECC | 150 GB NVMe SSD | 1 Gbps, unmetered | ₹2,499/month | Production databases, high-traffic sites, multi-container apps | Order |
| VPS 4 — AMD | 16 | 64 GB DDR4 ECC | 250 GB NVMe SSD | 1 Gbps, unmetered | ₹4,899/month | Large production workloads, SaaS platforms, analytics, in-memory caches | Order |
Intel Xeon Platinum 8269CY VPS
KVM VPS on Intel Xeon Platinum 8269CY (up to 3.80 GHz Turbo) with DDR4 ECC memory, NVMe SSD, full root access and an unmetered 1 Gbps port.
| Plan | vCores | RAM | Storage | Network | Price | Good for | Buy |
|---|---|---|---|---|---|---|---|
| VPS 1 — Intel | 2 | 8 GB DDR4 ECC | 40 GB NVMe SSD | 1 Gbps, unmetered | ₹649/month | Business websites, small apps, scheduled jobs and bots | Order |
| VPS 2 — Intel | 4 | 16 GB DDR4 ECC | 80 GB NVMe SSD | 1 Gbps, unmetered | ₹1,169/month | Business software, mid-size databases, several sites on one server | Check stock |
| VPS 3 — Intel | 8 | 32 GB DDR4 ECC | 150 GB NVMe SSD | 1 Gbps, unmetered | ₹2,249/month | ERP/CRM stacks, heavier databases, multiple production apps | Check stock |
| VPS 4 — Intel | 16 | 64 GB DDR4 ECC | 250 GB NVMe SSD | 1 Gbps, unmetered | ₹4,299/month | High-memory workloads and consolidated production servers | Check stock |
Prices are monthly in INR as listed on the SkyRainCloud store (verified 2026-11-14). Stock and final pricing are shown on the product page at checkout.