Each Ubuntu LTS release gets standard security updates for five years. Before yours reaches end of life, upgrade in place with do-release-upgrade, which moves one LTS at a time (for example 22.04 to 24.04). Done carefully, it keeps your data and configuration.
Before you start
- A full backup or VPS snapshot you have tested (see back up a Linux VPS).
- At least 5 GB free on
/(check with df -h). - A maintenance window and access to your VPS console in case SSH drops.
- Check support dates in Linux release support lifecycle.
Warning: Control panels have their own support rules. Do not release-upgrade a server running cPanel, Plesk or another panel unless the vendor documents that path; migrate to a fresh server instead.
Check your current version
lsb_release -aFully update the current release
sudo apt update
sudo apt full-upgrade -y
sudo apt autoremove -y
sudo rebootRun the upgrade in a safe session
Use screen or tmux so the upgrade survives a dropped connection:
sudo apt install screen
screen -S upgradesudo do-release-upgradeWhen run over SSH, the tool opens a backup SSH daemon on port 1022. If a firewall blocks it, that is fine as long as you have console access. Answer the prompts:
- Modified configuration files: if you changed a file (for example
sshd_config), keep your version (N) unless you know the new default is needed. - Remove obsolete packages: review the list, then usually accept.
- Restart services / reboot: accept at the end.
If the connection drops, log in again and reattach with screen -r upgrade.
Note: A new LTS is offered to existing LTS systems only after its first point release (for example 24.04.1). Until then the tool reports no new release; that is expected.
Check after the reboot
lsb_release -a
systemctl --failed
sudo apt update && sudo apt upgrade- Visit your websites and test logins.
- Check PHP versions: a new release ships new PHP packages, so web server config may need updating (see multiple PHP versions on Ubuntu).
- Re-enable third-party repositories the upgrader disabled in
/etc/apt/sources.list.d/once they support the new release.
Troubleshooting
- Please install all available updates before upgrading: run
sudo apt full-upgradeand reboot. - Not enough free disk space: clean up with free up disk space.
- A service fails after upgrade: read its logs with journalctl.
