Ubuntu 20.04 LTS reached the end of its standard support in May 2025. It now gets security updates only through Ubuntu Pro, so a server still on 20.04 should move to a newer LTS release. This guide upgrades an Ubuntu 20.04 server to 22.04 LTS over SSH with do-release-upgrade, the tool Ubuntu recommends for servers. Then it takes the same server on to 24.04 LTS and 26.04 LTS, one release at a time.
Which release to upgrade to
An LTS server upgrades to the next LTS release, and you can't skip one: a 20.04 server goes to 22.04, then 24.04, then 26.04. Upgrades from one LTS release to the next open after the new release's first point release, such as 22.04.1. Ubuntu's release pages give these dates:
- Ubuntu 20.04 LTS (Focal Fossa): standard support ended in May 2025. Expanded Security Maintenance through Ubuntu Pro continues until 2030.
- Ubuntu 22.04 LTS (Jammy Jellyfish): standard support until 2027.
- Ubuntu 24.04 LTS (Noble Numbat): standard support until 2029.
- Ubuntu 26.04 LTS (Resolute Raccoon): released in April 2026, with standard support until May 2031.
Ubuntu Pro is free for personal use on up to five machines. Its Expanded Security Maintenance keeps critical and high security fixes coming for 20.04 while you plan, but only an upgrade brings back standard support and current software.
If the server runs only a few services, setting up a new server on 24.04 or 26.04 and moving your data across can be simpler than three upgrades in a row.
Before you start
Back up your data
A release upgrade installs hundreds of new packages, and no command undoes it. Ubuntu's documentation calls a backup "extremely important". Copy your data, databases and configuration files, such as /etc, to another machine, and make sure you can restore them.
We take no responsibility for any data loss.
On a LyraHosting Linux VPS, daily snapshots are available as an optional add-on. A snapshot is a good extra, but keep a copy of your data off the server too.
Know your way back in
If the upgrade or the restart goes wrong, SSH may not come back. Before you start, make sure you can reach the server another way. On a LyraHosting Linux VPS, the control panel can reboot the server, reset the root password and boot the rescue system, and its VNC or serial console works when SSH doesn't. Every LyraHosting dedicated server includes IPMI, which works even when the operating system doesn't respond.
One more check, for a container VPS such as OpenVZ: the server runs on the host's kernel, not its own, so check with your provider that the new release works on it. Our storage VPS runs on OpenVZ: open a ticket before you upgrade one.
Check the upgrade settings
cat /etc/update-manager/release-upgrades On an LTS server, the Prompt line should read Prompt=lts, so the upgrader offers the next LTS release. Prompt=never turns release upgrades off, and Prompt=normal offers the next supported release of any kind. To change it, edit the file with sudo nano /etc/update-manager/release-upgrades.
The do-release-upgrade command comes with the ubuntu-release-upgrader-core package. If it's missing, install it:
sudo apt install ubuntu-release-upgrader-core List your third-party repositories
The upgrader turns off third-party repositories and PPAs while it runs. Software you installed from them stays installed, but Ubuntu calls these repositories the most common cause of upgrade problems. See which ones you have:
ls /etc/apt/sources.list.d/ Also look in /etc/apt/sources.list for lines that don't point to Ubuntu's archive. Note each repository, and check that it publishes packages for the release you're upgrading to, so you can turn it back on afterwards.
Check the free disk space
df -h The upgrade downloads hundreds of packages, which can come to several gigabytes. Make room on / first, and on /boot if it's a separate partition.
Install every update for 20.04, then restart if needed
The upgrade needs a fully updated system, including phased updates, which Ubuntu rolls out gradually and which can otherwise block it. These are the commands Ubuntu's documentation uses:
sudo apt update
sudo apt dist-upgrade -o APT::Get::Always-Include-Phased-Updates=true Then check whether the server needs a restart:
ls /run/reboot-required If the file exists, restart with sudo reboot and log in again before you go on.
Upgrade from Ubuntu 20.04 to 22.04
Keep the SSH session safe
- screen:
do-release-upgraderuns itself inside GNU screen when screen is installed, so the upgrade carries on if your connection drops. Make sure it's installed withsudo apt install screen. If you're disconnected, log in again and reattach withsudo screen -d -r ubuntu-release-upgrade-screen-window. - The spare SSH port: when it runs over SSH, the upgrader starts a second SSH server on port 1022, so you have another way in if the main one fails during the upgrade. It doesn't open that port in your firewall. If ufw is on, open the port before you start with
sudo ufw allow 1022/tcp, and usessh -p 1022 youruser@your-serverif you need it. - SSH keys: OpenSSH in 22.04 turns off the old ssh-rsa signature type, which uses SHA-1. Current SSH clients sign with SHA-2 and keep working with the same RSA key, but a very old client may not. Ubuntu's release notes advise checking this before you upgrade over SSH, so you keep access afterwards.
- Your own connection: keep your terminal open and your computer awake until the upgrade asks to restart.
Start the upgrade
sudo do-release-upgrade The upgrade is interactive and can take a while, so stay with it and read each question before you answer:
- "Continue running under SSH?" Answer
y. The upgrader then tells you about the spare SSH server on port 1022; press Enter. - The summary. The upgrader turns off third-party sources, works out the changes and shows how many packages it will remove, install and upgrade, and how much it will download. Answer
yto start. Once the download has finished, the upgrade can't be canceled. - Configuration files. If you changed a configuration file that the new package also changes, it asks which version to keep. The default keeps yours. Compare the two first: for
/etc/ssh/sshd_config, keeping your version keeps your SSH settings. - Obsolete packages. Near the end, it offers to remove packages that are no longer needed. Look through the list before you answer
y. - Restart. When it reports that the system upgrade is complete, it asks to restart. Answer
y: Ubuntu doesn't count the system as upgraded until it restarts.
Some packages may ask questions of their own along the way.
After the restart
Give the server a few minutes, then log in over SSH as usual. If it doesn't answer, use the way back in you checked before you started.
Check the release, and look for services that failed to start:
lsb_release -a
systemctl --failed lsb_release -a should now show Ubuntu 22.04 LTS. Then:
- check that your websites, databases and other services work;
- turn your third-party repositories back on where they publish packages for 22.04, whose codename is
jammy(20.04 isfocal), and runsudo apt update; - if you opened port 1022 in ufw, close it again with
sudo ufw delete allow 1022/tcp; - open a second SSH session to make sure you can still log in before you close the first.
Continue to Ubuntu 24.04 LTS
Standard support for Ubuntu 22.04 ends in 2027, so keep going. On 22.04, repeat the steps above: back up, check your repositories, install every update, restart if needed, and run sudo do-release-upgrade again. The codename of 24.04 is noble.
What changes for a server, from the 24.04 release notes:
- Ubuntu's own package sources move from
/etc/apt/sources.listto/etc/apt/sources.list.d/ubuntu.sources, in the newer deb822 format. - The SSH server starts through systemd socket activation (
ssh.socket). Its settings in/etc/ssh/sshd_configand/etc/ssh/sshd_config.d/still apply. - Among the known issues, the upgrade can remove freeradius by mistake, so read the summary before you answer
y. On cloud images, GRUB may ask which disk to boot from; that question is expected.
Continue to Ubuntu 26.04 LTS
Upgrades from 24.04 to 26.04 LTS opened on September 29, 2026, about a month after the 26.04.1 point release. On 24.04, repeat the same steps and run sudo do-release-upgrade. Read the 26.04 release notes first. For a server, these changes stand out:
- OpenSSH 10.2 drops support for DSA keys. If you still log in with a DSA key, add an Ed25519 or RSA key and test it before you upgrade, or you lose access.
- sudo is now provided by sudo-rs, a new implementation, and the original sudo is renamed
sudo.ws. If one of your sudo rules stops working after the upgrade, Ubuntu Server's documentation explains how to choose the default sudo provider and how the two differ. - MySQL 8.4 locks out accounts that use
mysql_native_passwordby default, unless you change their authentication method or enable the plugin. - Python and the kernel move to 3.14 and 7.0, so check the applications that depend on them.
If something goes wrong
- Your connection dropped: log in again, on port 1022 if the main SSH server doesn't answer, and reattach with
sudo screen -d -r ubuntu-release-upgrade-screen-window. Don't start a second upgrade alongside the first. - The upgrade stopped with an error: the upgrader writes its logs to
/var/log/dist-upgrade/, starting withmain.log. - The server doesn't come back after the restart: use the rescue system in the control panel of a LyraHosting Linux VPS, or IPMI on a dedicated server, and open a support ticket. Our technical support answers tickets 24/7/365, with a first reply within 1 hour.
- Going back to 20.04: there's no command that downgrades a release. The way back is your backup or snapshot.



