|
| 1 | +--- |
| 2 | +title: "Quick Guide: Upgrading Debian 12 to Debian 13 for mailcow Servers" |
| 3 | +date: 2025-08-19 |
| 4 | +draft: false |
| 5 | +tags: ["Debian", "Upgrade", "mailcow", "Exim", "Postfix"] |
| 6 | +categories: ["Guides"] |
| 7 | +author: The Infrastructure Company GmbH |
| 8 | +toc: true |
| 9 | + |
| 10 | +featuredImage: "/images/2025/August/guide_debian_upgrade12-13.webp" |
| 11 | + |
| 12 | + |
| 13 | +license: "" |
| 14 | +--- |
| 15 | + |
| 16 | +**Moohoo, dear community!** |
| 17 | + |
| 18 | +With the release of **Debian 13 (Trixie)**, the question arises for you as administrators: *How can you perform a smooth dist-upgrade from Debian 12 (Bookworm) – especially on systems running mailcow?* |
| 19 | +A commonly overlooked pitfall: **Exim**. |
| 20 | + |
| 21 | +<!--more--> |
| 22 | + |
| 23 | +## Important Notes Before the Upgrade |
| 24 | +Debian 13 installs the **Exim4 Mail Transfer Agent** by default. |
| 25 | + |
| 26 | +This applies to both fresh installations and upgrades if Exim is included in dependencies or "default packages." |
| 27 | + |
| 28 | +As you know, mailcow uses Postfix, which by default (and according to RFC standards, unchangeable) listens on port 25. |
| 29 | + |
| 30 | +The problem: **Exim on the host also occupies port 25**. |
| 31 | + |
| 32 | +As a result, the postfix-mailcow container cannot start properly and cannot send or receive emails. |
| 33 | + |
| 34 | +## Performing the Upgrade |
| 35 | + |
| 36 | +{{< admonition success >}} |
| 37 | +A good system administrator always creates a backup before upgrading. :) |
| 38 | +{{< /admonition >}} |
| 39 | + |
| 40 | +The dist-upgrade is performed as usual: |
| 41 | + |
| 42 | +```bash |
| 43 | +sed -i 's/bookworm/trixie/g' /etc/apt/sources.list |
| 44 | +apt update |
| 45 | +apt upgrade |
| 46 | +apt full-upgrade |
| 47 | +``` |
| 48 | + |
| 49 | +{{< admonition danger >}} |
| 50 | +**Warning**: Also check external APT sources, such as Docker. The above SED command only changes the base OS sources! |
| 51 | +{{< /admonition >}} |
| 52 | + |
| 53 | +A subsequent reboot (`reboot`) is required to ensure all services run with the new versions. |
| 54 | + |
| 55 | +## Removing Exim After the Reboot (If Present) |
| 56 | +After the reboot, Exim might be installed and occupying port 25 on the host. |
| 57 | +Check this with: |
| 58 | + |
| 59 | +```bash |
| 60 | +ss -tulpn | grep :25 |
| 61 | +``` |
| 62 | + |
| 63 | +If Exim is listed, please execute the following: |
| 64 | + |
| 65 | +```bash |
| 66 | +# Uninstall Exim |
| 67 | +apt purge exim4 exim4-base exim4-config exim4-daemon-light |
| 68 | +``` |
| 69 | + |
| 70 | +Optionally, you can remove any remaining configuration files: |
| 71 | + |
| 72 | +```bash |
| 73 | +apt autoremove --purge |
| 74 | +``` |
| 75 | + |
| 76 | +Verify again with: |
| 77 | + |
| 78 | +```bash |
| 79 | +ss -tulpn | grep :25 |
| 80 | +``` |
| 81 | + |
| 82 | +...to confirm that Exim is no longer listening on port 25. |
| 83 | + |
| 84 | +## Conclusion |
| 85 | +When upgrading from **Debian 12 to Debian 13**, special care must be taken on mailcow systems, particularly regarding the **Exim mail server**, which is installed by default. |
| 86 | +Since Postfix in a modern mailcow installation runs exclusively in the container via Docker, Exim on the host is not only unnecessary but also blocks port 25. |
| 87 | +By uninstalling Exim in a timely manner, nothing stands in the way of smooth mailcow operation on Debian 13 (Trixie). |
| 88 | + |
| 89 | +--- |
| 90 | + |
| 91 | +Until then... |
| 92 | + |
| 93 | +Stay healthy and happy mailing! |
| 94 | + |
| 95 | +**Your mailcow Team** |
0 commit comments