VPS Tutorials
Upgrade Ubuntu 24.04 to 26.04 LTS on a VPS: SSH and Recovery (2026)
Follow the supported Ubuntu 24.04 to 26.04.1 upgrade path with compatibility checks, snapshots, off-server backups, persistent SSH sessions, reboot acceptance and tested recovery.

Ubuntu's September 29, 2026 announcement enabled upgrades from 24.04 LTS to 26.04.1 LTS. Server administrators can use do-release-upgrade; do-release-upgrade not finding a release and lost SSH/web access are common concerns. For a production VPS, the command is only part of the job: prepare machine recovery, preserve remote access and validate the applications afterwards. This guide covers one Ubuntu 24.04 LTS VPS following the supported stable path.
Ubuntu 24.04 has standard security maintenance through 2029; see the release cycle. You need not upgrade every production server immediately. Test older PHP applications, control panels, kernel modules and databases on a clone first. A new provider-supplied 26.04 VPS with application/data migration may be easier to reverse.
This is an in-place 24.04 → 26.04 LTS procedure. A 22.04 server must follow supported intermediate releases instead of skipping 24.04; consult the release notes. Updating the host does not update Ubuntu base images inside containers.
| Situation | Recommended preparation |
|---|---|
| Test server, acceptable downtime and rehearsed recovery | In-place upgrade can be appropriate |
| Single production server with orders/continuous writes | Consistent application backups, full snapshot and write-freeze/migration plan |
| No usable console/rescue or snapshot restoration | Establish recovery access first |
| PHP, database, panel or driver compatibility unconfirmed | Stay on supported 24.04 or migrate to a compatible stack first |
The Ubuntu server upgrade guide requires updating the old release, backups, several GB of free space and attention to interactive prompts. The cited 1.5 GB RAM/4 GB storage installation starting point is not a production upgrade capacity guarantee. Assess /, separate /boot, APT cache and backup storage individually.
Record these read-only checks outside the machine:
cat /etc/os-release
uname -r
df -h / /boot 2>/dev/null
df -i /
free -h
sudo dpkg --audit
apt-mark showhold
systemctl --failed
sudo sshd -t
sudo ss -lntp
grep '^Prompt=' /etc/update-manager/release-upgrades
If /boot shares the partition with /, df reports the same space; separate partitions each need headroom. Resolve incomplete package configuration in dpkg --audit, critical held packages in apt-mark showhold, and failed business services in systemctl --failed before upgrading. After sshd -t succeeds, test current SSH from another terminal. Verify provider console/rescue access and record firewalls, security groups and management ports.
Inventory websites, databases, queues, cron and Docker, including config locations and owners. The 26.04 changes for LTS users describe PHP 8.5 and OpenSSH 10.2 changes. Check PHP-FPM sockets used by Nginx, old plugins, SSH algorithms and external Docker/database repositories. For a post-upgrade 502, inspect FPM and the fastcgi_pass socket before reinstalling the site.
Take a provider machine snapshot and record ID, time, covered system/data disks and restore duration. Independently back up database dumps, uploads, Compose files, site configuration, certificates and keys to another server or object storage, and test a sample restoration. See snapshot/backup/image differences and the VPS recovery drill.
A live snapshot and database export may capture different moments. Use database-consistent mechanisms and record when writes stop. Pause orders, payments and uploads during maintenance or use a tested migration with recovery options. Back up attached volumes separately if the snapshot excludes them. Never keep the only database backup on the machine being upgraded.
Update the current release before the main maintenance window. dist-upgrade and its options follow Ubuntu guidance; inspect packages proposed for removal and investigate essential service removals before confirming:
sudo apt update
sudo apt dist-upgrade -o APT::Get::Always-Include-Phased-Updates=true
sudo dpkg --audit
test -e /run/reboot-required && echo '需要先重启到已安装的内核'
If reboot is required, reboot first and verify SSH, website and database recovery. Check /etc/update-manager/release-upgrades uses Prompt=lts. If it contains never or normal, edit it to lts. Review third-party APT repositories: disabling them during upgrade does not supply compatible replacement software. Do not mass-replace noble with resolute; wait for supported vendor repositories.
Open the provider console and retain a tested SSH session. Run interactive work inside tmux; install it with sudo apt install tmux update-manager-core if needed. It preserves the shell process across a network disconnect, not power loss or every SSH failure. If the upgrader offers a recovery SSH listener, use the actual displayed port, permitting only administrative sources in both firewalls, then remove temporary rules afterwards.
tmux new -s ubuntu-upgrade
sudo do-release-upgrade
After a tmux disconnect, reconnect and run tmux attach -t ubuntu-upgrade. Do not force production into a development path with do-release-upgrade -d: the stable 24.04 → 26.04.1 path is enabled. Review downloads, installation changes and removals before continuing. Once running, do not shut down the VPS or terminate the upgrader.
For SSH, Nginx, database or other configuration conflicts, D shows differences; local modifications are commonly preserved by default. Read rather than blindly accepting every default or replacing every configuration. Check listeners, SSH authentication, virtual hosts and database bind addresses. Investigate critical proposed removals before the upgrade confirmation stage.
Inspect obsolete packages before deleting them. Kernels, runtimes or external packages may still serve workloads. When the upgrade requests reboot, confirm console and backups remain usable. Seeing 26.04 after boot does not prove the business recovered.
Check boot through the provider console, then establish a new SSH connection without prematurely closing working access. Run:
cat /etc/os-release
uname -r
sudo dpkg --audit
systemctl --failed
sudo ss -lntp
sudo apt update
apt list --upgradable
sudo journalctl -b -p err --no-pager | tail -n 80
Expect 26.04 LTS and the newly booted kernel. Validate only the services this VPS actually runs:
- SSH/firewalls: test authorized access from another network, original port and key authentication; remove recovery-port rules.
- Web: run
sudo nginx -tfor Nginx, then test HTTP/HTTPS, certificates and dynamic pages. Apache has its own configuration test. For PHP, checkphp -v, FPM service and real Nginx socket, then execute an application request. - Docker: inspect
docker version,docker compose version, containers and mounted volumes. Restore repositories only using vendor-supported 26.04 instructions. - Databases/tasks: check versions, application connectivity, backups, cron, queues and email. An active database process alone is insufficient.
- Capacity/monitoring: watch
df -h, disk I/O, 5xx, logs and alerts for a full business cycle.
For 404, 502 or application errors, inspect upstream connectivity, ports and logs. Re-enable external repositories individually after confirming 26.04 support; do not mix old noble packages into the new system.
Downgrading apt is not an OS release rollback plan. If boot/access cannot be repaired, restore the rehearsed pre-upgrade machine snapshot and application backups for excluded disks. Preserve and reconcile any post-upgrade orders/uploads before returning to an older snapshot; recovery to an old timestamp is not automatically lossless.
Without a usable snapshot, rebuild a 24.04 or 26.04 VPS from independent backups, then switch DNS/load balancing. Recheck SSH, databases, HTTPS, scheduled tasks and callbacks. Preserve logs from /var/log/dist-upgrade/ and journalctl -b. If do-release-upgrade reports no release, check current 24.04, Prompt=lts, package updates and Ubuntu mirror connectivity before changing codenames or adding -d.
Must 24.04 upgrade now? No; it remains supported. Unverified dependencies justify staying on it.
Will site files or Docker volumes be deleted? The upgrader mainly changes packages, but configuration conflicts, incompatible software and mistakes can still break services. Backups and snapshots are prerequisites.
PHP website returns 502? Check installed FPM, actual socket, Nginx fastcgi_pass and logs. The default PHP version differs, so check application compatibility too.
Restart do-release-upgrade after losing SSH? First use console/SSH to return to the original tmux session and inspect the existing process. Never start a second upgrader while the first is running.