How to Upgrade Ubuntu 24.04 to 26.04 VPS
Since 29 September 2026, do-release-upgrade for Ubuntu 24.04 VPS dey offer 26.04.1. See the safe upgrade order and services wey fit break.
When you fit upgrade Ubuntu 24.04 go 26.04?
You fit upgrade Ubuntu 24.04 go 26.04 for VPS now. Since 29 September 2026, when Canonical enable upgrades from 24.04 LTS, do-release-upgrade for 24.04 server dey offer 26.04.1. Ubuntu 26.04 LTS (Resolute Raccoon) release on 23 April 2026, but Canonical only dey open the LTS-to-LTS upgrade path after the first point release don come out, because that release gather the install and upgrade bugs wey dem find for the first months. This time, the wait pass the point release itself: 26.04.1 ship on 27 August 2026, and Canonical hold the upgrade for some more weeks because dem plan backports to fix regressions for recent version of rust-coreutils. If the numbering new to you, 26.04.1 no be different Ubuntu; na the same 26.04 with four months of fixes wey dem add to the media, and na exactly why Canonical go first offer am to existing server.
Before 29 September, if you run the check for 24.04 server, you go see this:
sudo do-release-upgradeChecking for a new Ubuntu release
No new release found.This no mean say server get fault. If you still dey see am today, check the setting wey e depend on. /etc/update-manager/release-upgrades get Prompt=lts for Ubuntu Server. This mean say the tool only dey offer the next long term support release, and only after Canonical don open the upgrade path to am. Leave am for lts anyway, because for later release normal go also offer the short-lived interim versions. While people dey wait, Canonical offer do-release-upgrade -d to anybody wey no wan wait; now wey the path don open, the plain command na the one wey Canonical announcement name for servers. Read wetin 26.04.1 change and when the upgrade path open before you start. Server wey still dey run 22.04 no fit make this jump directly, because the upgrader only ever offer the next LTS. So how to upgrade 22.04 go 26.04 through 24.04 cover the first step and the snapshot wey you need take before the second one.
Every command below na command wey you go run yourself for your own server, in the order wey dem give am. You no fit rehearse a release upgrade for the same machine wey you dey upgrade. E go replace the kernel and the C library, and e need reboot to finish.
Make you upgrade at all?
Ubuntu 24.04 go continue receive standard security updates reach 2029, so working production server no dey under any deadline. Upgrade because you need wetin 26.04 get: PHP 8.5, PostgreSQL 18, MySQL 8.4 LTS, OpenSSH 10.2 or the 7.0 kernel. “The number went up” no be reason to touch machine wey dey serve customers.
No upgrade in place when any of these things dey true:
- You never open your provider console (VNC or serial) and log in through am. That console na the only way to enter the box again if SSH spoil. If you discover say e no work when you don lock yourself out, e don too late.
- You no fit afford one hour downtime and you no get rollback.
- Your stack depend on third-party repository wey never publish for
resoluteyet. - Dem build the server by hand more than two years ago and nobody know wetin dey inside am.
The alternative often better: build fresh 26.04 VPS, install your stack and restore the data, then switch DNS once e answer correctly. You fit keep the old server running until the new one prove say e dey work, and rollback go be DNS change instead of restore. If you choose that way, start with the first ten minutes for new VPS and build the new box properly.
Step 1: backup wey you fit restore from
Use two layers, because dem dey fail for different ways. Provider snapshot dey cover the whole disk and fit restore within minutes, but e dey happen while your databases dey write, so na crash consistent e be instead of application consistent. File-level backup with restic, wey you store outside the server go give you single files and one copy wey go survive if dem lock your account.
Dump the databases by hand first. Dump na one way to back up database wey dey run.
sudo -u postgres pg_dumpall | sudo tee /var/backups/pg-all.sql > /dev/null
sudo mysqldump --all-databases --single-transaction --routines | sudo tee /var/backups/mysql-all.sql > /dev/null
sudo tar czf /var/backups/etc-before-upgrade.tgz -C / etc
sudo chmod 600 /var/backups/pg-all.sql /var/backups/mysql-all.sql--single-transaction go give consistent dump only for InnoDB tables. MyISAM tables need locks before dem fit get consistent dump. The /etc tarball na the one wey you go actually reach for, because e hold every config file wey the upgrade dey about to ask you questions about.
Backup wey you never restore before na guesswork. Pull one file from am now, before you need am when pressure dey.
Step 2: patch 24.04 finish well well first
do-release-upgrade no go run for system wey package state don spoil, and 24.04 wey patch never complete go make every later failure harder to understand.
sudo apt update
sudo apt full-upgrade
sudo apt --purge autoremove
sudo dpkg --audit
apt-mark showholdIf dpkg --audit no print anything, e mean say no package dey half configured. If apt-mark showhold no print anything, e mean say no package get dpkg hold. E no show APT preference pins. Na separate mechanism be that, and e fit also hold package back; Step 3 go check dem. Release anything wey showhold list with sudo apt-mark unhold and the package name, or accept say the hold get reason and stop here.
Reboot if kernel change, so you go upgrade from machine wey dey run the code wey e think say e dey run.
[ -f /var/run/reboot-required ] && sudo rebootThen check disk space. The upgrader go download the complete new package set before e install anything, and e go stop with message wey name the filesystem if space no reach.
df -h / /bootOld kernels na usually the cause, and sudo apt --purge autoremove go clear dem.
One more thing to stop before you start: if automatic security updates start during the run, dem go hold the dpkg lock, and release upgrader go stop with Could not get lock /var/lib/dpkg/lock-frontend. Run sudo systemctl stop unattended-upgrades first, then start am again when you don finish.
Step 3: check third-party repositories and pinned packages
By default, do-release-upgrade go comment out every apt source wey no be Ubuntu source, because package wey dem build for noble fit break resolute system. E --allow-third-party option keep dem enabled instead, and that one carry exactly that risk. Know wetin you dey carry before the tool decide for you.
ls /etc/apt/sources.list.d/
grep -rhE '^(deb |Types:|URIs:|Suites:)' /etc/apt/sources.list.d/
ubuntu-security-status --thirdparty
ls /etc/apt/preferences.d/Ubuntu 24.04 dey use two formats for that directory: the old one-line .list files, and deb822 .sources files wey get Types: and Suites: fields. Default upgrade dey disable both. ubuntu-security-status --thirdparty list the packages wey dey installed but no Ubuntu archive provide, so e show the real number of things wey you add by yourself. A file for /etc/apt/preferences.d/ go count as pin only if e name no get extension or e end with .pref, and e contain only letters, digits, hyphens, underscores, and periods; APT dey ignore any other file, usually with a notice. Pin wey name noble fit keep package for old version after upgrade, depending on the versions wey still dey available and the priority wey the pin set, so read every file and decide whether e still suppose dey there.
For every third-party repository, confirm say the vendor don publish am for the new codename before you start. Docker suites dey listed for https://download.docker.com/linux/ubuntu/dists/, and other vendors expose the same directory. Source wey point to suite wey no exist go show this for the first apt update after the upgrade:
E: The repository 'https://download.docker.com/linux/ubuntu resolute Release' does not have a Release file.Docker now dey publish a resolute suite. Leave any source wey get missing suite disabled until the vendor publish am. Changing the codename to one wey the vendor actually build for na how you fit install packages wey link against the wrong system libraries.
Step 4: run upgrade inside tmux, no be plain SSH shell
Normally, server upgrader dey run inside GNU screen and e support reattach after connection drop. So, if SSH loss, e no mean say upgrade go stop by itself. Run am inside your own tmux session too, so you get named session wey you fit reconnect to.
sudo apt install -y tmux
tmux new -s upgradeInside that session:
sudo ufw allow 1022/tcp
sudo do-release-upgradeBefore e change anything, upgrader go start second SSH daemon for port 1022, and e go show message say so:
To make recovery in case of failure easier, an additional sshd will be started on port '1022'. If anything goes wrong with the running ssh you can still connect to the additional one.E no go open your firewall for that port, because opening firewall hole without asking for am fit cause bad surprise. Open port 1022 yourself before you start, then close am when you don finish with sudo ufw delete allow 1022/tcp. Remember say your provider fit get another firewall for its control panel, outside the server.
If connection drop anyway, log in again and run tmux attach -t upgrade. Upgrade continue to run while you dey away. If e no continue, and you come back meet half-configured dpkg or apt sources wey part noble and part resolute, recover failed release upgrade explain how to repair package state and know when to stop repair and restore snapshot instead.
Step 5: answer configuration file prompts deliberately
dpkg na only files wey you or script change e dey ask about. So, every prompt na for file wey you or script change. Pressing enter go keep the current version by default.
Configuration file '/etc/ssh/sshd_config'
==> Modified (by you or by a script) since installation.
==> Package distributor has shipped an updated version.
What would you like to do about it ? Your options are:
Y or I : install the package maintainer's version
N or O : keep your currently-installed version
D : show the differences between the versions
Z : start a shell to examine the situation
The default action is to keep your current version.
*** sshd_config (Y/I/N/O/D/Z) [default=N] ?Press D first every time. Read wetin change, then decide whether to keep your version with N or install the maintainer version. The default don already be N, but keeping the old file no safe for every package: some configuration changes dey required make the upgraded system work.
Keeping your file get cost: you no go get the new defaults. Reconcile dem afterwards, after the box don come up and you no dey under time pressure.
sudo find /etc -name '*.dpkg-dist' -o -name '*.dpkg-new'Each file wey e list na the maintainer version, saved beside your own. Diff dem one by one and copy the settings wey matter. Two ones need extra care: /etc/ssh/sshd_config, because wrong answer go end your session, and your web server config, because wrong answer go take the sites down.
Since Ubuntu 24.04, needrestart dey restart affected services automatically by default. If you restore the interactive mode, accept the full list. Daemon wey still dey use old shared library remain exposed to bugs wey the update don fix until e restart.
Step 6: reboot, then check the machine
sudo rebootWhen e come back:
lsb_release -a
uname -r
systemctl --failed
journalctl -p err -b --no-pager | head -50
sudo apt update && sudo apt full-upgrade
sudo apt --purge autoremovelsb_release -a suppose report Release: 26.04 and Codename: resolute. uname -r suppose show 7.0 kernel. systemctl --failed suppose list zero units, and anything wey e list na your next work. The final apt update dey refresh package indexes, and apt full-upgrade come install any updates wey dem publish since the upgrade fetch its packages.
PostgreSQL 16 go 18: the cluster wey quietly remain behind
Ubuntu 24.04 dey ship PostgreSQL 16, while 26.04 dey ship PostgreSQL 18. The upgrade dey install 18 beside 16, but e no move your data. Debian's postgresql-common layer dey create a main cluster during server package installation only when no cluster dey already. So, existing PostgreSQL 16 cluster no dey automatically get empty 18 cluster for port 5433. Your application go continue to talk to 5432, and nothing go look wrong. Na why people dey discover the issue months later.
pg_lsclustersAn entry for version 16 mean say that cluster still dey run on 16. If pg_lsclusters still dey list an 18 main cluster, confirm say e empty before you remove am with sudo pg_dropcluster --stop 18 main, because pg_upgradecluster no go write into target cluster wey already exist. Do the migration when you fit stop the application:
sudo pg_upgradecluster 16 main
pg_lsclusters
sudo -u postgres vacuumdb --all --analyze-onlyThe default method dey dump 16 and reload am into 18, so you need free disk space wey roughly equal to the database size. -m upgrade dey use pg_upgrade instead, and e dey much faster for large database. When e finish, read the Port column: the new cluster go take over 5432, while the old one go remain stopped. The packaged upgrade hook dey run an analyze pass automatically; the command above dey repeat am explicitly.
Test the application against the new cluster for some days. Na only after that you suppose remove the old one:
sudo pg_dropcluster 16 main
sudo apt purge postgresql-16The old cluster data directory na the fastest rollback option wey you get. No delete am on upgrade day.
MySQL 8.0 go 8.4: the option wey dem remove fit stop the server
26.04 dey move MySQL from 8.0 go 8.4 LTS, and two changes fit catch servers.
First, mysqld no go start when e config get option wey the new version don remove. default_authentication_plugin na the common one, because plenty old guides tell people make dem set am. The service go fail, and journalctl -u mysql -n 50 go name the unknown variable directly. Delete that line from the file under /etc/mysql/mysql.conf.d/, then sudo systemctl start mysql.
Second, mysql_native_password plugin no longer dey enabled by default for 8.4, so account wey still dey use am no fit log in at all. Check am while you still dey on 8.0:
sudo mysql -e "SELECT user, host, plugin FROM mysql.user;"Move every account wey dey show mysql_native_password across before the upgrade, then update the password for your application config:
ALTER USER 'appuser'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'a new password';If client library too old to speak caching_sha2_password, you fit turn the old plugin back on for 8.4 by adding mysql_native_password=ON under [mysqld]. Treat am as temporary bridge wey get end date, because MySQL remove the plugin for 9.0.
PHP 8.3 go 8.5: your vhosts still dey point to socket wey don disappear
24.04 dey ship PHP 8.3 and 26.04 dey ship PHP 8.5. The packages dey install for versioned paths, and nothing dey rewrite your web server config. An nginx vhost wey get fastcgi_pass unix:/run/php/php8.3-fpm.sock; now dey point to socket wey no process dey create, so every PHP request dey return 502 and nginx error log dey talk say:
connect() to unix:/run/php/php8.3-fpm.sock failed (2: No such file or directory)Point am to the new socket, test the config, then reload:
sudo sed -i 's/php8.3-fpm.sock/php8.5-fpm.sock/' /etc/nginx/sites-available/example.com
sudo nginx -t
sudo systemctl reload nginxFor Apache with mod_php, the symptom dey different: Apache no go start at all, and sudo apache2ctl -t dey report say e no fit load libphp8.3.so because the file no dey exist. The enabled module na symlink to package wey don disappear.
sudo a2dismod php8.3
sudo a2enmod php8.5
sudo systemctl restart apache2If na LAMP stack for Ubuntu 24.04 you use build the box, e good make you check both paths, because the guide leave you with versioned module name and versioned socket.
Your php.ini tuning no dey carry over too. memory_limit, upload_max_filesize and anything else wey you set dey inside /etc/php/8.3/, and the new tree dey start with defaults. Compare the two files and copy the values across by hand. If you copy the whole old file over the new one, e go carry 8.3 defaults enter the 8.5 install. Then run php -m and compare: extension wey you install as php8.3-redis need e php8.5- package, and if e come from PPA, the upgrader don disable that source and the extension simply no dey.
Certificates need one check of their own. Run sudo certbot renew --dry-run --run-deploy-hooks after the upgrade. E dey test the complete renewal path, including the web server reload hook, without touching the live certificate. If hook wey call service name or binary wey don change fail, e go happen here where you fit see am, instead of failing silently during the next renewal. Certbot with Let's Encrypt for nginx explain how those hooks suppose look.
SSH: failure wey go end the session wey you dey work inside
Na the sshd_config prompt dey make people lock demself out. If you answer Y, e go install maintainer file, and discard your PermitRootLogin, PasswordAuthentication, AllowUsers, Port plus every other line wey you add. If your firewall allow only custom port and the packaged config dey listen on 22, the next connection go get refused, and the session wey you dey inside go be the last one wey you get.
Prevent am before you upgrade. /etc/ssh/sshd_config for 24.04 dey start with Include /etc/ssh/sshd_config.d/*.conf, and for most settings OpenSSH dey keep the first value wey e read. So, drop-in wey dem include for top go win over the same setting wey dey further down. Some keywords get exception: Port and ListenAddress fit accept multiple values. So, Port line for drop-in go add port instead of replacing the one wey dem set below am. Move your settings enter file wey dpkg no own:
sudo tee /etc/ssh/sshd_config.d/99-local.conf > /dev/null <<'EOF'
PermitRootLogin no
PasswordAuthentication no
AllowUsers deploy
EOF
sudo chmod 644 /etc/ssh/sshd_config.d/99-local.conf
sudo sshd -t && sudo systemctl restart sshOnce nothing inside /etc/ssh/sshd_config belong to you, that prompt no go matter again. Any answer go keep your settings, because dem dey inside different file.
Custom port need one extra check, because e fit no dey where you think:
systemctl is-enabled ssh.socketIf that output na enabled, na systemd dey open the listening port, no be sshd. Ubuntu don dey use socket activation for sshd since 22.10. For 24.04, systemd generator dey read Port and ListenAddress settings from sshd configuration and turn dem into the socket listen addresses, but only when systemd reload im units. Na why Port 2222 edit fit look like say e do nothing: e go take effect after sudo systemctl daemon-reload && sudo systemctl restart ssh.socket, and the packaged sshd_config now get note wey explain am. If you want set the port directly for socket unit instead, use sudo systemctl edit ssh.socket:
[Socket]
ListenStream=
ListenStream=2222The empty ListenStream= dey necessary. E clear the inherited value. Without am, the socket go listen on 22 as well as 2222. Apply am with sudo systemctl daemon-reload && sudo systemctl restart ssh.socket.
After the upgrade, before you close the session wey you dey inside:
sudo sshd -t
sudo systemctl status ssh.socket --no-pager
sudo ss -lntp | grep -E ':(22|2222)'Then open second terminal for your own machine and log in again. Working shell for that second terminal na the only proof wey count. Keep the first session open until you confirm am. SSH hardening for VPS explain the settings wey worth keeping for that drop-in.
If e don already too late, your provider web console go give you login wey no use SSH at all. Log in there, fix the config, run sudo sshd -t, then restart the service. Na exactly why you suppose test console access before upgrade, instead of testing am during upgrade.
FAQ
Why do-release-upgrade dey talk say "No new release found" for Ubuntu 24.04?
Since 29 September 2026, e no suppose happen again, because na that day Canonical enable upgrade from 24.04 LTS go 26.04.1. Before that time, the message dey expected: Ubuntu 26.04 LTS release on 23 April 2026, 26.04.1 follow on 27 August, and the upgrade path remain closed for some more weeks while Canonical backport fixes for rust-coreutils regressions. If you still dey see am, check say /etc/update-manager/release-upgrades contain Prompt=lts, wey be Ubuntu Server default and dey offer only the next long term support release. Leave am for lts.
I need reboot the server to finish the upgrade?
Yes. The upgrade install new kernel, new C library, and new init system. The running system go continue use the old ones until e restart. do-release-upgrade ask for reboot at the end, and machine wey you leave running until "later" dey run mixture of two releases. After e come back, check uname -r for the new kernel and systemctl --failed for services wey no survive.
I suppose upgrade in place or build fresh 26.04 server?
Build fresh whenever you fit. New VPS let you install the stack, restore the data, and test everything while the old server still dey serve traffic. This mean rollback na DNS change instead of restore from backup. Upgrade in place when the server hold state wey hard to move, when provider dey charge per machine, or when you get snapshot and confirmed console access. The in-place path don get plenty use, but e be one-way door for the hour wey e dey run.
Wetin go happen if my SSH connection drop during the upgrade?
The server upgrader normally use GNU screen, so SSH connection drop no go kill the upgrade by itself. If you start am inside the named tmux session above, reconnect and run tmux attach -t upgrade to continue am. The upgrader also start spare SSH daemon for port 1022 as another way to enter, but e no open firewall for that port. So allow 1022 yourself first, then close am afterwards.
My PHP site dey return 502 after upgrade. Wetin spoil?
PHP FPM socket path change with the version. Ubuntu 24.04 dey run PHP 8.3, while 26.04 dey run PHP 8.5. So /run/php/php8.3-fpm.sock no longer exist, while your nginx vhost still name am. The nginx error log show connect() to unix:/run/php/php8.3-fpm.sock failed (2: No such file or directory). Update fastcgi_pass to the 8.5 socket, run sudo nginx -t, then reload nginx. For Apache with mod_php, the equivalent fix na sudo a2dismod php8.3 followed by sudo a2enmod php8.5 and restart.