How to Upgrade Debian 11 to Debian 12 (Complete Step-by-Step Guide)

This guide upgrades a Debian 11 (Bullseye) VPS to Debian 12 (Bookworm) in place, without reinstalling. Debian 11 reached the end of its long-term support in August 2026, so a server still on it no longer receives security fixes and should be upgraded. Debian only supports upgrading one release at a time: go from 11 to 12 with this guide, confirm everything works, then continue to Debian 13 (Trixie) with the section at the end.

Before You Start

  • Take a backup you can restore. We do not hold backups of customer servers, so copy your data, databases and configuration off the server first — see How to Set Up Automated VPS Backups.
  • Check free disk space. Allow at least 2–3 GB free on /: df -h /.
  • Use a session that survives a dropped connection. Run the upgrade inside tmux or screen, so an SSH disconnect does not kill it half-way: sudo apt install tmux -y && tmux.
  • Note what you run. PHP, PostgreSQL and other major versions change between releases; check your applications support the new versions.

Step 1 — Fully Update Debian 11

sudo apt update
sudo apt full-upgrade -y
sudo apt autoremove -y

Reboot if a new kernel was installed, then confirm the version:

cat /etc/debian_version
cat /etc/os-release

Step 2 — Check for Held and Third-Party Packages

apt-mark showhold
ls /etc/apt/sources.list.d/

Release held packages with sudo apt-mark unhold PACKAGE. Third-party repositories (Docker, NodeSource, PHP builds, database vendors) should be switched to their Bookworm versions, or disabled for the upgrade and re-enabled afterwards.

Step 3 — Point APT at Bookworm

Back up the sources file, then replace the codename:

sudo cp /etc/apt/sources.list /root/sources.list.bullseye
sudo sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list
sudo sed -i 's/bullseye/bookworm/g' /etc/apt/sources.list.d/*.list 2>/dev/null

A typical Debian 12 /etc/apt/sources.list looks like this. Debian 12 added a separate non-free-firmware component; add it if you use non-free firmware.

deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware
deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware

Step 4 — Upgrade in Two Stages

Debian’s release notes recommend a minimal upgrade first, then the full one. It reduces the chance of APT removing something you need.

sudo apt update
sudo apt upgrade --without-new-pkgs
sudo apt full-upgrade

Read the prompts. When asked about a modified configuration file, the safe default is to keep your current version (usually N) and compare with the new one afterwards; the package’s version is saved alongside it as .dpkg-dist.

Step 5 — Reboot and Verify

sudo reboot
cat /etc/debian_version
uname -r
systemctl --failed

You should see 12.x. systemctl --failed should list nothing; any service it lists needs attention, typically because its configuration changed between versions.

Step 6 — Clean Up

sudo apt autoremove --purge
sudo apt autoclean

Then re-enable any third-party repositories with their Bookworm entries and run sudo apt update && sudo apt upgrade.

Next: Debian 12 to Debian 13

Once the server has run cleanly on Debian 12, repeat the same process with bookworm replaced by trixie. Debian 13 is the current stable release, security-supported to August 2028 and covered by LTS to June 2030. Two differences to know:

  • New installations of Debian 13 describe sources in the deb822 format, in /etc/apt/sources.list.d/debian.sources. An upgraded system keeps working with the classic sources.list; sudo apt modernize-sources converts it if you want the new format.
  • Run sudo apt upgrade --without-new-pkgs and then sudo apt full-upgrade, exactly as above.

Lifecycle dates for every distribution we offer are on the Debian VPS page.

Common Problems

“Repository does not have a Release file” — usually a third-party repository with no Bookworm build yet. Disable that file in /etc/apt/sources.list.d/ and run apt update again.

The upgrade stopped part-way — reconnect, reattach with tmux attach, or finish it manually:

sudo dpkg --configure -a
sudo apt --fix-broken install
sudo apt full-upgrade

A website returns errors after the upgrade — often the PHP version changed (7.4 on Debian 11, 8.2 on Debian 12). Install the matching PHP modules and point your web server at the new PHP-FPM socket.

PostgreSQL still runs the old version — Debian keeps the old cluster running. Upgrade the data deliberately with pg_upgradecluster once you have a backup.

Cannot connect after reboot — open a ticket and we will help you reach the server to investigate.

FAQ

Can I go straight from Debian 11 to 13?
No. Skipping a release is not supported and commonly breaks the package system. Go 11 → 12, then 12 → 13.

Will my files be deleted?
No. An in-place upgrade keeps your files, users and data. Have a backup anyway.

How long does it take?
Usually 10–30 minutes on a VPS, longer with many packages installed.

Would a fresh install be cleaner?
Sometimes. For a small, well-documented server, deploying a new VPS on Debian 13 and moving the data across avoids carrying old configuration forward, and lets you switch over only when the new server works.

Continue Reading

Browse more articles in Debian VPS Tutorials.

  • upgrade debian, debian bookworm, linux upgrade, apt full-upgrade, debian server, vps debian, debian 12 upgrade, upgrade debian 11 to 12, debian upgrade, debian bullseye, debian vps, debian tutorial, dist-upgrade debian, debian hosting, update debian
  • 38 Users Found This Useful
Was this answer helpful?

Related Articles

What Is Debian? Advantages, Disadvantages, and Debian vs Other Linux Distributions

Introduction Debian is one of the oldest, most stable, and most trusted Linux distributions...

Debian VPS vs Ubuntu VPS: Which One Should You Choose?

Introduction When ordering a VPS, one of the first decisions you'll make is choosing the...

Top 10 Reasons to Choose a Debian VPS for Your Server

Introduction Debian has earned a reputation as one of the most reliable Linux operating systems...

Top 10 Applications You Should Install on a Debian VPS

A fresh Debian VPS is deliberately minimal: a stable base system and not much else. These are the...

Debian vs AlmaLinux: Which Should You Choose for Your VPS?

Introduction Debian and AlmaLinux represent two different philosophies within the Linux server...