To install Debian 13 (Trixie) on a VPS, the most reliable method is to install the current stable version (Debian 12 Bookworm) and perform a distribution upgrade to the testing branch. Because most VPS providers do not offer Trixie as a default one-click image yet, this manual upgrade path ensures you maintain your configuration while moving to the newer version. This process involves updating your package sources to point to the Trixie repositories and executing a full system upgrade via the command line.
What You'll Need
- A VPS with a clean installation of Debian 12 Bookworm.
- Root access or a user account with full sudo privileges.
- An SSH client (such as OpenSSH, PuTTY, or Termius) to connect to your server.
- A full backup or snapshot of your VPS (essential before any distribution upgrade).
- A stable internet connection to prevent SSH timeouts during the upgrade process.
Step-by-Step
- Create a VPS Snapshot: Before starting, go to your VPS control panel and create a snapshot or full backup. Distribution upgrades modify core system libraries and the kernel; if a power failure or network interruption occurs mid-process, the system may become unbootable. A snapshot allows you to revert to a working state in seconds.
- Update Current System: Connect to your server via SSH and ensure your current Debian 12 installation is completely up to date. Run the following commands:
sudo apt updatesudo apt upgrade -ysudo apt full-upgrade -ysudo apt autoremove -y
This ensures there are no pending dependency conflicts before you change the repository targets. - Back Up Sources List: It is a best practice to back up your current package source files. Use the copy command to create a duplicate of the main sources list:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
If you have files in/etc/apt/sources.list.d/, back those up as well. - Modify Repositories to Trixie: You must now tell the system to look for Debian 13 packages instead of Debian 12. Open the sources file with a text editor (labels and paths may differ slightly depending on your specific VPS image, but
/etc/apt/sources.listis the standard):sudo nano /etc/apt/sources.list
Find every instance of the wordbookwormand replace it withtrixie. Your file should now contain lines similar to:deb http://deb.debian.org/debian/ trixie main contrib non-free non-free-firmwaredeb http://security.debian.org/debian-security trixie-security main contrib non-free non-free-firmwaredeb http://deb.debian.org/debian/ trixie-updates main contrib non-free non-free-firmware
Save the file (Ctrl+O, Enter) and exit (Ctrl+X). - Update Package Index: Refresh the local package database to pull the metadata for Debian 13:
sudo apt update
At this stage, the system will recognize that a new version of the distribution is available. - Perform the Minimal System Upgrade: To avoid conflicts, it is safer to perform the upgrade in two stages. First, perform a minimal upgrade which upgrades packages that can be updated without requiring other packages to be removed or installed:
sudo apt upgrade --without-new-pkgs
If prompted about restarting services or updating the grub bootloader, generally select "Yes" or the default option. - Perform the Full Distribution Upgrade: Now, execute the full upgrade to transition the entire system to Debian 13:
sudo apt full-upgrade
This command is more aggressive than a standard upgrade; it will install new dependencies and remove obsolete packages to complete the transition to Trixie. - Verify the Installation: Once the process completes, check the version of the operating system to confirm the upgrade was successful:
cat /etc/debian_version
The output should indicate a version starting with 13 or specifically mention trixie. - Reboot the VPS: A reboot is necessary to load the new kernel and ensure all system services are running on the updated libraries:
sudo reboot
Wait a few minutes and reconnect via SSH.
Common Mistakes
One of the most frequent errors is skipping the apt update step after changing the sources list. If you attempt to run full-upgrade without updating the index, the system will continue trying to install Bookworm packages, leading to a "Package not found" error or a mixed-version system that is unstable. Another common mistake is using apt upgrade instead of apt full-upgrade for the final step. A standard upgrade will not remove conflicting packages, which often results in a partially upgraded system where the kernel is updated but critical system libraries remain on the old version.
Many users also forget to check their /etc/apt/sources.list.d/ directory. If you have installed third-party software (like Docker, Nginx, or Node.js) that uses separate list files, those files still point to bookworm. This can cause dependency hell during the upgrade. You must manually edit every .list file in that directory to replace bookworm with trixie, or comment them out entirely until the base OS upgrade is finished.
Tips
To prevent the SSH connection from dropping during a long upgrade—which could leave the package manager in a locked state—use a terminal multiplexer like screen or tmux. By running tmux before starting the upgrade, you can detach from the session and reattach later if your local internet connection flickers. If the connection drops without a multiplexer, the apt process may be killed, requiring a manual dpkg --configure -a to fix the broken installation.
When prompted during the upgrade about "Configuration file changes," you will often see a message asking if you want to keep your current version of a config file or install the package maintainer's version. In most cases, if you have customized that file, choose N (keep current). If you have never touched the file, choosing Y (install maintainer's version) is usually better as it includes updated defaults and security settings for Debian 13.
Troubleshooting
If the system fails to boot after the reboot, use your VPS provider's "Web Console" or "VNC Console." This allows you to see the boot sequence and enter a rescue mode if the GRUB bootloader is corrupted. If you see a kernel panic, check if the VPS provider requires a specific kernel (some providers use a custom kernel instead of the standard Debian one). In such cases, you may need to disable the kernel update in the sources list or contact support to update the boot image.
If you encounter a "dpkg was interrupted" error, run the following command to repair the package database:
sudo dpkg --configure -a
After this, run sudo apt install -f to fix any broken dependencies, then resume the full-upgrade. If the system is stuck in a loop of dependency errors, check your sources.list again to ensure there are no typos (e.g., writing "trixie-security" instead of the correct path) and that you haven't mixed repositories from different Debian versions.
Frequently Asked Questions
Is Debian 13 Trixie stable for production?
No. Trixie is currently the "Testing" branch. While it is generally reliable for development and enthusiasts, it does not receive the same level of rigorous stability testing as the "Stable" branch (Bookworm). Use it for production only if you specifically need newer packages and can tolerate occasional bugs.
Can I downgrade back to Debian 12?
There is no official supported path to downgrade a Debian installation. The only way to return to Debian 12 is to restore the snapshot you created before the upgrade or perform a fresh installation of Debian 12.
Will my installed apps still work after the upgrade?
Most standard applications will work, but software that relies on specific library versions (like certain Python or PHP extensions) may need to be reinstalled or updated to match the new Trixie libraries.
Do I need to change my SSH keys?
No, the distribution upgrade does not affect your SSH keys, user accounts, or home directory data. Your login credentials and keys will remain exactly as they were on Debian 12.
How long does the upgrade usually take?
Depending on the speed of your VPS disk (SSD vs HDD) and the number of packages installed, the process typically takes between 15 and 45 minutes.
Why is my VPS using a different kernel than the one I installed?
Some VPS providers use a "Virtualization Kernel" managed by the host. If your uname -r command shows a kernel that doesn't look like a standard Debian kernel, your provider is likely managing the kernel externally, and you cannot change it via apt.