Amplify is designed to be self-hosted by default. This page covers all deployment methods, reverse proxy configuration, and SSL requirements.
Docker deployment
Amplify's docker-compose.yaml defines three profiles for different deployment scenarios.
Dockerfile multi-stage build
The
Dockerfileuses four stages:Stage Base Purpose buildnode:22-bookworm-slim Install deps, build Remix app ( --max-old-space-size=4096)prod-depsinherits from buildpnpm prune --prod --ignore-scriptsamplify-ai-productioninherits from prod-depsFinal runtime; installs curl for healthcheck; EXPOSE 5173 developmentinherits from buildDev runtime with source mount support Healthcheck:
curl -fsS http://localhost:5173/— interval 10s, timeout 3s, start-period 5s, retries 5Start command:
pnpm run dockerstart→bindings=$(./bindings.sh) && wrangler pages dev ./build/client $bindings --ip 0.0.0.0 --port 5173
Cloudflare Pages deployment
Deploy Amplify to Cloudflare Pages for edge-hosted execution.
Step 1: Build
pnpm run build
Creates build/client/ and build/server/.
Step 2: Deploy
pnpm run deploy
# or manually:
wrangler pages deploy ./build/client
Step 3: Set secrets
wrangler pages secret put OPENAI_API_KEY
wrangler pages secret put ANTHROPIC_API_KEY
Step 4: Set config
wrangler pages config set DEFAULT_NUM_CTX=32768
Step 5: Add COEP/COOP headers (REQUIRED for WebContainers)
Create a _headers file in build/client/:
/*
Cross-Origin-Embedder-Policy: credentialless
Cross-Origin-Opener-Policy: same-origin
Worker size limits
Cloudflare Pages functions have size limits:
- Free tier: 1MB worker size
- Paid tier: 10MB worker size
The wrangler.toml config: name = "amplify", compatibility_flags = ["nodejs_compat"], compatibility_date = "2025-03-28", pages_build_output_dir = "./build/client"
Coolify deployment
Deploy Amplify via Coolify (self-hosted platform alternative):
- Create new application in Coolify
- Set Dockerfile path and build target (
amplify-ai-production) - Pass
VITE_PUBLIC_APP_URLas build argument - Configure environment variables for API keys
- Deploy via Coolify's Docker builder
Electron desktop app
For a native desktop experience, use the Electron build.
Configuration (electron-builder.yml):
- appId:
com.amplify.dev, productName:Amplify - Mac: DMG target, hardenedRuntime, category: developer-tools
- Win: NSIS installer with custom installation directory
- Linux: AppImage + deb targets
- Auto-updater via
setupAutoUpdater()
Build commands:
pnpm run electron:dev # Dev mode with Vite HMR
pnpm run electron:build:dist # Full distribution build (macOS, Windows, Linux)
Electron main process (electron/main/index.ts):
- Creates BrowserWindow with Remix request handler
- Cookie management (
initCookies,storeCookies) - Vite server for dev mode
- App path root configurable via
VITE_APP_PATH_ROOT
Native deployment
Deploy Amplify on bare metal (Linux/macOS):
Requirements:
- Node.js 18.18.0+, pnpm, 4GB+ RAM
- Reverse proxy (nginx or Caddy)
Build and start:
NODE_OPTIONS=--max-old-space-size=4096 pnpm run build
pnpm run start:unix
start:unix command: bindings=$(./bindings.sh) && wrangler pages dev ./build/client $bindings
Process management options:
- systemd — Create a service unit for production reliability
- PM2 —
pm2 start "pnpm run start:unix" - Docker Compose — Use the production profile
Reverse proxy configuration
A reverse proxy is required for production deployments to handle SSL, COEP/COOP headers, and SSE streaming.
Required headers (for WebContainers):
Cross-Origin-Embedder-Policy: credentialless
Cross-Origin-Opener-Policy: same-origin
SSL is required
WebContainers require HTTPS because:
SharedArrayBuffer(needed for WebAssembly) requires a secure context- COEP/COOP headers only work with HTTPS
- Most modern browser APIs require HTTPS
Options: Let's Encrypt (Certbot/Caddy), Cloudflare SSL, or commercial certificates.
Memory recommendations
| Component | Minimum | Recommended |
| Node.js heap | 4GB | 8GB (--max-old-space-size=8192) |
| Server RAM | 4GB | 8GB+ |
| CPU cores | 1 | 2+ |
| Disk | 1GB | 5GB+ (for builds) |
Learn about migration options