What Is Immutable Infrastructure? Deployments That Can't Drift
Immutable infrastructure replaces servers entirely on each deploy rather than modifying them. Learn why it matters for OpenClaw deployments.
Immutable infrastructure is a paradigm where servers (or VMs) are never modified after deployment. Instead, any change creates a new instance from a defined image and replaces the old one entirely.
Why It Prevents Drift
Traditional servers accumulate configuration changes over time — software installed ad-hoc, config edits that weren't documented, dependencies that got quietly updated. Immutable infrastructure eliminates this drift by treating infrastructure as disposable.
Fly.io and Immutable VMs
Fly.io VMs are essentially immutable. Each fly deploy creates new machines from the current image and destroys old ones. There's no SSH access to modify running machines — configuration lives in fly.toml or machine metadata.
OpenClaw's Approach
OpenClaw reinforces this model. Your app config is defined in the OpenClaw JSON (stored at /etc/openclaw/config.json inside the VM), and the boot command copies it to /data/ on first start. To change config, you redeploy — you don't edit a running container.
Practical Benefits
Immutable infrastructure makes rollbacks trivial (destroy new, keep old), makes testing more reliable (pre-prod looks exactly like prod), and simplifies security (fewer persistent attack surfaces).