Immutable Infrastructure
Immutable infrastructure is an approach where servers or containers are never modified after deployment — any update or fix is made by building a new image and replacing the old instance entirely, rather than patching it in place.
Definition
Immutable infrastructure is an approach where servers or containers are never modified after deployment — any update or fix is made by building a new image and replacing the old instance entirely, rather than patching it in place.
Overview
In the traditional model, servers are provisioned once and then updated repeatedly over their lifetime: patches, config tweaks, and manual fixes accumulate over months or years. Immutable infrastructure rejects that model outright. Instead, every change — a new application version, a security patch, a configuration update — is baked into a brand-new image, which is deployed to replace the running instance completely. The old instance is simply terminated, never edited. This approach eliminates configuration drift by construction: because no instance is ever changed after it's launched, there's no opportunity for it to slowly diverge from its declared state. It also makes rollback trivial — reverting to a previous version just means redeploying the previous image, with none of the uncertainty of trying to manually undo a series of in-place changes. Docker containers and cloud machine images are the most common building blocks for immutable infrastructure today, typically deployed and replaced automatically by container orchestration platforms like Kubernetes. Immutable infrastructure pairs naturally with Infrastructure as Code (IaC) and deployment strategies like blue-green deployment and canary deployment, which rely on being able to stand up a full new version of a system alongside the old one and switch traffic over cleanly. It's also a foundational assumption behind the twelve-factor app methodology's guidance to treat builds and releases as immutable artifacts.
Key Concepts
- Instances are replaced wholesale rather than patched or modified in place
- Eliminates configuration drift by removing the possibility of unmanaged manual change
- Makes rollback simple — just redeploy the previous known-good image
- Enables reliable blue-green and canary deployment strategies
- Commonly implemented with container images or immutable cloud machine images
- Encourages fully automated, repeatable build pipelines rather than manual provisioning
Use Cases
Frequently Asked Questions
From the Blog
Infrastructure as Code Explained: Terraform Basics
Clicking through cloud consoles doesn't scale. Infrastructure as Code (IaC) lets you define, version, and automate your cloud resources in code. This guide explains IaC concepts and walks you through Terraform — the most widely used IaC tool.
Read More Cloud & CybersecurityTerraform Basics: Infrastructure as Code on AWS
Terraform lets you define cloud infrastructure in code, version it in Git, and deploy it repeatably. This guide covers providers, resources, variables, outputs, state management, and real AWS examples — from a simple S3 bucket to a complete web server setup.
Read More