Tutorial · migration-hosting · Published 2026-08-16 · 3 min read

Zero-downtime deployment with blue green

Deploy with a blue green strategy to release without downtime. Learn how two identical environments, a single switch and rollback work.

What blue green is

Blue green deployment keeps two identical environments, conventionally called blue and green. Only one serves live traffic at a time; the other is idle. To release a new version you deploy it to the idle environment, test it, then switch the router or load balancer so all traffic flows there. The switch is a single, atomic re-pointing step, so there is no window where old and new are mixed and no moment the site is down.

The name is just a label. The mechanism is: run the new build next to the old build, point traffic at the new one, and keep the old one ready to switch back if the new build fails.

Running two environments

For blue green to work, environments must be switchable without a shared mutable half-step:

A common pattern is automated deployments to a platform that supports instant routing between two slots, preview URLs, or edge configurations. The key requirement is that switching is cheap, repeatable and reversible, not that you hand-manage two servers.

Switching and rollback

The release sequence:

  1. Deploy the new build to the idle environment.
  2. Run sanity checks against it, ideally via a staging or preview URL.
  3. Switch routing so live traffic reaches the new environment.
  4. Watch synthetic checks and error rates for a short window.
  5. On success, retire the previous environment. On failure, switch back to it immediately.

The same switch that moves traffic forward moves it back, so rollback is symmetric and near-instant. Keep the previous environment warm until you are confident the new release is stable.

Three cautions that usually catch people:

Pair that with moving between data centres when the goal is resilience rather than a code release.

Need a website built, fixed, optimised, migrated or replaced?

This technical resource is written by CSMBAC, a small design and development studio. If you would rather hand the problem to a professional, the website service page explains how we build enquiry-ready websites.

Explore website services