Skip to content
For agents
Browse guides

Roll back app code

Return an app to an earlier version without touching its data.

Open Markdown

A rollback runs an earlier app image with today’s settings and data. Use it when a release breaks the app and you know the previous code can still work with the current database and files.

Roll back

With Can deploy on the app, open Deployments, select the earlier version you want and choose Roll back code. Confirm to start a new deployment from that image.

From the CLI, first list the app’s deployments:

Shell
smolcloud status APP_ID

Find the earlier version you want with rollback_available: true. Use its id as REVISION_ID:

Shell
smolcloud rollback APP_ID REVISION_ID

The CLI prints a new deployment ID and waits for the result. If you disconnect, run smolcloud resume APP_ID NEW_DEPLOYMENT_ID with that new ID. If another deployment is already in progress, wait for it to finish and check the app’s status again.

What happens

Smolcloud starts the retained image with the app’s current environment variables, port, health path, CPU and memory settings. Current permissions apply. Traffic switches once the earlier code passes its health check.

If the earlier version declared resources, the rollback waits for fresh approval. If the app now has a persistent disk, the rollback requests that disk even if the old code didn’t use it. Switching which version writes to an attached disk requires downtime confirmation. The running version stops writing before the new one takes over.

Check data compatibility

Database rows, migrations, bucket files and disk contents stay as they are. For example, if the latest migration removed a column the old code reads, rolling back the app would still leave that column missing. Deploy a compatible fix in that case. Recovering earlier data is a separate restore operation.

Which versions are kept

Smolcloud retains up to five successful images per app, including the serving version. Older deployments can still appear in history after their images have been removed. Check rollback_available before choosing one. If the image you need is unavailable, deploy its source again or deploy its image by digest from your registry.