ERPNext high availability

A practical guide to reducing ERPNext downtime by separating web, workers, scheduler, MariaDB and Redis, adding replication and backups, and knowing what a high availability setup needs beyond a single bench.

On this page

Why a single ERPNext bench is not high availability

A finance or operations team that loses ERPNext during month end does not care whether the server was technically up. They care whether they can close the books, post invoices and run stock reports on time. High availability is the design work that keeps those operations running when one component fails, and it is a different question from whether backups exist. A default bench, the command line environment that Frappe uses to manage sites and apps, typically runs the web processes, background workers, scheduler, Redis and MariaDB on one host. That layout is simple to install and easy to reason about, but the host itself is a single point of failure: if it fails, every service fails with it, and restoring from a backup means accepting data loss since the last backup and a rebuild period.

Removing that single point of failure is harder than adding a backup because the components that hold state are the difficult part. The MariaDB database holds the transactional record, the sites directory holds uploaded files and generated documents, Redis carries cache and queued jobs, and the scheduler decides when recurring work such as period closing tasks and reminders runs. Each needs a decision about where it lives, how it is replicated or recovered, and what happens to in-flight jobs during a failover. Running two web nodes against one database does not help if the scheduler runs twice or a job is lost mid-way. Upgrades and migrations add another layer, because bench migrate changes the schema and must be run in a controlled order across any extra nodes.

Before any design work, confirm with your own team which parts of the business must stay available, how long an outage can be tolerated during month end, and who owns the failover runbook. Then check your current deployment against that list: where MariaDB, Redis, workers and the scheduler run, whether backups have ever been restored to a separate host, and which version you run. The supported version list on Frappe's supported versions page is the starting point for that last check. Answers to these questions determine whether you need a split of services, database replication, or a managed hosting arrangement.

Which ERPNext components can be separated and what each one holds

A single bench runs every ERPNext process on one host, so downtime from one failure takes out the whole system. Separating the web tier, workers, scheduler, database, cache and shared files is the first step toward a high availability design, and each piece holds different state that dictates how it can be duplicated.

Web and Socket.io processes

The Gunicorn web workers serve requests and Socket.io handles real-time notifications. Both are stateless between requests, so they are the easiest tier to run on several hosts behind a load balancer. Check that sessions and uploaded files are not held only on one node, and confirm that Socket.io connections survive a node restart in your chosen layout.

frappe_docker services

Background workers

Workers run long jobs such as report generation, email queues, data imports and scheduled tasks pulled from Redis queues. They hold no lasting state of their own, so more workers can be added on additional hosts to absorb queue load. Confirm that every worker host mounts the same sites directory and reaches the same database and Redis instances.

Scheduler

The scheduler queues recurring jobs such as periodic accounting and stock tasks. Running more than one active scheduler risks duplicate execution of the same job, so it is usually kept as a single instance even when workers scale out. Plan a failover approach for it and verify which jobs must not run twice.

MariaDB database

MariaDB holds every transactional record, including ledgers, stock entries and document history, so it is the component where data loss matters most. Replication or a managed database service can provide a standby, but ERPNext's behavior on failover and the replication mode must be tested with your Frappe version. Ask whether the database is authoritative for all sites on the host.

Redis cache and queues

Redis serves two roles: cache for faster page loads and the queue broker for background jobs. Losing cache is tolerable, but losing queued jobs can leave work undone, so decide whether queues need persistence or a replica. Confirm the configuration with your Frappe version before deciding how the cache and queue instances are separated.

Shared files volume and Nginx

Uploaded attachments, private files and generated outputs sit in the sites directory, which every web and worker host must read. A shared volume or object storage approach is needed for this, and Nginx sits in front to route traffic and terminate TLS. Confirm how files are replicated, how backups capture them, and where the load balancer sends traffic when a node fails.

How the deployment model changes the HA design

On Frappe Cloud, the platform provider operates the hosting layer, so much of the infrastructure that a self-managed team would build is already run for you. Your job shifts toward confirming what the chosen plan includes and designing the processes around it. Plan tiers, server types and backup retention differ, so the availability you get depends on the plan you buy, not on ERPNext alone.

  • Provider-operated layer: Frappe Cloud runs the servers, MariaDB, Redis and background workers for the plan you choose. Confirm which of these are dedicated to your site and which are shared.
  • Shared versus dedicated benches: Shared hosting has a lower entry price per the ERPNext pricing page, and it carries neighbor and capacity limits you cannot tune. Dedicated servers start at 125 US dollars per month according to the same page.
  • Server Scripts: Frappe Cloud public shared benches do not allow Server Scripts, so custom logic that depends on them needs a different home.
  • Your responsibilities: Custom apps, business continuity runbooks, user access reviews and testing of restores still fall to your team.
  • Remaining single points of failure: Your own integrations, identity provider and network paths to the site are outside the provider's control.

Before you commit, ask the provider in writing which failover, replication and restore options apply to your plan, and how a restore is requested and timed.",

Which HA topology fits your team and risk tolerance

This table compares four ways to lay out an ERPNext deployment, from one host with off-host backups to a containerized layout, and the operational work each one leaves with your team. Read each row against your team's patching capacity, on-call coverage and tolerance for unplanned downtime. The main takeaway is that every step up in separation adds components you must patch, monitor and fail over, so choose the smallest layout that your recovery targets actually require.

OptionWhen it fitsOperational cost
One host with off-host backupsSmall user base, tolerance for a restore-length outage, and a team with limited on-call coverageLowest patching surface, but recovery depends on tested restores of database and file backups
Separate app and database hosts with replicationBusiness hours dependence on ERPNext and a need to reduce single-host failure impact on MariaDBTwo hosts to patch, replication monitoring, and failover runbooks that someone must rehearse
Separate worker hosts with dedicated RedisHeavy background jobs, scheduled tasks or reports that slow the web tier during peak periodsAdditional hosts and network paths to secure, plus queue and Redis monitoring on every host
Containerized layout with frappe_dockerTeam already runs container platforms and wants declarative service definitions for each roleImage build and update pipeline, orchestration knowledge, and tooling licensing that your platform may require; confirm with your vendors

How to build an ERPNext HA setup in sequence

This sequence turns a single-bench ERPNext install into a layout where database, cache, workers, shared files and the entry point can each be restored or scaled without taking the whole system down. Each step closes with a check, so the team knows the previous layer works before the next one depends on it.

  1. Inventory the current bench and site configuration

    Start by recording what the single bench actually does today. List the apps and versions installed, the site configuration in each site's config file, the Redis and database connection settings, the scheduler state, the file storage paths, and the Nginx and Supervisor (or equivalent) process definitions. Confirm the ERPNext and Frappe versions against the supported versions page, since a version outside the support window changes what you can run safely. The step is done when the team has a written baseline that a second person can read and rebuild from, and when a test restore of the current site runs on a separate machine.

  2. Move MariaDB to its own host with replication

    Move the database to a dedicated host, then add a replica that receives changes from the primary. Point the site configuration at the primary host and confirm that ERPNext reads and writes through it normally. Then run a controlled failover: stop writes, promote the replica, repoint the site, and bring ERPNext back up. The check is a documented failover that completes, followed by a test record created on the new primary and visible from the app. Ask your database specialist to confirm replication lag, binary log retention and the promotion procedure for your MariaDB version, because those details depend on your environment and are not covered by this page.

  3. Move Redis and confirm queue behavior

    Move Redis for caching and background queues to its own host or managed service, and update the connection settings for every bench that uses it. Then test queue behavior directly. Enqueue a job that writes a known record, restart the Redis connection or the worker that should consume it, and confirm the job completes once the worker is back. Also confirm that a cache flush does not lose business data, since Redis holds transient state. The check is a recorded job that completes after a planned interruption, with no duplicate or missing records.

  4. Separate web, workers and the scheduler

    Split the single process group into distinct roles: web (Gunicorn), background workers by queue, the scheduler, and Socket.io. Each role should run as its own service so it can be restarted or scaled alone. Make sure only one scheduler runs for each site, because duplicate schedulers can run scheduled jobs twice. Confirm the role mapping in the process supervisor. The check is a scheduled job that fires once per interval and a worker that picks up a queued job after the worker service is restarted.

  5. Scale workers by queue

    Add worker capacity for the queues that need it, such as long or default queues, rather than adding workers everywhere. Measure queue depth and job duration in your own environment before changing counts, and watch for long-running jobs such as large report generation or data imports, which can block a queue if they share workers. Ask whether your Frappe support provider or partner will review the queue configuration for your workload. The check is a load test in staging where queued jobs drain within the window you set, and no job runs on two workers at the same time.

  6. Place shared files on storage every app node can reach

    Public and private file uploads, generated PDFs and backups must be visible to every application node. Place the sites' file directories on shared storage that all web and worker nodes mount, and confirm the mount survives a node restart. Check that backups read from this same storage so no node holds the only copy of a file. The check is an attachment uploaded through one web node that downloads correctly through another, and a generated print format that a worker on a different host can attach to a document.

  7. Put a load balancer and TLS in front of Nginx

    Place a load balancer in front of two or more Nginx front ends, each forwarding to the web and Socket.io services. Terminate TLS at the load balancer or at Nginx according to your security standard, and set sticky behavior only where your Socket.io configuration requires it. Remove any direct path from the internet to the application nodes. The check is a health check that removes a stopped front end from rotation, and a login and a real-time notification that both work after one front end is taken offline.

  8. Configure backups and prove restores

    Schedule database and file backups from the bench tooling, store copies offsite and keep them off the nodes they protect. Then run a restore into a separate environment at a regular interval you choose, and time it. Keep backup retention and encryption settings in writing, and confirm them with your security and compliance owners. The check is a full restore that opens the site, reconciles a sample of recent transactions, and passes the team's written acceptance list. Without this check, the backup job only proves that a file was written.

Running scheduler and background jobs without duplicates

In a high availability ERPNext setup, the risk to control is that scheduled jobs run twice or stop entirely when a node fails. Frappe runs periodic work such as recurring documents, email queues and scheduled reports through the scheduler, and queued work runs in background workers that pull from Redis. If two application nodes each run a scheduler, the same job can fire twice, which is how duplicate invoices or repeated notifications appear. The design goal is exactly one active scheduler at any time, with workers scaled separately so that a failed node does not silently stop queued jobs. Confirm in your own environment how the scheduler is enabled per site and which node runs it, and check that the same configuration is not copied onto every web node during a rebuild.

Long jobs need their own capacity. Bulk imports, large reports and month-end processes such as period-end revaluations or bulk submissions can occupy a worker for a long time, and a single shared worker pool will leave interactive users waiting. Separate queues for long and short jobs let you add workers for heavy work without starving the rest of the system. The Data Import guidance in the ERPNext documentation advises importing only a few thousand records at a time, so large migrations should be split into batches and queued deliberately rather than run as one request. Ask your implementation partner how batch sizes, job timeouts and retry behavior are set for each queue, and who watches the failed job log after a month-end run.

Before go-live, run a failover test that stops the node holding the scheduler and confirms that a recurring job runs once on the surviving node and that a queued job is picked up after a worker restarts. Check that scheduled work is idempotent where it matters, for example that a retried email or import does not create a second record, and document which jobs are safe to retry manually. Because the scheduler and worker layout depends on your Frappe version and deployment method, verify the current process model against the frappe_docker repository or your bench configuration rather than assuming a default.

How the HA components connect and where state lives

The diagram starts with users reaching a load balancer that terminates TLS and passes traffic to Nginx, which routes to web and Socket.io processes. Those processes write to the primary MariaDB and enqueue jobs in Redis, where worker pools and the scheduler pick them up. The primary MariaDB and the file store hold the state that must survive a node loss, so the replica and backup paths matter most. Check that every stateful box has a tested recovery path and that workers can reach the same files and queues as the web tier.

Stateless tiers connect to stateful MariaDB, Redis, file storage and backups inside the data boundary.

Access, secrets and exposure rules for a clustered ERPNext

Once ERPNext runs across several web, worker and database nodes, each extra network path becomes an exposure point. The rules below cover who can reach the database, Redis, shared files, the scheduler and the bench CLI, and how traffic is encrypted between tiers. Each card names one control to set and one thing to verify before go-live.

Database credentials and replication accounts

Each bench site connects to MariaDB with its own database user, and replicas need a separate replication account with no application login rights. Keep these credentials in a secrets store rather than in site config files copied between nodes, and rotate them through a documented change window. Verify that the application user cannot reach other sites' databases and that replication credentials are never used by the web tier.

frappe_docker repo

Redis access restriction

Redis holds the cache, realtime and queue data that web and worker processes share, so an open Redis port lets anyone on the network read or inject background jobs. Bind Redis to private interfaces, require authentication, and allow connections only from the app, worker and Socket.io hosts. Confirm the exact Redis settings your ERPNext version and deployment method expect before you change them.

Shared file storage permissions

Uploaded attachments and generated files live in the site's files directory, and every web and worker node must read and write the same location. Use a shared volume or object storage with ownership that matches the bench user, and restrict write access to that bench account. Check that a file uploaded through one node is downloadable through every other node.

TLS between load balancer and Nginx

Encryption often stops at the load balancer, which leaves the hop to Nginx and the Socket.io service in plain text inside the network. Decide whether that internal hop needs TLS under your own security policy, then configure certificates and trusted CA chains consistently on every node. Confirm that forwarded protocol and client address headers are set correctly, because ERPNext uses them for login and session behavior.

Admin and System Manager access to scheduler and CLI

System Manager users can change configuration that affects every process, and shell access to a bench node lets an operator run migrations, restore backups or read secrets. Limit the System Manager role to named staff, keep shell access on a small admin group with logged sessions, and do not let the scheduler run under a personal account. Confirm who can disable the scheduler or change worker counts in production.

Server Scripts stay disabled by default

From version 15, Server Scripts are disabled by default and need the server_script_enabled setting before they run. Enable it only when a specific, reviewed script needs it, because a script runs Python with server privileges on every node. Record who approved each enablement and confirm the setting matches across the cluster so behavior does not differ between nodes.

Disabled by default
Version 15
Server Script docs

What drives the effort and cost of an HA build

This table lists the factors that change how much work an ERPNext high availability build takes and what it costs to run. Read each row as a question to answer before quoting, since the same setup can be cheap for one company and expensive for another. The main takeaway is that custom code, integrations and evidence requirements usually shape effort more than the server count itself.

DriverWhy it mattersHow to keep it down
Number of sites and companiesEach site has its own database, files and scheduler jobs, so replication, backup and restore testing multiply with every site added.Consolidate sites where legal entities allow, and confirm with the partner how the quote scales per site.
Data volume and backup sizeLarger databases lengthen replica seeding, backup windows and restore tests, and they raise storage and transfer costs.Archive closed fiscal years where policy allows, and measure current database and file sizes before sizing storage.
Custom apps and their background jobsCustom code must be tested against each HA topology and can add long-running queue jobs that compete with web traffic.Keep custom apps small, document their queues, and test them on the HA staging stack before each upgrade.
Number of integrations hitting the APIEach integration adds authentication, retry logic, rate handling and monitoring, and can overload a single web process if poorly designed.Inventory every integration with its call pattern, use scheduled batch jobs where real time is not needed, and confirm rate limits with the team.
Environments (staging, production, DR)A disaster recovery site and a staging stack that mirrors production double much of the infrastructure and the test effort.Use smaller staging and DR sizing if the business accepts it, and automate builds so environments stay identical.
Compliance evidence neededAssessors may ask for failover test records, backup restore logs, access reviews and change records, which must be produced and kept.Agree the evidence list before design, and build logging and restore tests into routine operations.
Team's existing MariaDB and Linux skillsReplication, failover, Redis persistence and Linux networking need experienced operators, and gaps usually turn into longer projects or outside support.Assess skills early, train the admins on the chosen topology, and confirm who will be on call after handover.

How to test that failover works before you need it

Failover is only proven when you have broken the system on purpose and watched what happens. Run the following tests against a staging copy that mirrors production topology, with separate web, worker, scheduler, Redis and MariaDB hosts, and under a realistic load of concurrent users posting transactions. For each test, write down the expected result before you start, the actual result, the time it took and any manual step someone had to take. Those records are what you will compare against later, and they show whether your runbook matches what the system really does.

Start with the web tier: stop one web node while users are actively submitting forms, and confirm that the load balancer stops routing to it and that in-flight requests fail cleanly rather than corrupting a document. Next, restart a background worker in the middle of a long job, such as a bulk submission or report generation, and check whether the job is picked up again or marked failed so someone can retry it. Then fail the MariaDB primary, promote the replica according to your procedure, repoint ERPNext's database settings if your topology requires it, and verify that a saved document reads back correctly on the new primary. Confirm that the scheduler runs its scheduled jobs exactly once after failover, since a duplicate run can post recurring entries twice. Finally, restore your latest backup to a clean host and reconcile the restored site against known transactions, including the General Ledger totals and stock balances. Confirm the exact backup and restore commands and the scheduler configuration with your own bench and Frappe version before you run these steps, and record the results for every ERPNext minor release and every major upgrade, because a change in version can alter how workers or the scheduler behave.

What to monitor, back up and document after go-live

What should I monitor on an ERPNext high availability setup after go-live?

Monitor the signals that show whether users can work and whether the platform is degrading before users notice: background queue depth, worker health, MariaDB replication lag, disk usage, backup job results and the application error logs. Set alert thresholds during the first weeks of production, when you still know what normal looks like for your order and invoice volumes. Queue depth matters most for ERPNext because scheduled jobs, emails and heavy document processing run through background workers, so a growing backlog often shows up as slow saves or late reports. Ask your team or partner to document which dashboard, log location and alert owner covers each signal. Monitoring tools are usually a separate recurring cost, and the setup effort depends on how much of your existing observability stack you reuse.

How often should ERPNext backups run and where should copies be stored?

Schedule database and file backups at an interval that matches how much data you can afford to re-enter after a failure, and keep at least one copy outside the primary environment. ERPNext's bench tooling produces backups of the database and files, but the schedule, retention period and offsite destination are your decisions. Store copies in a separate account, region or data center so a single incident cannot remove both the live system and its backups. Test restores on a schedule, because a backup job that reports success does not prove the data can be restored. For a deeper walkthrough of backup tooling and point-in-time options, see the sibling topic on backup and disaster recovery. Ask any partner to state in writing who runs restores, how often, and what the recovery target is for your business.

How should we schedule patching when ERPNext ships minor releases so often?

Set a fixed patching cadence on your supported major version, apply minor releases to a staging copy first, and schedule production updates in a defined maintenance window. The ERPNext releases page shows that both version 15 and version 16 receive frequent minor releases, so waiting for a quarterly update can leave you behind on fixes. Check the supported versions page to confirm your major version is still in its support window, because version 14 reached end of life on January 31, 2026, and version 15 support runs until the end of 2027. Test custom apps against each minor release in staging before production. Recurring effort comes from this cycle, so include it in your internal admin time or in a support retainer when you compare options.

What belongs in an ERPNext high availability runbook?

A runbook should describe how the system is built, how to detect a failure, and the exact steps to recover, written so an on-call engineer who did not build the system can follow it at night. Include a topology diagram showing the web, worker, scheduler, Redis, MariaDB primary and replica, file storage and backup locations, with the hostnames and network paths for each. Add the failover steps for each component, the commands used for bench backup and restore, the order in which services are started, and the checks that confirm the system is healthy again. Keep the runbook in a location that survives the outage it describes, such as a copy outside the primary network. Review it after every major change and after every restore test.

How do we document a failover plan and test that it works?

Write each failover step as a numbered procedure with an owner, an expected result and a rollback action, then test it in a non-production copy before go-live. A failover plan should state what triggers the switch, who decides, how users are told, how the replica is promoted, and how traffic is redirected to the surviving components. Record the time each step takes during the test, because those measurements, not assumptions, should drive your recovery expectations. Repeat the test after significant changes to the topology, bench version or custom apps. Ask any partner to deliver the failover procedure as part of the handover, and confirm whether retesting is included in the fixed scope or sold as a retainer.

Who should be on the contact list for an ERPNext outage?

The contact list should name a primary and a backup for each responsibility: platform operations, database administration, network or cloud access, ERPNext application support, finance or operations business owner, and the decision maker who can declare an outage. List phone numbers, chat channels and escalation order, and keep a copy that does not depend on the ERPNext system itself. Include external contacts such as your hosting provider, your implementation partner, any support plan provider and your network carrier, with the account or contract reference each one needs. Review the list every quarter, because staff changes are the most common reason an escalation path fails.

Who owns these tasks after go-live, and what can our team handle alone?

Your internal team can own monitoring, backup verification and the runbook if they have Linux, database and ERPNext bench skills, while patching, complex failovers and custom app upgrades often need a partner or a support retainer. Divide ownership in writing: name who watches alerts, who runs restore tests, who approves maintenance windows and who maintains the documents. Be realistic about the skills needed for MariaDB replication and bench operations, and check whether your team has practiced them under pressure. Ask a partner to state which tasks are included in a fixed-scope engagement, which need a retainer, and which stay with your staff. DeployOpen plans, documents and supports self-hosted open-source platforms in the client's own infrastructure, so these handover and support scopes can be agreed in writing before work starts.

How DeployOpen scopes, builds and hands over ERPNext HA

DeployOpen plans, implements, hardens, backs up, documents and supports self-hosted open-source platforms inside the client's own infrastructure, including ERPNext high availability. Each engagement starts from a written, fixed scope so the topology, failover behavior and handover material are agreed before any work begins.

How we scope

  • Map which ERPNext components run on which hosts, including MariaDB, Redis, workers, scheduler, Socket.io and Nginx.
  • Agree in writing the availability targets, maintenance windows and which processes must survive a single host failure.
  • Confirm the hosting model, whether your own servers, data center or cloud accounts, and the backup and restore expectations.

How we build

  • Separate web, background worker, scheduler and Redis roles onto hosts sized from your measured workload.
  • Configure MariaDB replication and backup jobs, then test failover and restore in a staging copy before production.
  • Document each configuration key, service unit and custom app dependency so your team can reproduce the setup.

How we hand over

  • Deliver the architecture diagram, runbooks for failover and restore, and the test results recorded during the build.
  • Walk your platform, DBA and operations staff through routine checks, upgrade steps and incident procedures.
  • Provide a list of open risks and the decisions still owned by your team, such as recovery time objectives.

How we support

  • Offer ongoing support, upgrades and continuous testing as a retainer after handover, scoped in writing.
  • Retest failover and backup restore after each ERPNext minor release or infrastructure change agreed in the retainer.
  • Ask for a quote built from the written scope, covering one-time build effort separately from recurring support.

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.