How to Self-Host Appsmith with Docker Compose: HTTPS, Backups (2026)

Nov 10, 2026 · 11 min · Ajay Kumar

This guide is for an engineer who has been asked to "just stand up Appsmith" for the support or ops team and wants it done in a way that survives a security review. At the end you will have Appsmith Community Edition running on one Linux host with Docker Compose, the image pinned to v2.6.0 (released 28 October 2026), HTTPS from a Caddy 2.11.9 reverse proxy, public signup turned off, a Postgres datasource connected through a read-only role, nightly backups copied off the host with a restore you have actually tested, and an upgrade routine. Prerequisites: a Linux VM with at least 8 GB of RAM, Docker Engine 20.10.7 or later with the Compose plugin, a DNS name you control, and ports 80 and 443 open. If you are still choosing between tools, read the Retool vs Appsmith vs ToolJet vs Budibase comparison first.

Self-hosted Appsmith on one host: request path and backup path Users Browser, HTTPS :443 Caddy 2.11.9 TLS, Let's Encrypt appsmith-ce v2.6.0 port 80, private network Postgres datasource read-only role, SSL ./stacks volume data, docker.env, backup Off-host copy age-encrypted archives Only Caddy publishes ports. Appsmith is reachable only on the Docker network, so all traffic gets TLS.
The layout this guide builds. Port numbers, the ./stacks mount and the backup directory come from the Appsmith Docker install and backup documentation.

Step 1: Prepare the host and DNS

Point an A (and AAAA, if you have IPv6) record such as apps.example.com at the VM, and allow inbound 80 and 443. Port 80 must stay open for the Let's Encrypt HTTP challenge. The Appsmith Docker docs also ask for outbound access to cs.appsmith.com, and at least 8 GB of RAM because the default container runs MongoDB, Redis and PostgreSQL inside it.

# Check versions; Appsmith needs Docker 20.10.7+.
docker --version
docker compose version

# Confirm DNS resolves to this host before Caddy asks for a certificate.
dig +short apps.example.com

mkdir -p ~/appsmith && cd ~/appsmith

Step 2: Write a pinned docker-compose.yml

The upstream quick start publishes Appsmith's own ports 80 and 443 directly. I put Caddy in front instead, so Appsmith only listens on a private Docker network and TLS lives in one place you can reason about. Pin both images: Appsmith's best practices say to use a release tag "instead of relying on the implicit latest reference".

# ~/appsmith/docker-compose.yml
services:
  appsmith:
    # Community Edition, pinned. Check https://github.com/appsmithorg/appsmith/releases
    image: index.docker.io/appsmith/appsmith-ce:v2.6.0
    container_name: appsmith
    restart: unless-stopped
    volumes:
      - ./stacks:/appsmith-stacks      # all state: data, docker.env, backups, Git
    expose:
      - "80"                           # reachable by Caddy only, not published
    extra_hosts:
      - "host.docker.internal:host-gateway"   # lets Appsmith reach a DB on this host
    networks:
      - web

  caddy:
    image: caddy:2.11.9
    container_name: caddy
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
      - "443:443/udp"                  # HTTP/3
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile:ro
      - caddy_data:/data               # certificates live here; do not lose it
      - caddy_config:/config
    depends_on:
      - appsmith
    networks:
      - web

networks:
  web: {}

volumes:
  caddy_data: {}
  caddy_config: {}

If you would rather use the Commercial edition, swap appsmith-ce for appsmith-ee and keep the same tag.

Step 3: Add HTTPS with Caddy and start the stack

Caddy obtains and renews a Let's Encrypt certificate automatically and passes WebSocket upgrades and X-Forwarded-* headers without extra configuration, which matters because Appsmith's real-time service sits under /rts/.

# ~/appsmith/Caddyfile
apps.example.com {
	encode zstd gzip
	reverse_proxy appsmith:80
}

Do not set APPSMITH_CUSTOM_DOMAIN in this layout. That variable tells Appsmith's internal Caddy to fetch its own certificate and redirect HTTP to HTTPS, which you only want when Appsmith faces the internet directly. Appsmith's internal proxy trusts forwarded headers only from private address ranges by default (APPSMITH_TRUSTED_PROXIES defaults to private_ranges in caddy-reconfigure.mjs), and a Caddy container on the same Docker network qualifies.

docker compose config -q && echo "compose file OK"
docker compose up -d

# First boot can take several minutes. Wait for (healthy).
docker compose ps
# Example output:
# NAME       IMAGE                                          STATUS
# appsmith   index.docker.io/appsmith/appsmith-ce:v2.6.0    Up 4 minutes (healthy)
# caddy      caddy:2.11.9                                   Up 4 minutes

# Through the proxy; expect 200.
curl -s -o /dev/null -w '%{http_code}\n' https://apps.example.com/api/v1/health

The image ships a Docker HEALTHCHECK that runs /opt/appsmith/healthcheck.sh every 15 seconds; if the status stays at (health: starting), run that script yourself with docker compose exec appsmith /opt/appsmith/healthcheck.sh to see which process is not RUNNING.

Step 4: Create the admin, then lock down signup

Open https://apps.example.com and create the first account immediately; it becomes the instance administrator. Then close the door. Open signup was half of the exploit chain in CVE-2024-55963, where anyone who could register could reach the bundled database on versions 1.20 to 1.51.

Appsmith writes its configuration, including generated encryption secrets, to ./stacks/configuration/docker.env on first start. Add these lines (variable names from the environment variables reference):

# ~/appsmith/stacks/configuration/docker.env  (append; keep existing lines)
APPSMITH_SIGNUP_DISABLED=true            # only invited users can join
APPSMITH_ADMIN_EMAILS=ops-lead@example.com
APPSMITH_DISABLE_TELEMETRY=true
APPSMITH_BACKUP_CRON_EXPRESSION=0 2 * * *   # nightly at 02:00, 5-field cron
APPSMITH_BACKUP_ARCHIVE_LIMIT=7             # keep 7 archives (default is 4)
# v2.6.0 rejects shell expressions in docker.env; values must be literals.
docker compose restart appsmith

# Save the encryption secrets somewhere other than this host, now.
grep -E '^APPSMITH_ENCRYPTION_(PASSWORD|SALT)=' stacks/configuration/docker.env

That last point is not optional. The two encryption values protect every datasource credential Appsmith stores, and an unencrypted backup cannot be restored usefully without them.

Step 5: Connect Postgres with a read-only role

An internal tool builder holds the keys to your production data, so give it the smallest key that works. Create a dedicated role, read-only by default, with a statement timeout so a careless query cannot hold locks for minutes. These are standard Postgres statements; ALTER DEFAULT PRIVILEGES only covers tables created later by the role that runs it.

-- Run as a superuser or the database owner.
CREATE ROLE appsmith_ro LOGIN PASSWORD 'REPLACE_WITH_A_GENERATED_SECRET';
GRANT CONNECT ON DATABASE app TO appsmith_ro;
GRANT USAGE ON SCHEMA public TO appsmith_ro;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO appsmith_ro;
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO appsmith_ro;
ALTER ROLE appsmith_ro SET statement_timeout = '15s';
ALTER ROLE appsmith_ro SET default_transaction_read_only = on;

When a tool genuinely needs to write, create a second role with INSERT or UPDATE on the specific tables and nothing else. If the data has tenants, Postgres row-level security is a stronger boundary than any WHERE clause in an Appsmith query.

Allow only the Appsmith network in pg_hba.conf, over TLS. Find the subnet first:

docker network inspect appsmith_web --format '{{(index .IPAM.Config 0).Subnet}}'
# 172.18.0.0/16   (example; use your own value)
# pg_hba.conf: TLS only, this role only, this subnet only
hostssl  app  appsmith_ro  172.18.0.0/16  scram-sha-256

In Appsmith, create a PostgreSQL datasource with Connection Mode: Read Only, host host.docker.internal for a database on the same VM (or the real hostname otherwise), user appsmith_ro, and SSL Mode: Require. The Postgres datasource docs list the modes as Allow, Prefer, Require and Disable, with Prefer as the default, which silently falls back to plaintext. Prepared statements are on by default; leave them on.

Step 6: Choose an SSO option

Community Edition supports Google and GitHub OAuth; SAML and OIDC are on the Enterprise plan per the Appsmith pricing page. If your company login is Google Workspace or a GitHub organisation, OAuth is enough. Create an OAuth client in Google Cloud or GitHub using the redirect URL shown on the matching authentication page in Appsmith's Admin Settings, then add:

# ~/appsmith/stacks/configuration/docker.env
APPSMITH_OAUTH2_GOOGLE_CLIENT_ID=1234567890-abc.apps.googleusercontent.com
APPSMITH_OAUTH2_GOOGLE_CLIENT_SECRET=REPLACE_WITH_SECRET
# or
APPSMITH_OAUTH2_GITHUB_CLIENT_ID=REPLACE_WITH_CLIENT_ID
APPSMITH_OAUTH2_GITHUB_CLIENT_SECRET=REPLACE_WITH_SECRET

Restart the container, confirm you can sign in with SSO as an admin, and only then disable password login in Admin Settings. If you lock yourself out, appsmithctl enable-form-login (alias efl) turns it back on. If you need SAML for Okta, Entra ID or Keycloak, that is the point at which you are buying Enterprise.

Step 7: Schedule backups, copy them off-host, test a restore

appsmithctl backup archives the internal database, docker.env and Git data into ./stacks/data/backup/. Interactively it asks for a password and writes an encrypted .tar.gz.enc. The backup docs warn that scheduled or --non-interactive runs write an unencrypted .tar.gz containing a plaintext database dump, so encrypt before the archive leaves the machine.

# Manual, encrypted backup before any risky change:
docker compose exec appsmith appsmithctl backup

# Nightly host cron (03:00, after Appsmith's 02:00 job): encrypt and ship.
# Uses age v1.3.2; the recipient is a public key whose private half lives elsewhere.
cat > /usr/local/bin/appsmith-offsite.sh <<'EOF'
#!/usr/bin/env bash
set -euo pipefail
cd ~/appsmith/stacks/data/backup
latest=$(ls -1t appsmith-backup-*.tar.gz 2>/dev/null | head -1)
[ -n "$latest" ] || { echo "no backup found" >&2; exit 1; }
age -r age1examplepublickeyreplaceme -o "/var/backups/$latest.age" "$latest"
rsync -a "/var/backups/$latest.age" backup@backup-host:/srv/appsmith/
EOF
chmod +x /usr/local/bin/appsmith-offsite.sh

A backup you have never restored is a hope. Once a month, restore the newest archive into a throwaway instance on another VM with the same image tag, following the restore docs:

# On the scratch VM, same docker-compose.yml, fresh ./stacks.
docker compose up -d appsmith
age -d -i ~/restore-key.txt -o appsmith-backup-TIMESTAMP.tar.gz appsmith-backup-TIMESTAMP.tar.gz.age
docker cp appsmith-backup-TIMESTAMP.tar.gz appsmith:/appsmith-stacks/data/backup/

# Unencrypted archive: supply the source instance's saved secrets.
read -rs APPSMITH_ENCRYPTION_PASSWORD; export APPSMITH_ENCRYPTION_PASSWORD
read -rs APPSMITH_ENCRYPTION_SALT; export APPSMITH_ENCRYPTION_SALT
docker exec -e APPSMITH_ENCRYPTION_PASSWORD -e APPSMITH_ENCRYPTION_SALT \
  appsmith appsmithctl restore --non-interactive \
  --backup-file=appsmith-backup-TIMESTAMP.tar.gz

--backup-file takes the exact filename, not a path. If the archive's version differs from the running image, a non-interactive restore stops unless you add --force. Then open a datasource and run a query: wrong encryption values let the restore finish but leave stored credentials undecryptable, and you only find out when a query fails. For how often and how far away, the RPO and RTO post covers the reasoning.

Step 8: Upgrade without surprises

Read the release notes for every version you skip. Appsmith has required checkpoints: from before v1.9.2 you must stop at v1.9.2, and from between v1.9.2 and v1.96 you must pass through v1.96 to v1.99 before v2.0, per the upgrade docs. The v2.6.0 notes tell Commercial edition users to upgrade to v2.5.1 first and let old workflow runs finish, and they also include a fix for a Node.js Brotli decoder vulnerability, which is a good reason not to lag.

cd ~/appsmith
docker compose exec appsmith appsmithctl backup          # encrypted, interactive
cp docker-compose.yml docker-compose.yml.bak

# Edit the tag to the target release, e.g. v2.6.0 -> the next tag you have read.
sed -i 's|appsmith-ce:v2.6.0|appsmith-ce:NEW_TAG|' docker-compose.yml

docker compose pull appsmith
docker compose rm -fsv appsmith
docker compose up -d
docker compose ps        # wait for (healthy), then smoke-test edit and view mode

Rollback means restoring the backup into the previous tag, not just reverting the image, because migrations may have run. Do this on a staging instance first if the tools matter.

Troubleshooting

Symptom Likely cause Fix
Caddy logs ACME errors, browser shows a certificate warning DNS not pointing at the host, or port 80 blocked Check dig +short, open 80 inbound, docker compose restart caddy
502 Bad Gateway from Caddy Appsmith still starting or unhealthy docker compose ps; run /opt/appsmith/healthcheck.sh inside the container
Container restarts in a loop after an upgrade Skipped a checkpoint version, or shell expressions in docker.env on v2.6.0 Read docker compose logs appsmith; replace expressions with literal values; restore and step through checkpoints
Redirect loop or mixed-content errors APPSMITH_CUSTOM_DOMAIN set while behind Caddy Remove it from docker.env and restart
Real-time editing indicators never connect WebSocket blocked by an extra proxy or CDN in front Allow upgrades for /rts/*, or proxy straight to Caddy
Postgres datasource times out on host.docker.internal Postgres listens only on 127.0.0.1, or extra_hosts missing Set listen_addresses to include the bridge IP; keep the host-gateway entry
no pg_hba.conf entry for host Subnet or hostssl rule missing, or SSL Mode not Require Add the subnet from docker network inspect; reload Postgres
Queries fail after a restore with decryption errors Wrong APPSMITH_ENCRYPTION_PASSWORD or _SALT Restore again with the source instance's saved values
Locked out after disabling password login SSO misconfigured docker compose exec appsmith appsmithctl enable-form-login
Disk fills over weeks Backup archives plus logs in ./stacks Lower APPSMITH_BACKUP_ARCHIVE_LIMIT; monitor the volume

FAQ

Do I need the Appsmith Commercial edition to self-host?

No. The appsmith-ce image is Apache-2.0 and self-hosts with the same Compose file. The Commercial image also runs on a free plan; a paid Business licence unlocks custom roles, audit logs and workflows, and Enterprise adds SAML and OIDC.

Can I use an external MongoDB or Redis instead of the embedded ones?

Yes. Set APPSMITH_DB_URL to a MongoDB URI and APPSMITH_REDIS_URL to redis:// or rediss:// in docker.env. That moves state out of the container, which helps for high availability, but you then back up those services yourself as well.

How much RAM does self-hosted Appsmith need?

Appsmith's Docker docs ask for at least 8 GB for the default all-in-one container, because it runs MongoDB, Redis and PostgreSQL alongside the Java server and the editor.

Should I use Appsmith's built-in HTTPS instead of Caddy?

You can. Set the custom domain in Admin Settings, publish ports 80 and 443 on the Appsmith container, and it provisions a Let's Encrypt certificate itself. I prefer a separate proxy because it gives you one place for TLS, headers and access logs across services.

In production, the first thing I check on any Appsmith instance is whether signup is still open, and the second is what database role the datasources use; those two settings decide how bad a bad day gets. After that I check that last night's archive exists off the host and that someone has restored one this month. The upgrade notes for each release are short and worth reading in full. Official docs: Docker install, environment variables, appsmithctl, backup, restore and upgrades.

Related: How to Set Up Nginx as a Reverse Proxy With Let's Encrypt (Ubuntu 24.04), How to Self-Host n8n with Docker Compose in Queue Mode (2026) and Backup and Disaster Recovery in 2026: RPO vs RTO, 3-2-1-1-0, Real Costs.

Spot an error or something out of date? Email me and I will fix it and log it on the corrections page.

I'm Ajay Kumar — I build and operate PandaStack, an open-source Firecracker microVM cloud for AI agents, and write about the infrastructure and tooling around it.

Need this kind of infrastructure work? See what I do or email hello@ajayk.sh.


Related