Rollback switches Docker Compose back to a previously built app/nginx image tag.
This is a fast application rollback. It does not roll back the database schema or content. If a release ran destructive migrations or changed data in an incompatible way, restore PostgreSQL from backup or ship a forward fix.
Use rollback when:
- a deploy completed but the new application image is broken
- the previous image is still present on the server
- the database is compatible with the previous code
Do not use app-only rollback as the only recovery path for database problems. See Backup And Restore.
On the server:
cd /opt/october/app
docker images october-app --format 'table {{.Repository}}\t{{.Tag}}\t{{.CreatedSince}}'
docker images october-nginx --format 'table {{.Repository}}\t{{.Tag}}\t{{.CreatedSince}}'For this kit, tags are normally short git commits, for example:
add172f
4eb1738
Use the previous known-good tag:
cd /opt/october/app
USE_LOCAL_DB=1 ./scripts/rollback.sh 4eb1738The script:
- checks that
october-app:<tag>andoctober-nginx:<tag>exist locally - updates
IMAGE_TAGin.env - runs
docker compose up -d --remove-orphans - waits for
php-fpmandnginx - prints
docker compose ps
If the deployment uses registry images instead of server-built local images, allow Compose to pull:
DEPLOY_PULL=1 ./scripts/rollback.sh 2026-05-31-001After rollback:
grep '^IMAGE_TAG=' .env
docker compose -f docker-compose.prod.yml ps
curl -fsS -o /dev/null -w 'site_http=%{http_code}\n' http://127.0.0.1:8080/
curl -fsS -o /dev/null -w 'health_http=%{http_code}\n' http://127.0.0.1:8080/nginx-healthExpected:
site_http=200
health_http=200
Roll forward by switching back to the newer tag:
USE_LOCAL_DB=1 ./scripts/rollback.sh add172fThe Bitbucket and GitLab deploy jobs build and deploy the latest branch commit. For emergency rollback, run scripts/rollback.sh directly on the server. A later revert commit is still useful for source control, but it creates a new image and is not as fast as switching to an existing known-good tag.
- Rollback requires the target app and nginx images to exist locally unless
DEPLOY_PULL=1. - Rollback does not run
october:migrate. - Rollback does not revert database migrations.
- Rollback does not restore
storage-app. - If a bad release changed data, use tested backups.