Zero-Downtime Ubuntu Server OS Upgrades (22.04 LTS to 24.04 LTS) for Production LEMP Stacks
Mir Alamin
Principal Web Architect
Zero-Downtime Ubuntu Server OS Upgrades (22.04 LTS to 24.04 LTS) for Production LEMP Stacks
Author: Mir Alamin (Principal Web Architect) | Published: August 2, 2026 at 06:15 PM | Reading Time: 23 min read | Category: Maintenance | Tags: Ubuntu Server Update, Ubuntu Server Tune, LEMP setup, Maintenance, Web Server
Executive Summary
Upgrading a production web server's operating system from Ubuntu 22.04 LTS (Jammy Jellyfish) to Ubuntu 24.04 LTS (Noble Numbat) involves significant system library changes, kernel updates, and package dependency updates. Executing a major OS upgrade on a live LEMP stack without adequate precautions risks broken PHP extensions, MySQL service start failures, and unexpected web server downtime.
This playbook delivers a battle-tested, zero-downtime OS upgrade protocol for LEMP stack hosts using traffic draining, snapshots, and package holding.
1. Pre-Upgrade Preparation & Package Holding
Prior to initiating do-release-upgrade, back up all database instances and hold critical web stack packages to prevent accidental deletion:
# 1. Take a full MariaDB/MySQL database dump
sudo mysqldump --all-databases --single-transaction --quick > /root/pre_upgrade_db_backup.sql
# 2. Hold key LEMP stack packages
sudo apt-mark hold nginx mariadb-server php8.3-fpm
# 3. Update all existing Ubuntu 22.04 packages to latest stable release
sudo apt update && sudo apt dist-upgrade -y
sudo apt autoremove -y
# Reboot to ensure running on latest Jammy kernel
sudo reboot
2. Executing Ubuntu Release Upgrade
# Install update manager core
sudo apt install -y ubuntu-release-upgrader-core
# Execute distribution upgrade
sudo do-release-upgrade
During the interactive wizard:
- Choose
N(Keep existing local configuration files) when prompted about modifying/etc/nginx/nginx.confor/etc/sysctl.conf. - Un-hold packages once upgrade completes:
sudo apt-mark unhold nginx mariadb-server php8.3-fpm
3. Post-Upgrade Verification & Service Health Checks
After the server reboots into Ubuntu 24.04 LTS:
# 1. Verify OS release version
lsb_release -a
# 2. Verify LEMP daemon execution status
sudo systemctl status nginx
sudo systemctl status mariadb
sudo systemctl status php8.3-fpm
# 3. Test web server HTTP syntax
sudo nginx -t
4. Managed Server Administration & Upgrade Services
If you prefer experienced Linux architects to handle major server OS upgrades with zero downtime:
- ⚙️ Managed Server Administration Plans
- 🔄 Zero Downtime Website Transfer Services
- 🛠️ Continuous Website Maintenance Plans
5. Frequently Asked Questions (FAQ)
Q1: Why should I choose "Keep local configuration files" during OS upgrades?
Choosing "Keep local configuration files" preserves your custom Nginx virtual hosts, PHP-FPM pool tuning, and sysctl kernel configurations without overwriting them with default OS vendor templates.
Q2: What should I do if MariaDB fails to start after upgrading?
Check /var/log/mysql/error.log. Run sudo mariadb-upgrade -u root -p to update system table definitions to match the new MariaDB version.
© 2026 WebCare Pro. Authored by Mir Alamin.
Was this engineering analysis helpful?
Leave feedback to help us refine our technical content.
Share with fellow developers
Found value in this guide? Share it across your network.
Written by Mir Alamin
Principal Web Architect at WebCare Pro. Specializing in Next.js speed optimizations, high-score Core Web Vitals, Cloudflare Workers static edge hosting, and continuous website maintenance.
Explore WebCare Pro ServicesMore in Maintenance
View Category →Automated Linux Server Health Monitoring & Prometheus Alerts for Production Web Infrastructure
Set up real-time server metrics collection using Prometheus, Node Exporter, and Grafana with automated Telegram/Slack alerts for disk, CPU, and RAM thresholds.
cPanel to Nginx LEMP Migration: Handling Custom PHP Directives & Apache Modules
Convert cPanel Apache modules and .htaccess php_value directives to native Nginx server blocks and PHP-FPM pool files.