Applications Azure

WordPress Multisite 6.9 on Ubuntu 24.04 on Azure User Guide

| Product: WordPress Multisite 6.9 on Ubuntu 24.04 LTS on Azure

Overview

WordPress Multisite lets you run a network of sites from a single WordPress install, sharing one codebase, plugins and themes while each site keeps its own content, users and settings. The cloudimg image installs WordPress 6.9.7 from wordpress.org (checksum-verified) alongside Apache 2.4, MySQL 8.0 and PHP 8.3 (all from Ubuntu noble, no third-party APT repositories) and pre-configures the network in subdirectory layout so you can add http://your-host/site2/, http://your-host/blog/, etc. with no wildcard DNS work. The network answers at whatever public IP or DNS name you reach the VM on, and every site you add is served at that address too.

What is included:

  • WordPress 6.9.7 with Network Multisite enabled at /var/www/html/wordpress, with automatic 6.9.x security and maintenance releases (WP_AUTO_UPDATE_CORE is minor)
  • Apache 2.4.x with mod_rewrite plus the multisite RewriteRule block built into the vhost (no .htaccess dependency)
  • MySQL 8.0.x with wordpress DB and wpuser MySQL user (per-VM password)
  • PHP 8.3.x with mysqli, gd, mbstring, xml, curl, zip extensions. WordPress resizes images with PHP's GD library; ImageMagick is not installed
  • WP-CLI 2.x at /usr/local/bin/wp
  • wordpress-multisite-firstboot.service, which on the first boot of your VM generates new MySQL root, WordPress database, WordPress admin and MySQL maintenance (debian-sys-maint) passwords and all eight WordPress authentication keys and salts in wp-config.php. MySQL also generates its own TLS and RSA keys on that boot, so no two VMs share a password, a login-cookie key or a database key
  • Apache plus MySQL enabled and auto-starting on boot
  • 24/7 cloudimg support

Prerequisites

Active Azure subscription, SSH key, VNet plus subnet. Standard_B2s (4 GB RAM) is fine for small networks (under 20 sites, low traffic); bump to D2s/D4s for medium networks or WooCommerce stores.

Step 1 to 3: Deploy and SSH (standard pattern)

ssh azureuser@<vm-ip>

Step 4: Verify Services

sudo systemctl status apache2 mysql --no-pager | head -20

apache2 plus mysql active

Step 5: Read Per-VM Credentials

The first-boot service rotates passwords and writes the per-VM credentials to /etc/cloudimg-credentials.txt. Read it as root:

sudo cat /etc/cloudimg-credentials.txt

You will see:

# WordPress Multisite 6.9 — Per-VM Credentials
# Generated: <date>
#
# Visit your VM's public IP in a browser to access WordPress:
#   http://<your-public-ip>/                  (front of site)
#   http://<your-public-ip>/wp-admin/         (single-site admin)
#   http://<your-public-ip>/wp-admin/network/ (network superadmin)
#
WP_ADMIN_USER=admin
WP_ADMIN_PASSWORD=<random>
WP_DB_NAME=wordpress
WP_DB_USER=wpuser
WP_DB_PASSWORD=<random>
MYSQL_ROOT_PASSWORD=<random>

Step 6: Login to wp-admin

Browse to http://<vm-ip>/wp-login.php and authenticate as admin with the password from Step 5. You can confirm the WordPress version from the command line:

sudo -u www-data /usr/local/bin/wp core version --path=/var/www/html/wordpress

WordPress login form

Step 7: Network Admin — Sites

After login, browse to http://<vm-ip>/wp-admin/network/sites.php to see your network's sites. The primary site (blog_id=1) is created automatically.

Network Admin Sites page showing the primary site

Step 8: Add a New Site

From the Network Admin Sites page click Add New to create another site in the network. Subdirectory layout means new sites live under paths like http://<vm-ip>/blog/ or http://<vm-ip>/store/ with no DNS work, and each site's own dashboard is at http://<vm-ip>/<site-slug>/wp-admin/.

Network Admin Add New Site form

Step 9: WP-CLI Network Operations

WP-CLI is fully network-aware. List sites in your network:

sudo -u www-data /usr/local/bin/wp site list --path=/var/www/html/wordpress

Create a new site without using the UI:

sudo -u www-data /usr/local/bin/wp site create --slug=blog --title="Blog" --path=/var/www/html/wordpress

List network plugins:

sudo -u www-data /usr/local/bin/wp plugin list --network --path=/var/www/html/wordpress

Step 10: Components

Component Path
WordPress install /var/www/html/wordpress/
wp-config.php (with multisite block) /var/www/html/wordpress/wp-config.php
Apache vhost (with multisite RewriteRules) /etc/apache2/sites-available/wordpress.conf
Apache logs /var/log/apache2/wordpress-{access,error}.log
MySQL data /var/lib/mysql/
WP-CLI /usr/local/bin/wp
Firstboot script /usr/local/sbin/wordpress-multisite-firstboot.sh
Credentials /etc/cloudimg-credentials.txt (mode 0600 root:root)

Step 11: Security

  • HTTPS: install certbot and obtain a Let's Encrypt cert with the --apache plugin: sudo apt-get install -y certbot python3-certbot-apache && sudo certbot --apache. With multisite you will want a wildcard cert if you ever switch to subdomain layout, otherwise the certbot apache plugin handles the primary host fine.
  • Restrict NSG so port 80 is only open to your CDN, load balancer or Cloudflare; keep 22 to your management CIDR only
  • WordPress core updates: security and maintenance releases on the 6.9 branch install automatically (define( 'WP_AUTO_UPDATE_CORE', 'minor' ); in wp-config.php). Moving to a new major release is your decision: back up, then run sudo -u www-data /usr/local/bin/wp core update --path=/var/www/html/wordpress
  • Update plugins and themes monthly at the network level: wp plugin update --all --network and wp theme update --all --network
  • Enable two-factor auth network-wide via Wordfence or the Two Factor Authentication plugin (network-activate it)
  • Patch monthly: apt-get update && apt-get upgrade && reboot
  • Limit super-admins — only the admin user should be a super-admin; per-site admins should be regular admins

Multisite Notes

  • Subdirectory vs subdomain: this image is configured in subdirectory layout (sites at /site2/, /blog/ etc.). To switch to subdomain layout edit wp-config.php and change define('SUBDOMAIN_INSTALL', false); to true, then add a wildcard A record *.your-domain.com -> <vm-ip> and re-run wp core multisite-convert --subdomains if you have not yet added new sites.
  • Network Admin URL: http://<vm-ip>/wp-admin/network/ (not /wp-admin/)
  • Adding sites via UI: the per-site admin URL is http://<vm-ip>/<site-slug>/wp-admin/

Licensing

WordPress is GPL-2.0+ — free to use commercially. cloudimg provides commercial support separately. support@cloudimg.co.uk.