Applications Azure

WordPress on Windows Server 2025 on Azure User Guide

| Product: WordPress 7.1 on Windows Server 2025

Overview

WordPress is the open source content management system behind a large share of the web: blogs, company sites, portfolios and online shops. From a web browser you write pages and posts in the block editor, manage media, users and comments, change the look with themes and add features with plugins, and other applications can use its REST API.

This image runs WordPress 7.1.5 on Windows Server 2025 Datacenter (Desktop Experience) with IIS, PHP 8.4 and a local MariaDB 11.4 server. WordPress is served over HTTPS on port 443, port 80 redirects to HTTPS, and pretty permalinks (/sample-page/) work out of the box through the IIS URL Rewrite module. On the first boot of every VM the image creates this VM's own WordPress database, the MariaDB passwords, WordPress's security keys and salts, the cloudimg administrator's password and a TLS certificate for this VM, then installs WordPress with WordPress's own installer; IIS serves nothing until that is done. The Windows Server licence is included in the virtual machine price that Microsoft bills; WordPress is free software under the GNU General Public License v2 or later. cloudimg's support team is on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours.

What is included:

  • WordPress 7.1.5 from wordpress.org's release archive (checksum verified), in C:\Program Files\WordPress\wordpress, with wp-config.php one folder above it, where IIS never serves it
  • IIS serving WordPress through the IIS URL Rewrite module, in its own application pool WordPress (No Managed Code, its own ApplicationPoolIdentity)
  • PHP 8.4.28 (non thread safe, x64) under IIS FastCGI, with the extensions WordPress uses and OPcache on
  • MariaDB 11.4.14 (long term support) as the Windows service MariaDB, running as its own virtual account and listening on 127.0.0.1 only
  • WordPress's scheduled jobs run every 5 minutes by the Windows scheduled task \WordPress\WordPress cron, as LOCAL SERVICE
  • WordPress's automatic background updates left on, as WordPress ships them: WordPress installs each new version of itself, security releases included
  • A per-VM password for the cloudimg administrator, and new user registration closed
  • HTTPS on TCP 443 with this VM's own self signed certificate, TCP 80 redirecting to HTTPS, and Windows Firewall rules for both
  • Windows Server 2025 Datacenter, patched with Windows Update at build, with Microsoft Defender Antivirus and Windows Firewall on
  • cloudimg's support team on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours

Prerequisites

An active Azure subscription, a Remote Desktop client, and a virtual network in the target region. Standard_B2ms (2 vCPU, 8 GiB RAM) is a good starting point for a small or medium site; choose a larger size for heavy traffic, large media libraries or many plugins. In the network security group, allow inbound TCP 3389 (Remote Desktop) from your own address ranges only, and TCP 443 (WordPress) and TCP 80 (the redirect to HTTPS) from the people who will visit the site: your own ranges while you build it, any address once it is public.

Step 1: Deploy from the Azure Marketplace

Sign in to the Azure Portal, choose Create a resource, search the Marketplace for WordPress on Windows Server 2025 by cloudimg, and select Create. On Basics pick your subscription, resource group, region and size, and set the Administrator account username and password. Under Inbound port rules allow RDP (3389), HTTP (80) and HTTPS (443), then narrow each rule's source on the Networking tab. Select Review + create, then Create.

Step 2: Deploy from the Azure CLI

# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn cloudimg1647283583153:wordpress-windows-server:default:latest

az vm create \
  --resource-group <your-rg> \
  --name wordpress \
  --image cloudimg1647283583153:wordpress-windows-server:default:latest \
  --size Standard_B2ms \
  --admin-username <admin-name> \
  --admin-password '<a strong password>' \
  --public-ip-sku Standard

az vm open-port --resource-group <your-rg> --name wordpress --port 3389 --priority 1000
az vm open-port --resource-group <your-rg> --name wordpress --port 443 --priority 1010
az vm open-port --resource-group <your-rg> --name wordpress --port 80 --priority 1020

az vm open-port opens each port to any address; narrow the rules in the network security group afterwards (always for 3389).

First boot takes a few minutes. When the VM first starts, Windows finishes its setup, then the image creates this VM's database, passwords, keys and certificate, installs WordPress and starts IIS. Until then WordPress does not answer on ports 80 and 443. The setup is finished when the file C:\ProgramData\WordPress\cloudimg-firstboot.done exists (Step 4).

Step 3: Connect with Remote Desktop

Connect to the VM's public IP address with your Remote Desktop client (on Windows, mstsc; on macOS, Windows App), signing in with the administrator name and password you set at deployment. Open Windows PowerShell as administrator for the commands below. php and mariadb are on the system path.

Step 4: Confirm WordPress is running

Get-Content C:\ProgramData\WordPress\cloudimg-firstboot.done
Get-Service W3SVC, MariaDB | Format-Table Status, StartType, Name, DisplayName -AutoSize
Get-NetTCPConnection -State Listen -LocalPort 80, 443, 3306 | Sort-Object LocalPort | Format-Table LocalAddress, LocalPort, @{n='Process';e={(Get-Process -Id $_.OwningProcess).ProcessName}} -AutoSize
Get-ScheduledTask -TaskPath \WordPress\ | Format-Table TaskName, State, @{n='RunAs';e={$_.Principal.UserId}} -AutoSize
(Select-String -Path 'C:\Program Files\WordPress\wordpress\wp-includes\version.php' -Pattern '^\$wp_version').Line
& 'C:\Program Files\PHP\php.exe' -r 'echo PHP_VERSION, PHP_EOL;'
& 'C:\Program Files\MariaDB 11.4\bin\mariadb.exe' --version
done 2026-12-02T15:26:30.2497062Z address=<vm-public-ip> certificate=CFC0A44046F805F33C03FE12A365B642BA152824

 Status StartType Name    DisplayName
 ------ --------- ----    -----------
Running Automatic MariaDB MariaDB
Running Automatic W3SVC   World Wide Web Publishing Service

LocalAddress LocalPort Process
------------ --------- -------
::                  80 System
::                 443 System
127.0.0.1         3306 mysqld

TaskName       State RunAs
--------       ----- -----
WordPress cron Ready LOCAL SERVICE

$wp_version = '7.1.5';

8.4.28

C:\Program Files\MariaDB 11.4\bin\mariadb.exe from 11.4.14-MariaDB, client 15.2 for Win64 (AMD64), source revision e6b2d842af869e102809e31cf3d00ee897e60a86

The first line shows when first boot finished, the address it gave WordPress and the certificate (the VM's public IP address) and the certificate's thumbprint. IIS (W3SVC) and MariaDB start automatically with Windows. Ports 80 and 443 belong to System because IIS listens through the Windows HTTP stack, and MariaDB listens on 127.0.0.1 only, so the database is never reachable from the network. The cron task is Ready and runs every 5 minutes, and the last three lines are the WordPress, PHP and MariaDB versions.

An elevated PowerShell window on a new VM: IIS and MariaDB running and set to start automatically, ports 80 and 443 on IIS and 3306 on 127.0.0.1 only, the WordPress cron task ready as LOCAL SERVICE, and the WordPress, PHP and MariaDB versions

Step 5: Read your WordPress password

First boot wrote this VM's passwords to a file that only the SYSTEM account and the Administrators group can read:

Get-Content C:\ProgramData\WordPress\wordpress-credentials.txt
WordPress on Windows Server 2025 by cloudimg: this VM's own credentials, made at its first boot.
WordPress: https://<vm-public-ip>/  (dashboard: https://<vm-public-ip>/wp-admin/)
WORDPRESS_ADMIN_USERNAME=cloudimg
WORDPRESS_ADMIN_PASSWORD=<this VM's own password>
MARIADB_ROOT_USERNAME=root
MARIADB_ROOT_PASSWORD=<this VM's own password>
WORDPRESS_DB_NAME=wordpress
WORDPRESS_DB_USERNAME=wordpress
WORDPRESS_DB_PASSWORD=<this VM's own password>
MariaDB listens on 127.0.0.1:3306 only. The HTTPS certificate is self-signed for this VM: replace it with your own.
Change the administrator password and email in WordPress (Users > Profile) and see the user guide:
https://www.cloudimg.co.uk/guides/wordpress-on-windows-server-2025-azure/

WORDPRESS_ADMIN_PASSWORD is the password of the WordPress administrator cloudimg. The MariaDB passwords are for the database itself: WordPress already has its own (in wp-config.php), and you need root only for backups and maintenance. Keep the file safe, and change the administrator's password and email address after your first sign-in (Step 7).

Step 6: Visit your site

On your own computer, browse to https://<vm-public-ip>/. The certificate is this VM's own self signed one, so your browser warns about it the first time: accept it to continue (or use your own domain and a trusted certificate, see Use your own domain and certificate below). http:// addresses redirect to HTTPS. A new site shows WordPress's default theme with its first post, Hello world!

The new site's front page in Microsoft Edge on the VM: WordPress's default theme and its first post, served by IIS over HTTPS

Step 7: Sign in to the dashboard

Browse to https://<vm-public-ip>/wp-admin/ and sign in as cloudimg with the password from Step 5. Well known default sign-ins such as admin/admin do not work on this image: the only account is cloudimg, with this VM's own password, and nobody can register an account from the sign-in page.

The WordPress Dashboard after signing in as the cloudimg administrator

Then, under Users > Profile, set your own email address (the image uses admin@example.com) and a new password, and under Settings > General set your Site Title, Tagline and the Administration Email Address. Write pages and posts under Pages and Posts, choose and customise a theme under Appearance, and add features under Plugins > Add New Plugin.

Step 8: Updates

Dashboard > Updates shows the WordPress version, when WordPress last checked for a new one, and any plugin, theme or translation updates. WordPress's automatic background updates are on, as WordPress ships them for a new site: each new version of WordPress installs itself, run by the cron task. To take major versions by hand and let only maintenance and security releases install themselves, select Switch to automatic updates for maintenance and security releases only on this page. Turn on automatic updates for each plugin and theme on their own pages. Plugins and themes install and update from the dashboard, because the web server may change files in the WordPress folder (and only there).

Dashboard > Updates: the latest WordPress, checked for updates a moment ago, with automatic updates on for every new version

Step 9: Check the identities everything runs as

WordPress's pages run in the IIS application pool WordPress under its own ApplicationPoolIdentity, a low privilege account that can read PHP and wp-config.php and change only the WordPress folder (wordpress), for uploads, updates, plugins and themes. MariaDB runs as its own virtual account, and the cron task as LOCAL SERVICE. Open Internet Information Services (IIS) Manager and select Application Pools to see the pool:

IIS Manager showing the WordPress application pool, No Managed Code, running as its own ApplicationPoolIdentity

The same from PowerShell, with the permissions of wp-config.php and the credentials file:

Import-Module WebAdministration
Get-ChildItem IIS:\AppPools | Select-Object Name, State, @{n='Identity';e={$_.processModel.identityType}} | Format-Table -AutoSize
Get-CimInstance Win32_Service -Filter "Name='MariaDB'" | Format-List Name, StartName, StartMode, State
(Get-Acl 'C:\Program Files\WordPress\wp-config.php').Access | Format-Table IdentityReference, FileSystemRights -AutoSize
(Get-Acl C:\ProgramData\WordPress\wordpress-credentials.txt).Access | Format-Table IdentityReference, FileSystemRights -AutoSize
name      state   Identity
----      -----   --------
WordPress Started ApplicationPoolIdentity

Name      : MariaDB
StartName : NT SERVICE\MariaDB
StartMode : Auto
State     : Running

IdentityReference           FileSystemRights
-----------------           ----------------
NT AUTHORITY\SYSTEM              FullControl
NT AUTHORITY\LOCAL SERVICE Read, Synchronize
BUILTIN\Administrators           FullControl
IIS APPPOOL\WordPress      Read, Synchronize

IdentityReference      FileSystemRights
-----------------      ----------------
NT AUTHORITY\SYSTEM         FullControl
BUILTIN\Administrators      FullControl

An elevated PowerShell window: wp-config.php readable by the WordPress pool and the cron task only, and the credentials file readable by SYSTEM and Administrators only, shown with every password hidden

Server Components

Component Version or setting Where
WordPress 7.1.5, automatic background updates on C:\Program Files\WordPress\wordpress (the web root), C:\Program Files\WordPress\wp-config.php
Web server IIS 10, site WordPress, pool WordPress (ApplicationPoolIdentity, No Managed Code), IIS URL Rewrite 2.1 C:\Program Files\WordPress\wordpress\web.config
PHP 8.4.28 NTS x64, IIS FastCGI, 256M memory, 64M uploads C:\Program Files\PHP
Database MariaDB 11.4.14, service MariaDB (NT SERVICE\MariaDB), 127.0.0.1:3306 only, utf8mb4 C:\Program Files\MariaDB 11.4, data in C:\ProgramData\WordPress\mariadb-data
Scheduled jobs Scheduled task \WordPress\WordPress cron, every 5 minutes, LOCAL SERVICE php.exe C:\Program Files\WordPress\wordpress\wp-cron.php
HTTPS TCP 443, this VM's self signed certificate (RSA 2048, private key not exportable, valid 3 years) Cert:\LocalMachine\My, friendly name "WordPress web server (this VM, cloudimg)"
HTTP TCP 80, redirects to HTTPS Windows Firewall rules in the group WordPress
Windows Server 2025 Datacenter, Desktop Experience, build 26100

Filesystem Layout

Path What it holds
C:\Program Files\WordPress\wordpress\ WordPress itself, the folder IIS serves. The web server and the cron task may change it (updates, plugins, themes, uploads)
C:\Program Files\WordPress\wordpress\wp-content\ Your themes, plugins and uploads (uploads, where PHP scripts never run)
C:\Program Files\WordPress\wp-config.php The database connection and this VM's keys and salts. Read only for the web server and the cron task
C:\ProgramData\WordPress\tmp\, log\ PHP's temporary files and its error log (php-errors.log)
C:\ProgramData\WordPress\mariadb-data\ The MariaDB data directory and its my.ini. MariaDB's account, SYSTEM and Administrators only
C:\ProgramData\WordPress\wordpress-credentials.txt This VM's passwords. SYSTEM and Administrators only
C:\ProgramData\WordPress\cloudimg-firstboot.log What first boot did (never a password or key)

Managing the Services

From an elevated PowerShell window:

# restart the web server
iisreset

# restart the database
Restart-Service MariaDB

# run WordPress's scheduled jobs now
Start-ScheduledTask -TaskPath \WordPress\ -TaskName 'WordPress cron'

To confirm the HTTP redirect, the sign-in page, that wp-config.php is never served, and this VM's certificate and bindings, define a small helper that shows the status line of an address without following redirects, then run the checks:

function Get-Status([string]$url) {
    $rq = [Net.HttpWebRequest]::Create($url); $rq.AllowAutoRedirect = $false; $rq.Timeout = 60000
    try { $rs = $rq.GetResponse() } catch [Net.WebException] { $rs = $_.Exception.Response; if (-not $rs) { return "no answer ($($_.Exception.Status))" } }
    try { "$([int]$rs.StatusCode) $($rs.StatusDescription) $($rs.Headers['Location'])".Trim() } finally { $rs.Close() }
}
Import-Module WebAdministration
Get-Status http://localhost/wp-login.php
Get-Status https://localhost/wp-login.php
Get-Status https://localhost/wp-config.php
Get-ChildItem Cert:\LocalMachine\My | Where-Object FriendlyName -like 'WordPress*' | Format-List Subject, NotAfter, FriendlyName
Get-WebBinding -Name WordPress | Format-Table protocol, bindingInformation -AutoSize
301 Moved Permanently https://localhost/wp-login.php

200 OK

404 Not Found

Subject      : CN=<vm-public-ip>
NotAfter     : 12/2/2029 3:26:17 PM
FriendlyName : WordPress web server (this VM, cloudimg)

protocol bindingInformation
-------- ------------------
http     *:80:
https    *:443:

Port 80 answers 301 Moved Permanently to the same address over HTTPS, the sign-in page answers 200, and wp-config.php answers 404 because it lives outside the folder IIS serves. The certificate is named for the VM's public IP address and is valid for three years.

An elevated PowerShell window: HTTP redirecting to HTTPS, the sign-in page answering 200, wp-config.php answering 404, this VM's own certificate and the site's two bindings

On Startup

At the first start of your VM, the scheduled task cloudimg-firstboot (SYSTEM) runs once:

  1. It keeps IIS stopped and disabled and the WordPress cron task off, and waits until Azure has finished setting up the VM
  2. It creates C:\ProgramData\WordPress locked to SYSTEM and Administrators, with only the access the web server, MariaDB and the cron task need
  3. It creates a new MariaDB instance for this VM: no anonymous accounts, no test database, root on this VM only with its own password, and a wordpress database and account with their own password
  4. It writes wp-config.php with this VM's database password and its own keys and salts, readable by the web server and the cron task only
  5. It installs WordPress with WordPress's own installer: the cloudimg administrator with this VM's own password, the site address https://<the VM's public IP>, pretty permalinks, registration closed
  6. It writes C:\ProgramData\WordPress\wordpress-credentials.txt, readable by administrators only
  7. It creates this VM's TLS certificate, named for the VM's public and private addresses, and binds it to port 443
  8. It turns the cron task on, starts IIS, waits for WordPress's sign-in page at https://localhost/wp-login.php, sets IIS to start automatically, writes cloudimg-firstboot.done, then removes itself and its script

If anything fails, IIS stays stopped, the cron task stays off, and the task starts again from a clean state at the next start. Every start after that, IIS and MariaDB start with Windows.

Use your own domain and certificate

WordPress's address is the VM's public IP address. To serve the site under your own DNS name:

  1. Point your DNS name (for example www.example.com) at the VM's public IP address. A static public IP keeps that address across restarts.
  2. Import your certificate (a .pfx with its private key) into Cert:\LocalMachine\My and bind it to port 443 of the WordPress site:
$cert = Import-PfxCertificate -FilePath C:\path\to\www.example.com.pfx -CertStoreLocation Cert:\LocalMachine\My -Password (Read-Host -AsSecureString 'PFX password')
Import-Module WebAdministration
(Get-WebBinding -Name WordPress -Protocol https -Port 443).AddSslCertificate($cert.Thumbprint, 'My')
  1. In WordPress, under Settings > General, set both WordPress Address (URL) and Site Address (URL) to https://www.example.com and save. WordPress signs you out; sign in again at https://www.example.com/wp-admin/.

Security Recommendations

  • Keep Remote Desktop to your own networks. Open TCP 3389 only to the addresses you manage the VM from, and prefer a VPN, Azure Bastion or just-in-time access.
  • Change the administrator's email and password after your first sign-in, and give each editor their own account with the least role they need (Users > Add New User).
  • Keep WordPress, plugins and themes up to date. WordPress's own updates install themselves; turn on automatic updates for plugins and themes you trust, remove those you do not use, and install them only from sources you trust.
  • Use a trusted certificate for your own domain before the site goes public (see above).
  • Do not give this VM a managed identity unless you need one. PHP cannot reach the Azure Instance Metadata Service on this image (a Windows Firewall rule blocks it), but other programs on the VM can, and through it a managed identity's tokens.

Maintenance

  • Windows updates: Windows Update is on, as Microsoft ships it. Restarting the VM restarts IIS and MariaDB automatically.
  • WordPress updates: new versions of WordPress install themselves, run by the cron task. If you switched to maintenance and security releases only (Step 8), a major release (for example 7.2) shows under Dashboard > Updates: back up first, then update from there.
  • PHP and MariaDB: the image's PHP 8.4 and MariaDB 11.4 are supported release lines; update them from php.net and mariadb.org when their projects publish fixes, after a backup.
  • Back up your site: back up the database with mariadb-dump (as root, with the password from the credentials file), wp-config.php and the folder C:\Program Files\WordPress\wordpress\wp-content. Azure Backup for the whole VM is a simple alternative.
  • Logs: PHP's errors are in C:\ProgramData\WordPress\log\php-errors.log, IIS's logs in C:\inetpub\logs\LogFiles, and first boot's in C:\ProgramData\WordPress\cloudimg-firstboot.log (it never contains a password).
  • Firewall: Windows Firewall allows 443 and 80 through the rules in the WordPress group; the network security group decides who can reach them.

Troubleshooting

WordPress does not answer, or cloudimg-firstboot.done is missing

First boot may still be running: give it a few minutes and check again. Its log shows how far it got:

Get-Content C:\ProgramData\WordPress\cloudimg-firstboot.log

"The password you entered for the username cloudimg is incorrect"

The username is cloudimg (lower case). Copy the password from WORDPRESS_ADMIN_PASSWORD= in C:\ProgramData\WordPress\wordpress-credentials.txt. If you changed the password in WordPress, the file still holds the first one; use Lost your password? only after you have set a working email setup (below).

The site redirects to an old address

WordPress sends visitors to the address in Settings > General. If the VM's public IP address changed (a dynamic IP after a stop and start), set the new one from PowerShell, then browse to it:

$root = (Select-String -Path C:\ProgramData\WordPress\wordpress-credentials.txt -Pattern '^MARIADB_ROOT_PASSWORD=(.*)$').Matches[0].Groups[1].Value
"UPDATE wordpress.wp_options SET option_value='https://<new address>' WHERE option_name IN ('siteurl','home');" | mariadb -u root "--password=$root" -h 127.0.0.1

Emails from WordPress do not arrive

The VM has no mail server, and Azure blocks outbound email on port 25 for most subscriptions. Install an SMTP plugin and send through your own mail provider or an email relay service on port 587.

Scheduled posts or jobs do not run

Check that the task is Ready and when it last ran:

Get-ScheduledTask -TaskPath \WordPress\ | Get-ScheduledTaskInfo | Format-List TaskName, LastRunTime, LastTaskResult

Forgot the Windows password

Use Reset password on the VM's page in the Azure portal.

Support

cloudimg's support team is on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours. Contact support@cloudimg.co.uk.

WordPress is a trademark of the WordPress Foundation. cloudimg is not affiliated with or endorsed by the WordPress Foundation; the software is provided under its open source licence (GPL-2.0-or-later).