How to Upgrade Ubuntu Server to the Next LTS Release
How to upgrade an Ubuntu server to the next LTS release: backups, preparation, do-release-upgrade, SSH access, post-upgrade checks and a clean install.

Contents
Upgrading Ubuntu means moving your server's operating system to the next release. Ubuntu publishes a new LTS (long-term support) release every two years in April, and every LTS release gets free security updates for a set period. Moving to the next LTS release before that period ends is necessary to keep your server secure. With the right preparation, the upgrade usually goes smoothly; an unprepared upgrade can leave the server unable to boot.
This guide covers safely upgrading an Ubuntu server from one LTS release to the next, the checks to run after the upgrade and a clean install, which is the better option in some cases.
Find out your current release
After connecting to your server with SSH:
lsb_release -a
The Description line in the output, for example Ubuntu 22.04.5 LTS, shows the installed release. The first two digits of the version are the year and the next two are the month: 22.04 was released in April 2022.
Step 1: Take a backup
Don't skip this step. If the upgrade fails halfway or an application doesn't work with the new release, a backup is the only safe way back:
- Your provider's server backup: Make sure there's an up-to-date server backup right before the upgrade.
- A separate backup of your data: Back up database dumps, website files and the settings under
/etcseparately.
We cover backup methods in our Server backups guide.
Step 2: Fully update the current system
Before the upgrade, install all updates for the current release and reboot the server:
sudo apt update
sudo apt full-upgrade
sudo apt autoremove
sudo reboot
Once the server is back up, check that everything is working. Having a healthy system before you start means that if something breaks, you know the upgrade is the cause.
Step 3: Preparation checks
- Disk space: The upgrade needs a few GB of free space. Check with
df -h. - Third-party repositories: Note the external repositories you added for Docker, PHP or databases. The upgrade tool disables these repositories; after the upgrade, you need to enable them again for the new release.
- Application compatibility: The new release usually comes with new versions of PHP, Python, Node.js and databases. Make sure your applications work with these versions.
- Access: Check that you can reach your provider's web console; if the SSH connection drops, that's how you get to the server.
Step 4: Start the upgrade
Make sure the upgrade tool only offers LTS releases; the /etc/update-manager/release-upgrades file should contain this line:
Prompt=lts
Start the upgrade in a tmux session to protect it against dropped connections:
tmux new -s upgrade
sudo do-release-upgrade
The tool calculates the packages to upgrade and asks for your confirmation. When it runs over SSH, it also tells you it will start a second SSH service on an extra port as a fallback. If your firewall blocks that port and your main connection drops, you may need to open the port temporarily to use this fallback connection.
Questions you may be asked during the upgrade:
- Modified configuration files: When a new version arrives of a configuration file you edited before (for example
sshd_config), you're asked which one you want to use. If you're not sure what you're doing, keep the currently installed version is the safest choice. - Restarting services: While some libraries are updated, you're asked to allow services to be restarted.
- Removing obsolete packages: At the end of the upgrade, you're offered the option to remove packages that are no longer used.
When it's done, the tool asks you to reboot the server.
Step 5: Post-upgrade checks
Once the server is back up:
lsb_release -a
systemctl --failed
lsb_release -ashould show the new release.systemctl --failedlists services that failed to start; the list should be empty.
Then check the following:
- Websites and applications: Open the pages and look at the applications' logs.
- PHP version: If the PHP version changed with the new Ubuntu release, update the PHP-FPM socket path in your Nginx configuration (for example
php8.1-fpm.sock→php8.3-fpm.sock) and install the PHP extensions you need for the new version. The details are in our How to change the PHP version guide. - Third-party repositories: Enable the disabled repositories again with the new release's name and run
sudo apt update. - Firewall and SSH: Check that your settings were kept and that you can open a new SSH connection.
Finally, clean up packages you no longer need:
sudo apt autoremove
Alternative: a clean install and migration
Instead of an in-place upgrade, setting up a clean server with the new release and moving everything over is also a strong option:
- Old settings and packages that have piled up over the years are left behind.
- Because the old server keeps running, there's no downtime during the switch; when the new server is ready, you bring it into service by changing the DNS.
- If something goes wrong, it's easy to go back to the old server.
This method is safer especially for complex, long-running servers. We cover the steps for moving a website to a new server in our How to migrate a website guide. If your application runs with Docker, the move is much simpler; the details are in our How to install Docker guide.
A note for Debian
On Debian, you upgrade by replacing the release name in the repository addresses with the new one and running apt full-upgrade. Debian only supports upgrading to the next major release at a time; don't skip a release, and before upgrading, read the upgrade instructions Debian publishes in the release notes for the new release.
Ubuntu on Nodesty
On Nodesty AMD Ryzen 9 9950X VPS and AMD EPYC 7763 VPS plans, you can choose between different releases of Ubuntu, Debian and AlmaLinux when you order. Your free daily backups kept for 7 days give you a safety net before the upgrade, and if your SSH connection drops, you can reach your server through the web console. If you prefer a clean install, you can reinstall your server with a new release from the panel; reinstalling deletes the data on the disk, so take a backup first.
Frequently Asked Questions
Do I have to upgrade my Ubuntu release?
Every Ubuntu LTS release gets free security updates for a set period. You need to move to the next LTS release before that period ends; otherwise, vulnerabilities on your server won't be patched. Staying on a release whose support has ended is a serious risk, especially for servers exposed to the internet.
Can I upgrade directly from one LTS to the next?
Yes. LTS releases can be upgraded directly to the next LTS release; you don't need to go through the interim releases in between. do-release-upgrade usually offers the LTS-to-LTS upgrade after the new release's first point release is out, to wait for the bugs found in the first months to be fixed.
What happens if my SSH connection drops during the upgrade?
When the upgrade tool runs over SSH, it starts an extra SSH service as a fallback so you can reconnect if the connection drops. Still, the safest approach is to run the upgrade in a session such as tmux or screen and make sure you have access to your provider's web console.
How long does the upgrade take?
Depending on the number of installed packages and the speed of the server, it usually takes between 20 minutes and an hour. During part of that time services are restarted, and the server needs a reboot at the end, so plan the upgrade for the hour with the least traffic.
My website stopped working after the upgrade. Why?
New Ubuntu releases usually come with new versions of PHP, Python and databases. A web server configuration tied to the old PHP version, or an application that isn't compatible with the new version, may stop working. Check the web server's error logs and the status of your services; if the PHP version changed, update the PHP-FPM socket path in your Nginx configuration.
Is it better to set up a new server instead of upgrading?
Often, yes. Setting up a clean server with the new release and moving your applications and data over leaves behind old settings that have piled up over the years, and because the old server keeps running, the switch happens without downtime. An in-place upgrade is faster and works well on simple servers.
About the author
Nodesty Team · Infrastructure & Support
The Nodesty team runs our servers, network and DDoS protection day to day and answers customer support requests around the clock. These guides come from that work.
Related articles

What Is a Load Balancer and How Does It Work?
What is a load balancer and what does it do? Balancing methods, health checks, session handling, load balancing with Nginx, HAProxy and when you need one.

How to Deploy a Laravel App to a VPS
How to deploy Laravel to a server: PHP-FPM, Composer, .env, the database, file permissions, Nginx, queue workers, the scheduler, SSL and shipping updates.

How to Install PostgreSQL: Linux Server Guide
How to install PostgreSQL on a Linux server: creating roles and databases, access with pg_hba.conf, remote connections, pg_dump backups and tuning.