Linux VPS

Upgrade Ubuntu to a new LTS release on your VPS

Safely upgrade an Ubuntu VPS to the next LTS release with do-release-upgrade: back up, patch fully, run the upgrade in a safe session and verify afterwards.

IntermediateUbuntu VPS2 min read

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

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 -a

Fully update the current release

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

Run the upgrade in a safe session

Use screen or tmux so the upgrade survives a dropped connection:

sudo apt install screen
screen -S upgrade
sudo do-release-upgrade

When 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-upgrade and reboot.
  • Not enough free disk space: clean up with free up disk space.
  • A service fails after upgrade: read its logs with journalctl.

Next steps

Was this guide helpful?

Still stuck?

Ask MdmHost AI for a quick answer, or open a ticket and our team will take a look. We are here 24/7.