Upgrade & Recovery procedures
Upgrade procedure
Pin the Stalwart image to a tested version:
image: stalwartlabs/stalwart:v0.16
Do not use latest for an important production server.
Before upgrading:
Read the release notes.
Review migration instructions.
Run an offsite backup.
Verify the backup exists.
Record the current working image tag.
Change the image tag.
Redeploy.
Inspect startup logs.
Test the administration UI.
Test port 465.
Test port 993.
Test incoming delivery.
Test outgoing delivery.
Keep the old image tag available for rollback.
Never delete the persistent volumes during a normal update.
Disaster-recovery procedure
If the VPS is lost, recreate the server as follows.
Recovery from volume backups
Provision a replacement VPS.
Install Dokploy.
Recreate the Stalwart Compose application.
Restore
stalwart_config.Restore
stalwart_data.Restore or recreate certificate extraction.
Point
mail.example.comto the replacement VPS.Change the replacement VPS PTR to
mail.example.com.Verify ports 25, 465, 587, and 993.
Verify the SMTP greeting.
Test incoming mail.
Test outgoing mail.
Verify SPF, DKIM, and DMARC.
If the original Stalwart data is not restored, Stalwart may generate different DKIM keys. The public DKIM DNS records must then be replaced.
Recovery with external PostgreSQL and S3
When structured data and blobs are external, a replacement VPS becomes easier to provision.
The replacement requires:
Stalwart configuration
Database credentials
Object-storage credentials
DNS records
PTR record
TLS certificate integration
The VPS becomes closer to disposable compute, but the external database and storage still require independent backups.