This guide covers keeping a running CloudSOE WooCommerce store patched and up to date. It covers PHP, the Ubuntu 26.04 LTS operating system, WordPress core and WooCommerce, plus moving to a fresh image when an in-place upgrade isn’t the right call.

It’s especially important right now. PHP2Shell (CVE-2026-109618 and CVE-2026-109619) is a critical remote code execution flaw in PHP that attackers are already exploiting, and it’s one of several recent CVEs in the web stack. An online store holds customer and order data, so patch PHP today.

What you can upgrade in place

ComponentIn place?How
Operating system (Ubuntu 26.04 LTS)Yes, for updates within 26.04apt (see Update the operating system). For a new Ubuntu release, use a fresh image
PHP 8.5 (Ubuntu packages)Yesapt, then restart Apache (see Patch PHP)
WordPress coreYeswp-cli or Dashboard → Updates
WooCommerce, Storefront and other plugins and themesYeswp-cli or Dashboard → Updates, then the WooCommerce database update
wp-cliYesRe-download it (see Update wp-cli)
Apache and MariaDBYes, for updates within 26.04apt, along with the rest of the OS
phpMyAdmin (older instances only)NoRemove it (see phpMyAdmin on older instances)

Before you start: back up

Take both kinds of backup before you patch or upgrade anything.

1. A cloud disk snapshot. This lets you roll the whole instance back in minutes:

  • AWS: open EC2 → Volumes, select the instance’s root volume, then choose Actions → Create snapshot.
  • Azure: open the VM, go to Disks, select the OS disk, then choose Create snapshot.

2. An application-level backup. This is the database (orders, customers, products) plus wp-content:

sudo mysqldump --single-transaction wordpress | gzip > /home/$(whoami)/store-db-$(date +%F).sql.gz
sudo tar czf /home/$(whoami)/wp-content-$(date +%F).tar.gz -C /var/www/wordpress wp-content
sudo cp /var/www/wordpress/wp-config.php /home/$(whoami)/wp-config.php.bak

Copy these files off the instance, for example with scp to your own machine or to S3 or Azure Blob storage. Plan upgrades for a quiet trading period. Any orders placed after the backup are lost if you have to roll back.

Patch PHP (PHP2Shell)

PHP2Shell is a pair of vulnerabilities, CVE-2026-109618 and CVE-2026-109619, published on 21 October 2026. They allow critical remote code execution in PHP 5.4 through 8.5 and are being exploited in the wild. Updating PHP is the only complete fix. The published workarounds are incomplete, so don’t rely on them.

Upstream PHP fixed it in 8.2.35, 8.3.36, 8.4.27 and 8.5.12. Ubuntu keeps its own version numbers and backports the fix, so what matters is the package version, not the number php -v prints.

Check your PHP version

php -v
dpkg -l | grep -E '^ii +php[0-9.]+-(cli|common) '

Compare the version column with the patched package:

Base OSPHP packagePatched version (or later)
Ubuntu 26.04 LTSphp8.58.5.4-0ubuntu1.5

php -v still reports PHP 8.5.4 after the patch, because Ubuntu backports the fix without changing the upstream number. Go by the dpkg -l output.

Update PHP

sudo apt update
sudo apt upgrade

This updates PHP along with everything else. The WooCommerce image runs PHP inside Apache with libapache2-mod-php, so restart Apache to load the patched PHP:

sudo systemctl restart apache2

To confirm which PHP integration Apache uses, run ls /etc/apache2/mods-enabled/ | grep php. You should see php8.5.load. If you’ve switched to PHP-FPM yourself, restart it too: sudo systemctl restart php8.5-fpm.

wp-cli runs on the same PHP, so it picks up the fix automatically.

Confirm the fix

dpkg -l | grep -E '^ii +php[0-9.]+-(cli|common) '

Both php8.5-cli and php8.5-common should show 8.5.4-0ubuntu1.5 or later. If they don’t, run apt policy php8.5-common to check that the resolute-security or resolute-updates repository is reachable.

Update the operating system

The WooCommerce image runs on Ubuntu 26.04 LTS, and Ubuntu publishes security updates for it through apt:

sudo apt update
sudo apt upgrade

If apt upgrade reports packages as “kept back” (often a new kernel), run sudo apt full-upgrade. Review the list before you confirm.

Then check whether a reboot is needed:

[ -f /var/run/reboot-required ] && cat /var/run/reboot-required.pkgs

If the file exists, reboot at a quiet time for the store. Apache and MariaDB start automatically:

sudo reboot

After the reboot, clear out the old kernels with sudo apt autoremove --purge.

Automatic security updates

CloudSOE images don’t change the base OS’s automatic-update settings. To see whether unattended-upgrades is active on your instance:

systemctl status unattended-upgrades
apt-config dump APT::Periodic::Unattended-Upgrade

If the setting shows "1", Ubuntu security updates (including PHP fixes) install automatically. You still need to restart Apache and reboot yourself. To turn it on, run sudo apt install unattended-upgrades && sudo dpkg-reconfigure -plow unattended-upgrades.

New Ubuntu releases

Don’t run do-release-upgrade on a live store. A release upgrade replaces PHP, MariaDB and Apache all at once, which makes problems hard to roll back. When you want a newer Ubuntu release, move to a fresh CloudSOE image instead.

phpMyAdmin on older instances

Current CloudSOE WooCommerce images don’t include phpMyAdmin. On Ubuntu 26.04 it comes only from the universe repository, which doesn’t get standard security support, and one of its dependencies (php-twig) carries a known CVE. Instances launched from earlier images may still have it. Check and remove it:

dpkg -l phpmyadmin 2>/dev/null | grep '^ii' && sudo apt remove --purge phpmyadmin && sudo apt autoremove --purge

Administer the database over SSH instead: sudo mysql wordpress.

Upgrade WordPress and WooCommerce

The image installs WordPress from the official wordpress.org release archive into /var/www/wordpress. WooCommerce and the Storefront theme are added from wordpress.org at build time, and wp-cli is preinstalled at /usr/local/bin/wp. All the site files are owned by the web user www-data, so both wp-cli and the dashboard updater work out of the box.

Run wp-cli as the web user, in this order:

WP="sudo -u www-data wp --path=/var/www/wordpress"

# 1. Maintenance mode on: shoppers see a short "briefly unavailable" notice
$WP maintenance-mode activate

# 2. WordPress core, then its database
$WP core update
$WP core update-db

# 3. WooCommerce, other plugins and themes
$WP plugin update --all
$WP theme update --all

# 4. WooCommerce's own database update
$WP wc update

# 5. Maintenance mode off
$WP maintenance-mode deactivate

Check what you’re running before and after:

$WP core version
$WP plugin list
grep -m1 "^ \* Version:" /var/www/wordpress/wp-content/plugins/woocommerce/woocommerce.php

From the dashboard

  1. Log in to https://<your-store>/wp-admin and open Dashboard → Updates.
  2. Update WordPress core first. WordPress shows a maintenance notice while it runs.
  3. Update WooCommerce, then your other plugins and themes.
  4. If WooCommerce shows a “database update required” notice afterwards, click Update WooCommerce Database. It runs in the background. Check progress under WooCommerce → Status → Scheduled Actions.

Update wp-cli

wp-cli is a single file. Replace it with the latest build from the same source the image uses:

sudo curl -fLo /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
sudo chmod 755 /usr/local/bin/wp
wp --info

Fix file ownership

If an update fails with a permissions error, it’s usually because files were uploaded over SFTP as another user. Reset the ownership and try again:

sudo chown -R www-data:www-data /var/www/wordpress
sudo chmod -R g+w /var/www/wordpress

Plugin and extension notes

  • Before a major WooCommerce release, check that your payment gateway, shipping and other WooCommerce extensions support it. Extensions are the most common thing to break after an upgrade.
  • If possible, try the upgrade first on a copy. Restore your cloud snapshot or backup to a second instance, upgrade it and run through a test checkout.
  • Paid extensions bought outside wordpress.org may need a licence key in the dashboard to receive updates.
  • After the upgrade, check WooCommerce → Status. It lists outdated template overrides in your theme and any pending database updates.

Move to a fresh CloudSOE image

Launching a new instance from the latest CloudSOE WooCommerce image and moving your store across is the cleanest option when:

  • your instance’s Ubuntu release is approaching end of life, or you want a newer release,
  • you want the latest PHP, MariaDB and Apache without a risky release upgrade,
  • the instance has drifted a long way from a clean state, or you suspect it was compromised before you patched. In that case, restore content you trust, not code, and review admin users and plugins.

1. Back up the old instance

Put the store into maintenance mode first so no orders arrive mid-backup. On the old instance:

sudo -u www-data wp --path=/var/www/wordpress maintenance-mode activate

mkdir -p ~/migration
sudo mysqldump --single-transaction wordpress | gzip > ~/migration/store-db.sql.gz
sudo tar czf ~/migration/wp-content.tar.gz -C /var/www/wordpress wp-content
sudo cp /var/www/wordpress/wp-config.php ~/migration/wp-config.php.old
sudo chown -R $(whoami) ~/migration

2. Launch the new instance

Launch the latest CloudSOE WooCommerce image, following the AWS or Azure getting-started guide. Let both first-boot services finish:

systemctl status wordpress-firstboot woocommerce-firstboot

The new instance comes with a demo store already installed. Your restore replaces it.

3. Copy the backup across

From your own machine, use ubuntu on AWS or your chosen admin user on Azure:

scp -r ubuntu@<old-ip>:migration ./migration
scp -r ./migration ubuntu@<new-ip>:

4. Restore on the new instance

On the new instance:

# Database: replace the store first boot created
sudo mysql -e "DROP DATABASE wordpress; CREATE DATABASE wordpress DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;"
gunzip -c ~/migration/store-db.sql.gz | sudo mysql wordpress

# Files: themes, plugins and uploads (product images)
sudo tar xzf ~/migration/wp-content.tar.gz -C /var/www/wordpress
sudo chown -R www-data:www-data /var/www/wordpress
sudo chmod -R g+w /var/www/wordpress

The wordpress database user and its privileges survive the drop and re-create, so nothing else needs to change.

Keep the new instance’s wp-config.php. It holds the new instance’s unique database password and fresh salts. Compare it with wp-config.php.old and copy across only settings you added yourself. If your old store used a table prefix other than wp_, set $table_prefix to match.

Your old admin accounts come across with the database. The generated admin password in the new instance’s credentials file no longer applies, so log in with your existing store account.

Restoring wp-content brings back your old WooCommerce version too. Bring everything up to date and run the database updates:

WP="sudo -u www-data wp --path=/var/www/wordpress"
$WP core update-db
$WP plugin update --all
$WP theme update --all
$WP wc update

The old instance stays in maintenance mode. If you need to roll back to it, turn maintenance mode off there with sudo -u www-data wp --path=/var/www/wordpress maintenance-mode deactivate.

5. Fix the site address

If you’re moving a domain to the new instance, the URL stays the same once DNS is switched (next step). If you’re testing on the new IP first, or your store uses an IP address, update the site URL:

WP="sudo -u www-data wp --path=/var/www/wordpress"
$WP option update home 'https://<new-ip-or-domain>'
$WP option update siteurl 'https://<new-ip-or-domain>'
# Optional: rewrite the old address inside content. Preview with --dry-run first
$WP search-replace 'https://<old-ip-or-domain>' 'https://<new-ip-or-domain>' --dry-run

6. Switch traffic and retire the old instance

  1. Point your DNS A record at the new instance’s IP. You can also move the address itself: on AWS, re-associate your Elastic IP with the new instance; on Azure, dissociate the static public IP from the old VM’s network interface and associate it with the new one.
  2. Once DNS points at the new instance, request a new trusted certificate there with sudo certbot --apache -d example.com. See the configuration guide. Payment gateways need it.
  3. Update any webhook or callback URLs your payment and shipping providers use, if they pointed at an IP address.
  4. Stop (don’t delete) the old instance and keep it for a few days in case you need something from it.
  5. When you’re happy, terminate or delete the old instance, its disks and the snapshots you took for this upgrade.

Check everything works

After any patch, upgrade or migration:

# Services are running
systemctl status apache2 mariadb --no-pager

# PHP is the patched package
dpkg -l | grep -E '^ii +php[0-9.]+-(cli|common) '

# Versions, and nothing left in maintenance mode
sudo -u www-data wp --path=/var/www/wordpress core version
sudo -u www-data wp --path=/var/www/wordpress plugin list
sudo -u www-data wp --path=/var/www/wordpress maintenance-mode status

From your own machine, since an Azure VM often can’t reach its own public IP:

curl -skI https://<public-ip>/

Then, in wp-admin:

  • WooCommerce → Status should show no pending database updates and no outdated templates.
  • Tools → Site Health shouldn’t report any critical issues.
  • Place a test order end to end: product page, cart, checkout, payment (in test mode) and the order email.

Next steps