Upgrading your VPS to a new version of Debian or Ubuntu
Every version of Debian and Ubuntu gets security updates for a fixed period. After that it is end of life: your server keeps running, but vulnerabilities are no longer patched. Automatic updates won't take you to the next version. You do that yourself, with a release upgrade. Here's how to do it safely, from Debian 12 to 13 and from Ubuntu 24.04 to 26.04.
Do I need to upgrade yet?
You can see which version you have with cat /etc/os-release. As of November 2026:
| Version | Updates until |
|---|---|
| Debian 12 "bookworm" | Regular support ended on 11 July 2026, now only LTS updates until 30 June 2028 |
| Debian 13 "trixie" | Regular support until August 2028, LTS until 30 June 2030 |
| Ubuntu 24.04 LTS | Standard support until May 2029 |
| Ubuntu 26.04 LTS | Standard support until May 2031 |
Check the current dates at debian.org/releases and ubuntu.com/about/release-cycle, and put your server's end date in your calendar. Install a new server with Debian 13 or an Ubuntu LTS version. Never skip a version: going from Debian 11 to 13 goes through 12.
Upgrade or rebuild?
You can update the existing server (an in-place upgrade) or do a clean install with the new version and restore your data. For a small server with a few services, an in-place upgrade is fine. If it runs a lot of custom setup, or the server has already been upgraded several times, reinstalling is often just as quick, see Mounting your own ISO or reinstalling your VPS.
Preparation
- Take a snapshot right before you start, and make sure you have a recent backup stored off the server. See Snapshots and backups of your VPS and Backups with restic to another location.
- Test the console in the VPS screen and make sure you know the root password. If SSH breaks during the upgrade, you can still get in there. See The console: your VPS in your browser.
- Read the release notes, especially the section on issues to be aware of. For Debian 13, for example, they mention that
/etc/sysctl.confis no longer read (use/etc/sysctl.d/). - Review third-party package sources with
ls /etc/apt/sources.list.d/. Software that doesn't come from Debian or Ubuntu itself is the biggest source of problems. Check whether the vendor already has a version for the new release. - Work in tmux (
sudo apt install tmux, thentmux). If your connection drops, the upgrade keeps running and you can pick it up again withtmux attach. - Fully update the current version first:
sudo apt update && sudo apt full-upgrade, and reboot if needed.
Debian 12 to 13
Following the Debian 13 release notes, as root:
sed -i 's/bookworm/trixie/g' /etc/apt/sources.list.d/debian.sources apt update apt upgrade --without-new-pkgs apt full-upgrade reboot
If your sources are still in /etc/apt/sources.list, change the codename there instead. Temporarily disable third-party sources during the upgrade and re-enable them afterwards with the new codename, if the vendor provides one. If the upgrade asks whether you want to keep a configuration file you've modified (such as sshd_config), keep your own version if you know why you changed it, and compare it with the new version afterwards (the file ending in .dpkg-dist).
Ubuntu 24.04 to 26.04
sudo do-release-upgrade
Ubuntu only offers the upgrade from one LTS version to the next after the first point release, so from 26.04.1 onwards. That's deliberate: the biggest problems get fixed in the first few months. If you get a message saying there's no new version, just wait. If you run the upgrade over SSH, the program starts an extra SSH server on a backup port as a precaution. You usually won't need it, since you have the console.
After the upgrade
- Check the version with
cat /etc/os-release. systemctl --failedshould be empty, see Managing services with systemctl on your VPS.- Clean up old packages with
sudo apt autoremove. - Check that your websites, containers and monitoring still work.
- If everything works, delete the snapshot: it grows with every change.
On AlmaLinux and Rocky Linux, a major version (9, 10) gets about ten years of updates, and you update between minor versions with sudo dnf upgrade. For a jump to a new major version, many administrators choose to reinstall.
Want to learn more? Take the free course VPS and Linux server management, lesson 4.3 Lifecycle and release upgrades.
