• Home
  • Step-by-Step: Safe Mailcow Upgrade (via update.sh)

Step-by-Step: Safe Mailcow Upgrade (via update.sh)

by:admin July 21, 2025 0 Comments

🛡️ 1. Backup Before Anything

Before the digital hammer strikes, we shield ourselves.

cd /opt/mailcow-dockerized
./helper-scripts/backup_and_restore.sh backup all

This creates a backup of mail data, configs, and databases. Store it somewhere safe like /opt/backups/ or off-server if possible.


📡 2. Check Your Version (Optional but Wise)

cd /opt/mailcow-dockerized
git describe --tags

This tells you what version you’re on. Helps to confirm post-upgrade.


🌤️ 3. Pull the Latest Code

This brings in the latest Docker Compose and stack updates from Mailcow’s repository.

cd /opt/mailcow-dockerized
git pull

⛅ 4. Run the Update Script

This is the official way. It updates the containers safely.

./update.sh

This script will:

  • Pull latest Docker images
  • Apply any necessary config migrations
  • Restart the updated containers

Do not interrupt unless prompted.


⏳ 5. Wait Patiently

Let the containers restart, data migrate, and services stabilize.


🔍 6. Check Status

Once complete:

docker compose ps

Then check logs for any errors:

docker compose logs -f

🧪 7. Test Everything

Make sure:

  • Web UI loads
  • Mail send/receive works
  • DNS (SPF, DKIM, DMARC) are untouched
  • SOGo or Roundcube works (if enabled)
  • Fail2Ban and watchdog still work

✨ Bonus: Schedule Weekly Cron for Update (optional)

If you trust auto-updating:

0 3 * * 0 root /opt/mailcow-dockerized/update.sh >> /var/log/mailcow-update.log 2>&1

But tradition tells us—never update blindly. Check the changelog:
📜 https://mailcow.github.io/mailcow-dockerized-docs/ and look for breaking changes.

Next step is huddle while updating
example:
🌐 Should You Enable Native IPv6 in Docker for Mailcow?

🔹 Recommended (Yes) if:

  • Your host system has native IPv6 support (e.g., from your hosting provider or cloud VPS).
  • You want better mail delivery reputation for IPv6-only destinations (yes, some mail providers prefer it).
  • You are comfortable managing firewalls and DNS for IPv6 (AAAA records, etc.).

🔸 Not Recommended (No) if:

  • Your server does not have IPv6 enabled at the OS/network level.
  • You’re unsure if your provider offers native IPv6 or only gives IPv4.
  • You’re worried about Postfix, Dovecot, or docker0 interfaces getting messed up.
  • You are behind NAT or tunneling (like OpenVZ, or some low-end VPS).

🔍 How to Decide (Step-by-Step)

1. Check if IPv6 is enabled on the host:

ip a | grep inet6

2. Ping an external IPv6 site:

ping6 google.com

If it works, you likely have native IPv6.

3. Check Docker’s default bridge (optional):

docker network inspect bridge | grep IPv6

post install, mailcow would ask to delete the upgrade image

The following unused mailcow images were found:
ghcr.io/mailcow/dovecot:2.33 (e6288cd4acba)
ghcr.io/mailcow/acme:1.92 (12887bf82453)
Do you want to delete them to free up some space? [y/N]

🧹 Should You Delete These Images?

✅ Yes, if:

  • The upgrade is complete.
  • Mail is flowing, web UI is working, and no logs are throwing errors.
  • You want to free up disk space (these can take a few hundred MB each).

❌ No, if:

  • You’re unsure if the system is fully stable.
  • You may want to rollback to the older containers manually.

🪄 Recommended Action:

If you’re satisfied with the upgrade and no dragons have stirred:

y

Let it clean the attic.

But if you’re a cautious steward, reply:

N

And set a reminder to clean them later with:

docker image prune
# Or for all dangling images:
docker image prune -a


Categories:

Leave Comment