Running Appsmith on Multiple Docker Hosts
Overview
If your team runs Docker on virtual machines, you can run Appsmith on two or more Docker hosts behind a load balancer for high availability and more capacity.
The Appsmith container itself is easy to run anywhere. The work is in what sits around it: once more than one container serves traffic, every container must share the same MongoDB, the same Redis, and the same files. This guide explains those pieces, how to size them, and how to operate the result.
This page covers two patterns:
| Pattern | What you get | Complexity | Choose it when |
|---|---|---|---|
| A. Active / passive | One Appsmith host serves traffic; a standby host takes over after a short outage | Low | A few minutes of downtime during failover is acceptable |
| B. Active / active | Two or more Appsmith hosts serve traffic at the same time | Medium–high | You need no single point of failure and want to absorb node loss without downtime |
Docker Swarm is not a validated orchestrator for Appsmith. Customers who tried it ran into problems with the container's user and permissions model. This guide uses plain Docker Compose on each host, with the load balancer handling distribution.
How Appsmith stores state
A single Appsmith container is self-contained. Unless you point it elsewhere, it runs its own embedded MongoDB and Redis inside the container and writes everything under one volume mounted at /appsmith-stacks.
| State | Where it lives by default | What multi-host needs |
|---|---|---|
| Application metadata (apps, pages, queries, users, workspaces) | Embedded MongoDB inside the container | External MongoDB replica set on its own servers, reachable from every host |
| Sessions and cache | Embedded Redis inside the container | External Redis on its own servers, reachable from every host |
| SAML SSO data (Keycloak), versions before 2.8 only | Embedded PostgreSQL inside the container | External PostgreSQL on its own servers, only if you use SAML |
configuration/docker.env: settings, including the encryption password and salt | /appsmith-stacks | Identical on every host, so /appsmith-stacks goes on shared storage |
git-storage/: local clones of Git-connected apps | /appsmith-stacks | Shared storage |
| Backups, TLS certificates, logs | /appsmith-stacks | Shared storage (logs can stay local; see below) |
The encryption password and salt in docker.env decrypt every datasource credential stored in MongoDB. If hosts end up with different values, or the file is lost, saved datasource credentials can't be decrypted. Keep a secure offline copy of docker.env.
Pattern A: Active / passive (simplest)
Run the standard single-container install on a primary host. Replicate its volume to a standby host at the block level, for example with ZFS send/receive, DRBD, storage-array replication, or hypervisor HA such as vSphere HA. If the primary fails, start the same container on the standby and move the DNS name or virtual IP to it.
Why this works: only one container is ever running, so the embedded databases are safe and nothing needs to be externalized.
Rules:
- Never run both containers at the same time against the same data.
- Replicate at the block level. Don't put the embedded MongoDB's volume on NFS or another network filesystem. Databases on NFS are a known cause of corruption.
- Expect a short outage while the standby starts. Test the failover playbook regularly.
- Keep regular
appsmithctl backuparchives as well. Replication also copies corruption.
Benefits of active / passive
Starting with the biggest:
- Easiest to set up. It's the standard single-container Appsmith install plus a standby copy. You don't externalize anything, so the same
docker-compose.ymlworks unchanged. - Fewest machines. Two hosts, a primary and a standby. Active / active needs about ten machines: 2 load balancers, 2+ Appsmith hosts, 3 MongoDB members, 2 Redis nodes with Sentinel, and shared NFS.
- No separate MongoDB, Redis or NFS to run. Only one container runs at a time, so the databases built into the container are safe. There are no replica sets, Sentinels, NFS locking or connection limits to manage.
- Uses tools you already have. Failover relies on infrastructure most teams already run, such as vSphere HA, VM snapshots, SAN or storage-array replication, or ZFS. There's no new clustering to learn.
- Lower cost. Fewer servers and licenses for supporting software, and the standby sits idle until it's needed.
- Simpler upgrades. You upgrade one host. There's no risk of hosts running mixed versions against the same database.
- Simpler backups and restores.
appsmithctl backupcaptures everything in one archive, because all the data lives in one place. - Simpler troubleshooting and support. One container and one set of logs. It's the same layout Appsmith support works with every day.
- An easy path to active / active later. When you need more capacity or zero-downtime failover, move to separate MongoDB and Redis and put
/appsmith-stackson NFS. Nothing you set up now is wasted.
Trade-offs to accept
- Short downtime when failing over, usually a few minutes while the standby starts and DNS or the virtual IP moves. Users may have to sign in again.
- No extra capacity. Only one host serves traffic. To handle more load, use a larger host (scale up), not more hosts.
- The standby must match the primary's size so it can carry the full load.
- Failover is manual or scripted, so test the playbook regularly.
- Replication also copies corruption or bad changes, so keep independent backups.
When the primary goes down: bringing up the standby
What happens
- Appsmith is unavailable as soon as the primary fails. Users see errors until the standby is running and traffic points at it.
- Nothing runs on the standby until you start it. It holds a copy of
/appsmith-stacksas of the last replication point. - How much recent work can be lost depends on how you replicate. With synchronous replication (for example DRBD protocol C, or synchronous SAN mirroring) nothing is lost. With snapshot-based replication (for example ZFS send/receive every 5 minutes), changes since the last snapshot are lost.
- If you use vSphere HA or similar hypervisor HA, the hypervisor restarts the Appsmith VM on another physical host automatically, and the container starts through its restart policy. You only need to verify (step 6 below).
Steps
-
Fence the old primary. Make sure it can't come back and run at the same time as the standby, because two copies writing to the same data cause corruption. Power off the VM, or if it's reachable run
docker compose downand disable the restart policy. Also detach or unmap its volume if you can. -
Promote the replica volume on the standby so it's writable. How depends on your replication:
- DRBD:
drbdadm primary <resource> - ZFS: use the latest received snapshot and set the dataset to read-write (
zfs set readonly=off <dataset>) - SAN or storage-array replication: break or fail over the mirror, then present the LUN to the standby
- DRBD:
-
Mount it at the same path the compose file expects (for example
/mnt/appsmith-stacks), and confirmconfiguration/docker.envis there. That file holds the encryption keys; without it, saved datasource credentials can't be decrypted. -
Start Appsmith on the standby with the same
docker-compose.ymland the same pinned image tag as the primary:docker compose up -d
docker logs -f appsmith # wait for "Appsmith is Running!" -
Point traffic at the standby. Move the virtual IP (keepalived can do this automatically) or update the DNS record. Keep the DNS TTL low (for example 60 seconds) ahead of time so the change takes effect quickly.
-
Verify. Sign in, open a few apps, run a query, and check a Git-connected app. Users may need to sign in again. Tell them that any work since the last replication point may need redoing.
Afterwards: failing back
- Don't simply restart the repaired old primary. Its data is now older than the standby's.
- Re-sync in the other direction, from the current primary (the old standby) to the repaired host. Then either keep the roles swapped, or switch back in a planned maintenance window using the same steps.
Be ready before you need it
- Keep the standby built and patched: same OS, the same Docker version, and the Appsmith image already pulled or loaded. This is essential in air-gapped sites, where you can't download it during an outage.
- Keep the same
docker-compose.ymlon the standby, ideally from version control. - Write the steps above into a runbook with your actual commands, and practice a failover regularly, for example quarterly.
- Alert on
/api/v1/healthand on replication lag, so you know both when the primary fails and whether the standby's copy is current.
Scaling active / passive: CPU, RAM and disk I/O
Only one host serves traffic, so you scale up: you give that host more CPU, memory or faster storage. Everything runs in one container (the Appsmith server, the embedded MongoDB and Redis, and before 2.8 Keycloak), so they all share the host's resources.
| Resource | Signs you need more | What to do |
|---|---|---|
| CPU | CPU stays high for long periods (for example above 70%); queries and page loads slow down at busy times; many users editing or running apps at once | Add vCPUs. Use a non-burstable instance or VM class for steady load. |
| Memory (RAM) | Memory near full; swapping; the container is restarted or killed for running out of memory; slowdowns as the embedded MongoDB loses its cache | Add RAM. The Appsmith server, MongoDB and Redis all share it, so grow in steps (for example 8 → 16 → 32 GB). |
| Disk I/O | High disk latency or I/O wait; slow saves, imports, Git operations or backups; MongoDB slow-query warnings in the logs | Move to faster SSD storage or provision more IOPS and throughput. Keep /appsmith-stacks on local block storage, never NFS. |
| Disk space | /appsmith-stacks filling up from data growth, Git repositories, backups or logs | Expand the volume (and the replica on the standby). Move old backups off the host and rotate logs. |
How to scale up
- Check the trend in your monitoring, so you know which resource is the limit before you change anything.
- Take a backup with
appsmithctl backup. - In a maintenance window, stop Appsmith, resize the primary (vCPU, RAM or storage), and start it again. Most hypervisors and clouds need a restart to apply CPU or memory changes.
- Resize the standby to match, including its replica volume. A standby smaller than the primary can't carry the load after a failover.
- Confirm Appsmith is healthy and watch the same metrics afterwards.
When scaling up stops being enough
If one host is already large and you still hit limits, or you need more capacity than a single machine gives, move to active / active and scale out by adding hosts.
| Active / passive | Active / active | |
|---|---|---|
| Setup effort | Lowest | Highest |
| Machines | 2 | About 10 |
| Separate MongoDB / Redis / NFS | Not needed | Required |
| Failover | Minutes, manual or scripted | Automatic, no downtime |
| Scaling | Scale up: more CPU, RAM or disk I/O on one host | Scale out: add hosts |
| Upgrades | One host | All hosts, in a maintenance window |
| Best for | Most teams wanting basic HA | Critical workloads needing no downtime or more capacity |
Pattern B: Active / active
Every Appsmith host is stateless apart from a shared /appsmith-stacks directory. All hosts talk to the same external MongoDB replica set and Redis, each running on its own servers.
Active / active assumes the supporting services below are already installed, running and operated by your team, using the products and tooling you prefer. Appsmith connects to them; it doesn't install, configure, patch, back up or support them.
- MongoDB of your choice, running as a 3-member replica set on its own servers: MongoDB Community, Enterprise, or Atlas you already support. MongoDB 8 is sufficient. On Intel-based CPUs, the MongoDB machines (virtual or physical) must have AVX enabled and available. Create a database user for Appsmith with the
readWriteandclusterMonitorroles, and have the full connection string (all members plus the replica set name) ready. - Redis running on its own servers, highly available (primary, replica and Sentinel, or a managed Redis service), with authentication on. Have the connection URL ready.
- Highly available shared NFS v4.1 storage (clustered NAS, redundant controllers or a managed service, not a single NFS server), exported to every Appsmith host with locking enabled.
- Load balancers your team already runs and knows how to operate, plus the virtual IP or DNS name.
- TLS certificate for the Appsmith URL, and any internal CA certificates.
- Linux hosts for Appsmith with the latest stable Docker Engine and Compose installed.
- Network access open from every Appsmith host to MongoDB, Redis and NFS, and from the load balancers to the Appsmith hosts on port 80.
- Backups and monitoring in place for MongoDB, Redis and NFS.
- Only for SAML SSO on versions before 2.8: PostgreSQL on its own servers.
Appsmith supplies the Appsmith image, the license key and guidance on connecting Appsmith to these services.
Reference architecture
* Any load balancer your team already runs and knows how to operate, such as a hardware appliance or your cloud provider's load balancer, works. It just needs to meet the load balancer requirements below.
What happens on a request
Sessions live in Redis, so any host can serve any request and users stay signed in when a host disappears.
Component requirements
1. Appsmith hosts (2 or more)
- Docker Engine and the Docker Compose plugin on a 64-bit Linux host.
- The same, pinned Appsmith image version on every host. Never use
latest, because a restart can silently pull a different version and run migrations you didn't plan. /appsmith-stacksmounted from the shared filesystem at the same path on every host.
2. MongoDB (separate instance)
- Appsmith stores all of its data in MongoDB. For more than one Appsmith host, MongoDB must run as a separate instance on its own servers, not the MongoDB embedded in the Appsmith container and not on the Appsmith hosts.
- Run it as a replica set of 3 members on 3 separate machines, so it keeps a voting majority if one member fails. A managed service such as MongoDB Atlas also works.
- CPU must support AVX. MongoDB on Intel-based (x86_64) CPUs requires the AVX instruction set. The virtual or physical machines running MongoDB must have AVX enabled and visible to the operating system. On VMs, check that the hypervisor exposes it: for example, set the CPU type to
hoston Proxmox/KVM, or use a VMware EVC mode that includes AVX. Check withgrep -o -m1 avx /proc/cpuinfo, which should printavx. Without it, MongoDB won't start. - Use the MongoDB distribution your team already runs. MongoDB 8 is sufficient. The Appsmith database user needs the
readWriteandclusterMonitorroles. - Point every Appsmith host at it with
APPSMITH_DB_URL, listing all members and the replica set name. - Give each member its own local block storage (SSD). Never put MongoDB data on NFS.
3. Redis (separate instance)
- Appsmith uses Redis for sessions and caching. For more than one Appsmith host, Redis must run as a separate instance on its own servers, not the Redis embedded in the Appsmith container and not on the Appsmith hosts.
- For HA, run a primary and a replica on separate machines with 3 Sentinel processes, or use a managed service such as ElastiCache or Azure Cache.
- Point every Appsmith host at it with
APPSMITH_REDIS_URL. Always require authentication, and use TLS (rediss://) where available. - Redis data is temporary, so moving from the embedded Redis to a separate instance needs no data migration.
4. Shared filesystem
- Highly available NFS v4.1 or later. Every Appsmith host depends on this share, so if it goes down, every host goes down with it. A single NFS server on one machine is a single point of failure and defeats the purpose of active / active.
- Use clustered or redundant NFS: an HA NAS appliance with redundant controllers (for example NetApp), a clustered NFS server, or a managed service such as Amazon EFS or Azure Files (NFS).
- Mount with normal locking. Don't use the
nolockoption. Appsmith locksdocker.envwhen settings change, andnolocksilently disables that protection across hosts. - Holds only
/appsmith-stacks. No MongoDB or Redis data goes here.
In a single-container install, the embedded MongoDB keeps its data inside /appsmith-stacks. Once Appsmith points at your separate MongoDB and Redis, /appsmith-stacks holds no database files, only settings, Git working copies, certificates and backups, so it's safe on NFS. MongoDB stays on each member's own local SSD.
5. Load balancers (2)
- NGINX or HAProxy (NGINX is most common), in a pair with a floating virtual IP (keepalived/VRRP) or DNS failover. A cloud load balancer works too.
- Terminate TLS here and forward HTTP to port 80 on each Appsmith host.
- Support WebSockets (
UpgradeandConnectionheaders) and long timeouts of at least 300 s. - Health check: HTTP GET on
/api/v1/healthon each host. - Sticky sessions aren't required.
6. PostgreSQL for SAML SSO (versions before 2.8 only)
- Before Appsmith 2.8, SAML single sign-on runs through Keycloak inside the Appsmith container, and Keycloak stores its data in PostgreSQL. In a single-container install that PostgreSQL is embedded. With more than one Appsmith host, every host needs the same Keycloak data, so PostgreSQL must run as a separate instance on its own servers, the same as MongoDB and Redis.
- You only need this if you use SAML on a version before 2.8. From 2.8, SAML runs natively in Appsmith and doesn't need PostgreSQL. Appsmith's application data always stays in MongoDB.
- PostgreSQL 12 or later, ideally with a standby or as a managed service. Use TLS (
sslmode=require), local block storage, and never NFS. - Set it on every Appsmith host with
APPSMITH_KEYCLOAK_DB_URL,APPSMITH_KEYCLOAK_DB_DRIVER=postgresql,APPSMITH_KEYCLOAK_DB_USERNAMEandAPPSMITH_KEYCLOAK_DB_PASSWORD. - If SAML is already set up on a single host, its Keycloak data has to be migrated to the separate PostgreSQL. Contact Appsmith support for the Keycloak migration steps.
What gets installed, and who provides it
Software on each machine
Appsmith runs as one container image on each Appsmith host, so the software footprint is small. There is no separate client or management machine. Administrators SSH to each host and run docker compose there.
| Machine | Install | Notes |
|---|---|---|
| Appsmith host | Docker Engine (docker-ce, docker-ce-cli, containerd.io), the Docker Compose v2 plugin (docker-compose-plugin), the NFS client (nfs-utils / nfs-common), time sync (chrony) | 64-bit Linux (x86_64 or arm64), for example RHEL 9, Ubuntu 22.04/24.04 or Debian 12 |
| Load balancer | NGINX or HAProxy, plus keepalived for the floating IP | Can run as packages or containers. Not needed if you use a load balancer your team already runs and knows how to operate |
| MongoDB servers (3) | MongoDB server packages or containers, configured as a replica set | Separate from the Appsmith hosts. Often an existing, customer-managed MongoDB service |
| Redis servers (2 + Sentinel) | Redis server and Sentinel | Separate from the Appsmith hosts. Often an existing, customer-managed Redis service |
| Admin workstation | An SSH client and a way to copy files to the hosts | Any computer; nothing Appsmith-specific is installed on it |
Do the Appsmith hosts need to be dedicated?
- Use dedicated Linux servers or VMs for production Appsmith hosts. The sizing in this guide assumes Appsmith has the whole machine. Sharing a host with other heavy workloads makes performance hard to predict and failures harder to isolate.
- MongoDB, Redis and the load balancers should run on separate machines from the Appsmith hosts, so losing one Appsmith host never takes a data component with it.
- Docker Desktop on Windows or macOS is fine for trying Appsmith out, but not for production or HA.
Who provides what
Appsmith provides the software and guidance. The customer provides and operates the infrastructure and does the hands-on installation.
| Item | Provided by | Notes |
|---|---|---|
Appsmith container image (appsmith/appsmith-ee, or appsmith/appsmith-airgap for air-gapped sites) | Appsmith | Pin a specific version tag |
| License key (online, or offline key for air-gapped sites) | Appsmith | Offline keys are validated without internet access |
| Documentation and installation guidance | Appsmith | Appsmith advises; it doesn't perform the installation |
| Linux servers/VMs, OS, patching | Customer | |
| Docker Engine and Compose | Customer | |
| MongoDB replica set (separate instance) | Customer | Self-managed or a managed service such as Atlas. The MongoDB built into the Appsmith image is for single-host installs only |
| PostgreSQL for SAML (separate instance), versions before 2.8 only | Customer | Only if you use SAML SSO |
| Redis with Sentinel (separate instance) | Customer | Self-managed or a managed service. The Redis built into the Appsmith image is for single-host installs only |
| Highly available shared NFS v4.1 storage | Customer | Clustered NAS, redundant controllers or a managed service, not a single NFS server |
| Load balancers, virtual IP, firewall rules | Customer | Use whichever load balancer your team already runs and knows how to operate. Appsmith can't prescribe vendor-specific configuration |
| DNS name and TLS certificates (plus internal CA chain if used) | Customer | |
| SMTP server (email invites, password resets) | Customer | Optional |
| Identity provider for SSO (SAML/OIDC) | Customer | Optional |
| Internal Git server (GitLab, Bitbucket Server, Gitea, …) | Customer | Needed for Git-connected apps in air-gapped sites |
| Backups, monitoring, upgrades | Customer | Following this guide |
Node sizing
Appsmith publishes 2 vCPU and 8 GB of memory as the starting point for a standard deployment. That baseline is meant for evaluation and low traffic. Size production from measured load (CPU, memory, MongoDB growth, Redis use, API latency) rather than user counts, and load-test before go-live. Avoid burstable instance types, such as AWS T3, for sustained production load.
| Role | Count | Minimum | Recommended (production) | Storage |
|---|---|---|---|---|
| Appsmith host | 2+ | 2 vCPU · 8 GB RAM | 4 vCPU · 16 GB RAM | 50 GB local disk (OS, images, local logs) |
| Load balancer | 2 | 1 vCPU · 2 GB | 2 vCPU · 4 GB | 20 GB |
| MongoDB replica set member | 3 | 2 vCPU · 8 GB | 4 vCPU · 16 GB | 100 GB SSD block storage per member |
| PostgreSQL for SAML (before 2.8, optional) | 1–2 (primary + optional standby) | 1 vCPU · 2 GB | 2 vCPU · 4 GB | 20 GB SSD block storage |
| Redis + Sentinel | 2 data nodes + 3 sentinels | 1 vCPU · 2 GB | 2 vCPU · 4 GB (more if using in-memory Git) | 10 GB |
| Shared NFS | 1 HA service | — | — | 50 GB+, grows with Git repositories and backups |
Tips:
- Sentinel processes are lightweight. You can co-locate them, for example one on each Redis node and one on an LB node, as long as they sit on three separate machines.
- Small installations can run a MongoDB member and a Redis node on the same machine, as long as there are still three MongoDB members and two Redis data nodes on separate machines.
- Each Appsmith host should have enough headroom to carry the full load if another host fails.
Setup steps
1. Confirm the customer prerequisites
- Check that everything in the Customer responsibility checklist under Pattern B is installed and running, including the MongoDB replica set and Redis, and that every Appsmith host can reach them.
- If you're migrating an existing instance, take a backup with
appsmithctl backupand restore it into the external MongoDB. Keep the backup anddocker.envsafe.
2. Prepare shared storage
On every Appsmith host, mount the same export at the same path:
# /etc/fstab (example)
nfs.example.internal:/appsmith /mnt/appsmith-stacks nfs4 rw,hard,noatime,vers=4.1 0 0
If you're migrating, first restore your data into the separate MongoDB (step 1). Then copy the existing /appsmith-stacks onto the share, including configuration/docker.env but excluding the embedded database folders, so no MongoDB, Redis or PostgreSQL files end up on NFS:
rsync -a --exclude 'data/mongodb/' --exclude 'data/redis/' --exclude 'data/postgres/' \
/old/appsmith-stacks/ /mnt/appsmith-stacks/
Do this before starting any new hosts.
3. Deploy Appsmith on each host
Use an identical docker-compose.yml on every host:
services:
appsmith:
image: index.docker.io/appsmith/appsmith-ee:<pinned-version> # e.g. v2.7.2, same on all hosts
container_name: appsmith
restart: unless-stopped
ports:
- "80:80"
volumes:
- /mnt/appsmith-stacks:/appsmith-stacks
- ./logs:/appsmith-logs # keep logs on local disk
environment:
APPSMITH_DB_URL: "mongodb://appsmith:<password>@mongo1.example.internal:27017,mongo2.example.internal:27017,mongo3.example.internal:27017/appsmith?replicaSet=rs0&authSource=admin"
APPSMITH_REDIS_URL: "rediss://:<auth-token>@redis.example.internal:6379"
APPSMITH_LOG_DIR: "/appsmith-logs"
# Only for SAML SSO on versions before 2.8:
# APPSMITH_KEYCLOAK_DB_URL: "postgresql://pg.example.internal:5432/keycloak?sslmode=require"
# APPSMITH_KEYCLOAK_DB_DRIVER: "postgresql"
# APPSMITH_KEYCLOAK_DB_USERNAME: "keycloak"
# APPSMITH_KEYCLOAK_DB_PASSWORD: "<password>"
Notes:
- Start one host first and wait until it's healthy, so first-time setup and migrations run once. Then start the others.
- URL-encode special characters in passwords inside connection strings.
- Putting logs on each host's local disk keeps chatty log writes off the shared filesystem.
4. Configure the load balancers
Example NGINX upstream:
upstream appsmith {
server appsmith-1.example.internal:80 max_fails=3 fail_timeout=10s;
server appsmith-2.example.internal:80 max_fails=3 fail_timeout=10s;
}
server {
listen 443 ssl http2;
server_name appsmith.example.com;
ssl_certificate /etc/ssl/appsmith.crt;
ssl_certificate_key /etc/ssl/appsmith.key;
client_max_body_size 150m;
location / {
proxy_pass http://appsmith;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto https;
proxy_read_timeout 300s;
}
}
Open-source NGINX only checks hosts passively, through max_fails. Use HAProxy, NGINX Plus or a cloud load balancer if you want active health checks on /api/v1/health.
5. Verify and test failover
- Sign in, open an app, and confirm both hosts appear in the load balancer stats.
- Stop the container on one host (
docker compose stop). Confirm users stay signed in and apps keep working. - Repeat for each host, for the active load balancer, and for the MongoDB and Redis primaries.
Air-gapped installations: what to download
The Docker installation procedure is the same in an air-gapped environment. Only two things change: you use the appsmith/appsmith-airgap image instead of appsmith/appsmith-ee, and you activate with an offline license key that's validated without contacting Appsmith. Everything else has to be downloaded on a connected machine, checked, and carried in.
Download checklist
Build the bundle on a connected machine with the same OS version and CPU architecture (x86_64 or arm64) as the target hosts, so package dependencies resolve correctly.
1. Appsmith
- The
appsmith/appsmith-airgap:<version>image, with a pinned version and the right architecture. It's about 2 GB compressed.
docker pull appsmith/appsmith-airgap:<version>→docker save appsmith/appsmith-airgap:<version> | gzip > appsmith-airgap-<version>.tar.gz - The offline license key from Appsmith. Paste it exactly as issued, including its
key/prefix. Offline keys can't be updated or revoked remotely, so make sure the term matches your contract. - The release notes for that version, for your upgrade records.
2. Container runtime (every Appsmith host)
- The Docker Engine packages:
docker-ce,docker-ce-cli,containerd.ioanddocker-compose-plugin, plus their dependencies (on RHEL, for examplecontainer-selinux). Example:dnf download --resolve --alldeps docker-ce docker-ce-cli containerd.io docker-compose-plugin. - The NFS client (
nfs-utilsornfs-common) and time sync (chrony) if they aren't in your base image.
3. Data tier (skip what you already run internally)
- MongoDB server packages or a pinned
mongo:<version>image (MongoDB 8 is sufficient) for the replica set, plusmongoshand the MongoDB database tools for administration and backups. - Redis server and Sentinel packages, or a pinned
redis:<version>image. - Only for SAML on versions before 2.8: PostgreSQL server packages or a pinned
postgres:<version>image (12 or later).
4. Load balancers
- NGINX or HAProxy and keepalived packages or images (skip if you use a load balancer your team already runs).
5. Configuration and certificates
-
docker-compose.ymlfor the Appsmith hosts (see Setup steps). - Load balancer configuration (
nginx.conf/haproxy.cfg) and keepalived configuration. - TLS certificate and key for the Appsmith URL.
- Your internal root/intermediate CA certificates, if your datasources, SSO provider, SMTP or Git server use certificates from an internal CA. These go in
/appsmith-stacks/ca-certs/so Appsmith trusts them.
6. Integrations to plan for
- An internal Git server reachable over SSH, if you'll use Git-connected apps.
- An internal SMTP relay and an identity provider, if you'll use email or SSO.
Loading the images offline
Without an internal registry, run this on every Appsmith host:
gunzip -c appsmith-airgap-<version>.tar.gz | docker load
docker image ls appsmith/appsmith-airgap # confirm the tag
With an internal registry (recommended when there are several hosts), load the image once, retag it as registry.example.internal/appsmith/appsmith-airgap:<version>, push it, and point image: in docker-compose.yml at the internal registry.
Then set image: to appsmith/appsmith-airgap:<version> (or the registry path) on every host, start the first host, and enter the offline license key during setup.
Features that need internet access
Some features reach Appsmith or third-party services on the internet, and they won't work offline: the template gallery, Google Sheets and other cloud SaaS datasources, and in-app release notes. Any datasource you connect to must be reachable from inside the air-gapped network.
Upgrades in an air-gapped environment
Repeat steps 1 and 5 for each new version. Bring in the new image (and the matching release notes) before the maintenance window, load it on every host or into the registry, then follow the Upgrades procedure below.
Operating the cluster
Scaling out: adding another Appsmith host
In Pattern B, each Appsmith host is interchangeable. Adding one needs no change to the existing hosts and no downtime. The new host mounts the same shared /appsmith-stacks, picks up the same docker.env (settings and encryption keys) from it, and connects to the same MongoDB and Redis.
Before you add the host
- Same version: the new host must run exactly the image tag the others run. Check it with
docker inspect appsmith --format '{{.Config.Image}}'on an existing host. A different version against the same MongoDB can run migrations the other hosts don't expect. - Same mount: mount the NFS export at the same path, with the same options (NFS v4.1, locking enabled). Don't copy
/appsmith-stacksonto local disk. - Network access: the new host must reach every MongoDB member, Redis and the NFS server. The load balancers must be able to reach it on port 80.
- Data-tier headroom: every Appsmith host opens its own connection pool to MongoDB and Redis. Check that MongoDB's connection limit, Redis
maxclients, and NFS throughput can take one more host. Scale those up first if they're close to their limits.
Steps
- Build the VM from the same baseline as the existing hosts (OS, Docker Engine, Compose plugin, time sync).
- Mount the shared filesystem and confirm
configuration/docker.envis visible under the mount. - Copy the existing
docker-compose.ymlunchanged and rundocker compose up -d. - Wait until
/api/v1/healthreturns healthy and the container logs show a normal startup. - Add the host to the upstream pool on both load balancers and reload them (
nginx -s reloador the HAProxy equivalent). Existing connections aren't dropped. - Confirm the new host is receiving traffic and that error rates and latency stay flat.
Scaling in (removing a host)
- Take the host out of the load balancer pool on both load balancers and reload them.
- Wait for in-flight requests and WebSocket connections to drain (a few minutes).
- Run
docker compose downon that host only. - Unmount the share. Never delete or clean the shared
/appsmith-stacksdirectory from a host you're removing; the other hosts are still using it.
Good to know
- No autoscaling: plain Docker has no orchestrator, so hosts are added and removed by hand or with your automation (Ansible, Terraform, VM templates). Plan capacity ahead of expected peaks, because a new host takes a few minutes to provision and start.
- When to add a host: add one when CPU or memory stays high across all hosts, or when the remaining hosts couldn't carry the full load if one failed (keep N+1 capacity). For a single heavy workload, a larger host (scaling up) can be simpler than adding more hosts.
- The data tier scales separately: adding Appsmith hosts doesn't add MongoDB, Redis or NFS capacity. More hosts mean more connections and more shared-file activity, especially with Git-connected apps. Watch those components as you grow.
- Keep hosts identical: keep the same compose file, image tag and mount options on every host, ideally from one source of truth such as a Git repository or a configuration-management template, so no host drifts.
Upgrades
All hosts must run the same version, and database migrations should run from a single host.
- Don't run mixed versions against the same MongoDB.
- Keep dev, staging and production on the same version, and upgrade lower environments first.
Backups
- MongoDB:
mongodump, filesystem snapshots of a secondary, or your managed service's backups, plus periodicappsmithctl backuparchives taken from one host. - Shared filesystem: regular snapshots (covers
docker.env, Git working copies and certificates). docker.env: an extra copy in your secrets vault.
Changing settings
Admin Settings changes are written to docker.env on the shared filesystem and apply to every host after a restart. Restart hosts one at a time so the service stays up.
Monitoring
Track CPU, memory and disk on every node, MongoDB size and replica-set lag, Redis memory and Sentinel failovers, NFS latency, load balancer 5xx rates, and page and API latency.
FAQ
Can I just put everything, including the embedded MongoDB, on NFS and run two containers?
No. Two containers would each start their own embedded MongoDB on the same files, and MongoDB on NFS is prone to corruption. Run MongoDB and Redis as separate instances.
Can I avoid shared storage entirely?
Not today. Git-connected apps and the shared docker.env (encryption keys and settings) depend on every host seeing the same files. Without shared storage, hosts drift apart.
How many Appsmith hosts do I need?
Two for redundancy. Add more for capacity, keeping enough headroom that the remaining hosts can carry the load if one fails.
Is Docker Swarm supported?
It isn't validated. Use Docker Compose per host as described here.
References
- Docker installation guide
- High availability on AWS ECS, the closest official equivalent to this pattern
- External MongoDB and Redis
- Infrastructure and capacity planning
- Backup and restore