The idea is simple: a finished server is not tweaked further but thrown away. The OS, packages, code and configuration are baked into an image; when an update comes out, a new image is built, instances are spun up from it and the old ones are switched off. The approach was named and described in 2013, and with the spread of clouds and containers it became the norm.
How it works
Changes live only in the repository and reach the servers through the build pipeline: a change goes into the base image, the image is verified by tests, and new instances then roll out to replace the old ones. Logging into a running server and editing a file by hand is exactly what the approach does not forgive: such a change will vanish at the next replacement, and until then it is a source of unexpected drift. Configuration management tools are not run against a live instance: any change to a running system is a risk.
| Step | Mutable approach | Immutable approach |
|---|---|---|
| Change | an engineer logs in over SSH and edits the config on a live server | the change is committed to the repository and an image build is started |
| Deployment | packages are installed and the machine is configured in place | new instances are spun up from a ready-made image |
| Rollback | someone recalls what was changed and when, then reverts it by hand | switching back to the previous image |
| State | servers live for years and drift apart | servers are disposable and built identically |
Servers built from the same image behave identically: they do not accumulate configuration drift, and the test environment matches production. Rollback is predictable — it is the previous image, not an attempt to undo a dozen changes.
Where the term comes from
The idea grew out of the fight against “snowflakes” — servers assembled by hand and unlike one another: configuration automation made it possible to tear a server down and rebuild it at any moment (the “phoenix”), and immutability became the logical conclusion of that line. On 13 June 2013 Kief Morris described the Immutable Server pattern, noting that his colleague Ben Butler-Cole had coined the word; on 23 June Chad Fowler published the essay “Trash Your Servers and Burn Your Code” about immutable infrastructure. He compared an old server to a house of cards: one-off config changes made during incidents, code released outside the normal process and forgotten cron jobs pile up until people are afraid to touch the system. Netflix, for example, ran on immutable images — it built its own images for Amazon EC2 with the Aminator tool.
The compute part is made immutable: virtual machines, containers, nodes. Data and state are not replaced this way — databases, disks and persistent volumes live longer and need ordinary maintenance and backups; logs are shipped to centralised collection. Differences between instances of the same role are kept to a minimum: configuration and secrets are supplied from outside — through environment variables, platform metadata or a secrets store — and are not baked into the image.
Sources
the term is written from these pagesVerified 18 Nov