Introducing Render Sandboxes: a computer for every agent.

Learn more

How to rollback a broken deployment quickly

Roll back first, then earn the next rollback

Production is broken, and you need a working build serving traffic before you do anything else. Start with the one-click rollback. If the version you need is older than your retained builds, redeploy a specific commit instead.

If the broken deploy ran a database migration, read the migration section before you roll back. Rolling back code doesn't roll back your schema, and that's a common way a rollback makes an incident worse.

The rollback button helps only as much as your preparation allows. Its speed and safety depend on decisions you made before the incident: health-checked zero-downtime deploys, backward-compatible migrations, and a maintenance mode plan. This guide covers the immediate fix first, then those prerequisites.

Check how far back you can go

You need at least one previous successful deploy to return to. Instant rollbacks also depend on how many builds Render retains for your workspace plan, as shown below.

Plan
Builds retained for instant rollbacks
Free web services
Two most recent previous deploys
Hobby
5
Pro
15
Scale
30
Enterprise
30

See Render pricing for plan details. If your target is older than your retention window, use a specific commit instead.

Documentation checked: Render between 2026-09-11 and 2026-11-20.

Get back to a working build

Use one-click rollback as your first move

  1. In the Render Dashboard, open your service's Deploys page.
  2. Find a recent successful deploy and click Rollback.
  3. On the confirmation page, click Rollback to this deploy.

Render then starts a new deploy that uses the target deploy's build artifact. Because Render reuses build artifacts from recent deploys, a rollback completes much faster than building a new version of your service. To pick the right target quickly, check the Deploys page to see what's live. Deploy fast. Know what's live describes how that page tracks deploy status.

A dashboard rollback also disables automatic deploys, so a new push can't redeploy the broken change. After you fix the underlying issue, turn automatic deploys back on from your service's Settings page. A rollback through the Render API doesn't disable automatic deploys, so a push to the linked branch can bring the bad change back.

The Rollback button is a manual action, separate from the automatic protection that health checks provide. If a new deploy fails its health check, Render keeps the previous deploy running. The health checks docs cover that process. A deploy can pass health checks and still be broken, for example because of a logic bug. In that case, you need the manual rollback.

Before you click, confirm that the old code can run against your current database. A rollback redeploys a previous build artifact. Your database isn't part of that artifact, so the schema stays the way the bad deploy left it. If that deploy ran a migration that isn't backward-compatible, the old code can fail against the new schema. Read the migration section and maintenance mode before you continue.

Deploy a specific commit when the target is outside your retained builds

Use this method when:

  • The version you need is older than your retained rollback targets.
  • You want to deliberately redeploy a known-good commit.

On the Deploys page, open Manual Deploy, choose Deploy a specific commit, pick the commit or paste its SHA, then click Deploy Commit. You can also pass the SHA with the CLI --commit flag, with the commitId field in a Trigger Deploy API request, or with the ref query parameter on a deploy hook URL.

In almost every case, disable automatic deploys afterward. Automatic deploys always use the most recent commit on the linked branch, which replaces the commit you just deployed. Some methods handle this for you:

Method
Effect on automatic deploys
Dashboard
Disables auto-deploys
Deploy hook
Disables auto-deploys
CLI
Does not disable auto-deploys
API
Does not disable auto-deploys

One-click rollback is still faster because it reuses a retained build artifact. For full details, see Deploying a specific commit.

Script rollbacks without reintroducing the bad change

To roll back from scripts, call the Roll back deploy API endpoint. Then set autoDeployTrigger to off with the Update service endpoint so a later push doesn't redeploy the bad change. Treat both calls as one operation in your tooling. A script that only does the first half leaves you exposed to the next merge.

Why fast rollback is an architecture property

The button is fast and safe only when you already have three things in place:

  • Zero-downtime deploys gated by health checks.
  • Expand/contract migrations, so older code still works against the current schema.
  • A maintenance mode plan for the worst case.

Without health checks and backward-compatible migrations, the button can return you to a version that fails as soon as it receives traffic. Teams that ship many times a day depend on this groundwork. How Felt ships 15+ times a day on Render shows what that looks like in practice.

Let health checks block bad deploys automatically

When you deploy, Render doesn't route traffic to the new instances right away. It sends them health checks first. Render routes traffic to the new instances only when all of them pass at the same time. If that doesn't happen within 15 minutes, Render cancels the deploy and keeps routing traffic to your existing instances. A check passes if the instance returns a 2xx or 3xx status within five seconds.

In practice, this gives you three things:

  • Health checks catch deploys that fail outright, so you need manual rollbacks less often.
  • A rollback is itself a new deploy. It goes through the same gate, and the current version keeps serving until the rollback target is healthy.
  • During a deploy, traffic doesn't shift to new instances until they all pass their checks.

By default, Render only checks that your instance accepts TCP connections. That catches a service that never starts, not one that starts and can't serve requests. Set an HTTP health check path before the incident. Define an HTTP endpoint that returns 2xx when the service works normally. Make it exercise real dependencies, such as database connectivity, instead of returning a static 200 OK. A static response passes even when the service can't do any real work. For the mechanics, see health checks and zero-downtime deploys.

Make every migration backward-compatible

If a migration removed or renamed something the previous code depends on, a rollback brings back code that can't run. Expand/contract discipline, also called parallel change, prevents this.

  1. Expand: Add new schema elements alongside the old ones.
  2. Migrate code: Deploy code that works with both the old and new shapes.
  3. Contract: Remove the old elements in a later deploy, once you're sure you won't roll back past that point.

For example, to rename a column, add the new column, write to both, and switch reads to the new one. Drop the old column several deploys later.

The previous code then still understands the current schema, so you can roll back any recent deploy. The contract step sets how far back you can safely roll back. Don't run it until you no longer need to return to code that uses the old schema. For the full mechanics, see the zero-downtime migrations article.

Keep maintenance mode ready for the worst case

Maintenance mode is your last resort when rollback isn't safe or won't help. Use it when:

  • A destructive migration has already run.
  • Data integrity is at risk.
  • You need time to fix forward.

In maintenance mode, your web service keeps running but is unreachable from the public internet. Render responds to every incoming request with 503 Service Unavailable and your maintenance page. You can still reach the service over your private network and through SSH, so you can repair it while users are blocked. Maintenance mode is available only for paid web services.

To enable it:

  1. Open your web service's Settings page and scroll to the Maintenance Mode section.
  2. Toggle the switch and confirm.

Render enables maintenance mode immediately. To turn it off, toggle the switch back. You can also set the maintenanceMode field in your Blueprint, with an optional uri for a custom maintenance page. Prepare your custom page before you need it, not during an outage.

Operational guidance and pitfalls

Habits that keep rollbacks safe

  • Roll back first and debug second. Restoring service gives you time to investigate. Once you're stable, tools like Jules by Google Labs can help you debug a failed Render deploy.
  • Choose a plan whose build retention covers how far back you might need to go.
  • Put expand and contract steps in separate deploys.
  • Don't ship a migration and a destructive cleanup in the same deploy.
  • Don't treat a passing health check as proof that the deploy is correct.
  • Don't re-enable auto-deploys until the fix is on your linked branch.

Mistakes that turn a rollback into a second incident

  • Rolling back through the API and leaving auto-deploys on. The bad version comes back after the next push.
  • Deploying a specific commit with the CLI and assuming it sticks. The CLI doesn't disable auto-deploys, so the next commit on the branch replaces your pinned version.
  • Rolling back after a destructive migration. The old code can fail with schema errors as soon as it receives traffic.

Check your rollback readiness

  • You know where the Rollback button is on the Deploys page.
  • You know how to deploy a specific commit, and whether your method disables auto-deploys.
  • You've configured health checks that test real dependencies.
  • Every migration follows expand/contract.
  • You know how to turn on maintenance mode, and your service is on a paid plan that supports it.

After you recover

You determine your rollback speed before the incident. After you recover, add a dependency-aware health check, audit recent migrations for premature contract steps, and confirm maintenance mode is ready on your production web services.

Further reading

Frequently asked questions