Running Magento Open Source on multiple web nodes

A multi-node Magento Open Source layout splits shared state from per-node processes so the store scales out safely. This page covers the decisions, build order and checks for a cluster you run in your own infrastructure.

On this page

When running Magento Open Source on multiple web nodes makes sense

Scaling out to multiple web nodes makes sense when a single web server is either saturated during traffic peaks or is a single point of failure the business can no longer accept. Before adding a second node behind a load balancer, confirm the bottleneck. Measure whether the constraint is PHP workers, database load, search, or cache capacity, because a second web node only helps if requests are actually queuing at the web tier. Adding nodes to a store that is limited by its database or search service moves the problem rather than solving it.

Once traffic can land on any node, every node must read the same state. Sessions, the page and block cache, media files and the configuration in app/etc/env.php must be shared or consistent across nodes, or customers will see logins drop and stale content appear depending on which node served them. Only one node should run cron and indexing jobs, so the team needs to decide which node owns scheduled work and how the others are kept out of it. Adobe's developer and configuration documentation covers the Varnish full-page cache and the session and cache settings involved, and the team should read those pages against its own layout before committing to a design.

The layout is built in the client's own cloud accounts, data centers or private network, either by the client's platform team or by an implementation partner working inside that infrastructure. Ask the partner to show, in writing, how each shared component is provisioned, who operates it, and how a failed node is removed and replaced without a maintenance window. Confirm the Magento Open Source version and its system requirements against Adobe's current list before choosing the components, since the supported combinations are defined by Adobe and only the listed combinations are supported.

How the parts of a multi-node Magento layout connect

The diagram starts at the public edge, where the load balancer receives storefront and admin traffic and passes it either through an optional Varnish layer or straight to the web nodes. Every web node reads and writes the same shared session and cache store, the same shared media storage, and the same MySQL or MariaDB database, so a customer can land on any node. Search, queues and cron run on internal services and one designated cron node, which is the boundary to check before any node is added.

Shared state sits behind the web tier, and only one node runs cron.

Which shared-state options fit which layout

This table compares the main choices for sessions and cache, media storage, Varnish placement and the cron node across common multi-node layouts. Read each row by asking which layout you run, then check the trade-off before committing to a design. The main takeaway is that shared state should be settled before a second web node goes live, because changing it later touches every node.

Shared stateOptionFits whenMain trade-off
SessionsRedis or Valkey shared session storeTwo or more web nodes behind a balancer with sticky sessions not wantedEvery node depends on the shared store, so its availability and failover need planning
CacheRedis or Valkey shared cache backendNodes must see the same cache entries after a deploy or cache flushCache writes add network hops; confirm the 2.4.9 or 2.4.8-p5 Redis or Valkey version matrix first
MediaShared network file system mounted on every nodeFew nodes and a team that already operates shared storageLatency and locking on uploads can slow the admin and catalog image pipeline
MediaObject storage with a Magento storage module on all nodesMany nodes, separate upload tiers, or storage kept off the web serversRequires a supported module and a check of CDN and URL rewrites before go-live
VarnishOne Varnish tier in front of the balancerFull-page cache should be shared and purged from one placePurge and invalidation must reach the whole tier; confirm the Varnish 8 setup with Adobe's cache guide
VarnishVarnish on each web node behind the balancerLatency to the cache matters more than one purge pointEach cache holds its own objects, so purge must fan out to every node
CronSingle designated cron nodeIndexers, queues and scheduled jobs must run once across the clusterIf the cron node fails, scheduled work stops until it is restored or another node is set up
CronCron on every web nodeNot recommended for shared-state layouts; use only after confirming each job is safe to run in parallelDuplicate runs can corrupt indexes or double-send messages

How to build the cluster in the right order

This sequence moves a single Magento Open Source store to several web nodes by making shared state reachable first, then installing once, then adding nodes and release automation. Each step ends with a check so a fault is caught before the next layer depends on it.

  1. Prepare shared services first

    Your infrastructure or platform team provisions the database, OpenSearch, Redis or Valkey, RabbitMQ and the shared media location before any Magento code is installed. Confirm each service version against Adobe's system requirements for your chosen release, because Adobe supports only the listed combinations. Check that every service is reachable from a test host on the network path the web nodes will use, and that credentials and firewall rules are recorded. The step is done when each service answers a connection test from that host and the version matrix is signed off.

  2. Install once with Composer

    One engineer runs the Composer install on a single build host, using the access keys and file ownership your team has set for the project, then runs setup:install with the shared database, search and cache settings. Keep the install on one node only, so the database schema and the admin configuration are created exactly once. The check is that setup:install completes, the storefront and admin load from the build host, and the generated configuration points at the shared services rather than local ones.

  3. Mount shared media storage

    Place the pub/media directory on storage that every web node can read and write, such as an NFS export or an object storage mount your team has tested for Magento's file access pattern. Keep static view files and generated code on each node or in a build artifact, because they are rebuilt per release. Confirm the mount options and the owner and group match the web server user on every node. The check is that a file uploaded through the admin on one node appears at the same path on another node.

  4. Point all nodes at shared Redis or Valkey

    Configure the session and cache backends in the shared configuration so that every web node uses the same Redis or Valkey instance, and give each node the same connection values through its environment or env.php. Use a Redis line that fits your licensing review, since the Redis license terms changed across major versions. Confirm the Redis version against Adobe's requirements for your release. The check is that a customer session started on node A stays valid when the next request is routed to node B, and that a cache clean on one node is visible on the other.

  5. Place Varnish in front of the nodes

    Install Varnish between the load balancer and the web nodes, and configure it with the VCL that Adobe documents for self-managed installations so that it can purge cached pages when Magento sends invalidation requests. Point each Varnish instance at every web node and set the same backend list everywhere. Confirm the Varnish version against your release requirements. The check is that a cacheable product page returns a cache hit header on a repeat request, and that a product price change in the admin clears the cached page on all nodes.

  6. Designate one node for cron

    Choose a single node that runs the Magento cron jobs, and disable cron on the other web nodes in their configuration. Cron handles indexers, queues and scheduled tasks, so running it on every node duplicates work and can corrupt index state. Document which node is the cron node and add a check to your monitoring that alerts when cron has not run recently. The check is that the cron node runs the scheduled jobs and that the other nodes show no cron entries in the crontab.

  7. Release the same code to every node

    Add a deployment step in your pipeline that builds the code and static assets once, packages the artifact, and releases the same version to every web node in the same order, with the import and upgrade steps run only on the designated node. Keep the release identical across nodes by checking the artifact hash on each host. Coordinate the release with your maintenance window process and drain each node from the load balancer while it updates. The check is that every node reports the same release and hash, and that the storefront serves identical responses from each node in the load balancer pool.

Deploying the same release to every node

In this approach a single build server installs Composer dependencies, compiles dependency injection and generated code, and deploys static view files. The output is packaged as one artifact and copied to every web node, so each node runs the same bytes. Production nodes then only need to receive the artifact and apply the environment-specific settings that never leave the server.

  • One source of truth: every node runs the same compiled code and static files, so a drift between nodes cannot come from the build step.
  • Fewer steps on production: nodes do not need Composer access or build tools installed, which reduces what can fail during a release.
  • Shared generated output: generated classes and static content are packaged with the release, so nodes do not race to write them.
  • Rollback by artifact: keeping the previous artifact on hand makes returning to a known-good release a switch rather than a rebuild.
  • Build server access: the build server becomes a high-value system that holds repository credentials and must be protected like production.

Before relying on this model, confirm which paths hold environment-specific files and check that the packaging step excludes them. The pipeline topic covers the steps in detail.

Security risks that grow with each node

Every web node you add repeats the same attack surface, and some of it becomes harder to see. The cards below cover the risks that appear when several Magento Open Source nodes share sessions, media, configuration and patch levels, and the control to check for each.

Exposed internal services on the shared network

Each node needs to reach the database, the cache, OpenSearch, RabbitMQ and the shared media store, and those services often listen on addresses that every node can reach. A service bound to all interfaces or left without authentication becomes reachable from any compromised web node. Check that each backing service listens only on its private network, requires authentication, and is reachable only from the node addresses that need it.

System requirements

Session and admin path handling across nodes

A load balancer can send the same visitor to a different node on each request, so sessions and the admin area must behave the same everywhere. If nodes disagree on the admin path, or sessions are stored on local disk, logins fail or a session can be replayed from a node with weaker controls. Confirm that sessions live in the shared store, that every node uses the same admin path from env.php, and that the admin path is not guessable.

File permissions on shared mounts

A shared media or var mount is often mounted with broader permissions than the local code directories, and a single writable path can let an attacker place a script that the web server then runs. Mounts used for uploads should be writable by the web server user only where Magento needs to write, and should never allow execution. Check ownership and mount options on every node, and confirm that the same file system owner is used across the cluster.

PHP-FPM and nginx consistency

When nodes run different PHP-FPM pool settings, php.ini limits or nginx rules, a rule that blocks uploaded scripts on one node may be missing on another. Version drift between PHP and nginx can also change how requests are parsed. Keep one configuration source for the web tier, compare the rendered nginx and PHP settings across nodes after each change, and test that blocked paths return the same response everywhere.

CSP settings on every node

Content Security Policy headers are set by the store configuration and by the web server, and a header set on one node but not another gives visitors different protection depending on which node answers. From 2.4.7, CSP runs in restrict mode by default on storefront and admin payment pages, so a node with a stale policy can block checkout scripts. Compare response headers from each node behind the load balancer and confirm that the policy is identical.

CSP documentation

Keeping patch levels aligned

Adobe's upgrade guidance recommends upgrading every patch cycle to stay secure and PCI compliant, and a cluster that patches one node at a time can run mixed code for days. Mixed patch levels mean that some visitors reach a patched store and others reach an unpatched one, and the database schema may not match the code on every node. Use one build artifact for all nodes, record the patch level of each node, and retest after each cycle.

Upgrade guide

Questions buyers ask before scaling out

Can we scale Magento Open Source on one bigger server instead of adding nodes?

Often you can start that way, and it is the simpler choice when traffic is steady and a single host has headroom. Vertical scaling leaves the existing layout alone, but it does not remove the single point of failure, and it does not help if you need maintenance without downtime or spread load across regions. Before deciding, measure where the bottleneck sits: PHP workers, MySQL, OpenSearch, Redis or the cron queue. Adding web nodes only helps if the web tier is the constraint. Ask your team or partner to confirm that with load data from your own environment.

What drives the cost and effort of a multi-node Magento cluster?

The main drivers are the number of nodes, how much state must move off local disk, and how many release steps must run in lockstep. Shared sessions and cache usually need Redis or Valkey, media may need shared or remote storage, and Varnish placement adds another tier to design and test. Cost is partly one-time (architecture, configuration, load balancer and health check setup, deployment pipeline changes) and partly recurring (infrastructure, patch cycles, monitoring). Ask for a written scope that lists each shared service, each node role and the test plan for failover.

What does our team need to provide before the work starts?

Expect to provide access to your cloud accounts, data centers or private network, a load balancer or the decision on which one to use, DNS and TLS certificate control, and a named owner for each decision about data and retention. You also need the current Magento version and its extensions, a list of custom modules and third-party integrations, and recent load and incident history. Developers should be ready to review configuration changes in version control. Confirm these items in the written scope so that timelines reflect real access, not assumptions.

How long does a multi-node build take, and what changes that?

No duration is fixed for every store. The timeline depends on the number of environments, how many extensions need checking for shared-state assumptions, the size of the media library, whether storage is new or migrated, and how many approvals your change process requires. Supported platform versions also matter: Adobe's system requirements for 2.4.9 list PHP 8.5, MySQL 8.4 or MariaDB 12.3 or 11.8, OpenSearch 3, Redis or Valkey 9, RabbitMQ 4.3, Composer 2.10 and nginx 1.30, and Adobe supports only the listed combinations. Ask for milestones tied to each of these items.

Can our in-house team run a multi-node Magento cluster alone?

Many teams with Linux, PHP and Magento experience can run it, but the work sits across several disciplines at once: web servers, cache and session services, shared storage, cron, indexing and deployment. The hard part is usually not the first install but the failure modes, such as a session stored on one node, a cron job running twice, or a media file written only to local disk. Assess your team against those areas honestly. A written scope lets you split the work between your staff and an outside partner, and DeployOpen can be engaged for planning, build, hardening or ongoing support.

How do Magento upgrades change a multi-node cluster?

Each upgrade must roll across every node in a planned order, so the release process becomes a coordinated change instead of a single server patch. Adobe's upgrade guide recommends upgrading every patch cycle to stay secure and PCI compliant, and it names customizations, extension count, third-party integrations and coding practices as drivers of effort. It also references the Upgrade Compatibility Tool. Cache, session and cron services must stay compatible with each version. Ask for an upgrade runbook as part of the deliverables, and confirm which release line your store will track.

Which parts of the cluster need a single cron node?

Scheduled Magento jobs, including indexers and queue consumers that should run once, should be pinned to one designated node so that they do not run in duplicate across the cluster. Web nodes serve traffic and can be added or removed freely. Confirm the exact cron and consumer configuration with your Magento version's operations documentation and test that a failed cron node is detected and replaced. Document the procedure so on-call staff know which host to check first.

How a release moves through the cluster

A release starts on a build server, where code and static assets are compiled and the artifact is tested before anything touches production. The shared configuration is then updated, and maintenance mode is switched on across the load balancer. One designated node runs the database and schema upgrade, after which caches and static content are refreshed on every node. Nodes return to rotation one at a time, and verification of the storefront, admin and cron jobs closes the release.

The ordered phases of one release across the web node cluster.

How DeployOpen scopes and delivers a multi-node Magento cluster

DeployOpen starts a multi-node Magento Open Source project by writing down the layout before any node is built. The written scope names each web node, the shared services behind them (session and cache storage, media storage, search, message queues, database), the single node that runs cron, where Varnish sits, and how a release reaches every node at the same time. It also records which decisions are still open, such as whether media lives on shared storage or a remote store, and what the client's own team must provide. Because the scope is agreed in writing, the client can compare it with an internal build plan line by line before any money is committed to the work.

The build happens in the client's own cloud account, data center or air-gapped network, so the client keeps control of the hosts, network paths, keys and data from the first day. DeployOpen configures the load balancer health checks, the shared Redis or Valkey instance used for sessions and cache, the OpenSearch cluster, and the file ownership and deployment steps on each node, then tests failover and consistency between nodes against the layout in the scope. Confirm with your own platform team which Redis-compatible service you will run and which license terms apply to it, because the choice affects your self-hosting obligations. Check the exact version combinations against Adobe's system requirements for your target release, since Adobe supports only the listed combinations.

At handover, DeployOpen documents the shared services, node roles, configuration sources and the runbooks for releases, cron recovery, cache flushes and adding or removing a node. Those documents are the basis for later work. Most engagements are fixed-scope, and ongoing upgrades and continuous testing are available as retainers, which suits clusters that must follow each Adobe patch cycle. DeployOpen does not publish prices. Ask for a quote that follows from the written scope and that separates one-time build work from recurring retainer work, and ask which items depend on infrastructure you supply.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.