Installing WordPress on Windows: Separate Development from Hosting

Image retained from the original article.

Originally published 20 June 2023; rewritten and reviewed on 15 October 2026.

A bundled local stack can put WordPress on a Windows 11 laptop in five minutes. That speed is great for building a theme or testing a plugin, but it creates a false sense of confidence if you try to carry the same habits onto a public Windows Server machine. Local development and production IIS hosting have very different security boundaries and maintenance workflows.

Keep local development simple and isolated

If your goal is simply building and testing WordPress on your workstation, skip raw XAMPP unless you specifically need to debug Apache configs. Tools like Laragon or LocalWP handle isolated PHP versions, clean .test virtual hosts, local SSL certificates, and built-in email catching (Mailpit) without polluting your Windows PATH.

The main rule for local stacks is discipline: never use your local root database user without a password as a template for production, and never copy wp-config.php directly to a live server without rotating salts and credentials.

Prepare a supportable Windows Server stack

When you actually need to host WordPress on Windows Server—usually because an organisation already standardises on IIS and Active Directory—do not drop an all-in-one dev bundle onto the production box. Build a clean, auditable stack:

  1. IIS with CGI: Enable the Web Server role and CGI feature via PowerShell (Install-WindowsFeature Web-Server, Web-CGI).
  2. PHP (Non-Thread Safe x64): Download the official Windows NTS build matching WordPress requirements, extract it to C:\PHP\8.3, and register php-cgi.exe in IIS FastCGI Settings. Add C:\PHP\8.3 to the system PATH only if you want one predictable CLI version for WP-CLI.
  3. IIS URL Rewrite module: WordPress uses .htaccess on Apache, which IIS ignores. Install the official IIS URL Rewrite extension so pretty permalinks work through web.config.
  4. Database: Install MariaDB or MySQL for Windows on a dedicated data drive if available, bind it to 127.0.0.1, and create a dedicated database and least-privilege user—never run WordPress as root.

Avoid installing multiple overlapping PHP or MySQL packages on the same server without documenting which binaries IIS and scheduled tasks actually invoke.

Extract WordPress into a dedicated site folder such as C:\inetpub\sites\mysite rather than dumping everything into wwwroot. Configure the IIS Application Pool to run under ApplicationPoolIdentity with No Managed Code (since PHP runs via FastCGI, not .NET).

Set NTFS permissions around what IIS actually needs:

  • Grant IIS_IUSRS Read & Execute on C:\inetpub\sites\mysite.
  • Grant the specific AppPool identity (IIS AppPool\mysite) Modify permission only on wp-content\uploads (and wp-content\upgrade if you allow dashboard updates). Giving Everyone: Full Control to fix a media upload error leaves every PHP file open to tampering.

To enable pretty permalinks without .htaccess, place a web.config in the WordPress root that handles rewrites and blocks direct downloads of wp-config.php:

<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <rewrite>
      <rules>
        <rule name="WordPress" stopProcessing="true">
          <match url=".*" />
          <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
          </conditions>
          <action type="Rewrite" url="index.php" />
        </rule>
      </rules>
    </rewrite>
    <security>
      <requestFiltering>
        <hiddenSegments>
          <add segment="wp-config.php" />
        </hiddenSegments>
      </requestFiltering>
    </security>
  </system.webServer>
</configuration>

Verify hosting behaviour before going live

Before pointing public DNS at the server, verify the parts that silently break on Windows:

  • HTTPS: Issue and auto-renew Let’s Encrypt certificates using Win-ACME (wacs.exe) bound to the IIS site, and enforce HTTP-to-HTTPS redirection.
  • Outgoing mail: Windows Server does not ship with a local sendmail binary, so native PHP mail() will fail. Configure an SMTP plugin (or Microsoft 365 / SES relay) early so password resets and contact forms actually deliver.
  • Background jobs: Test WP-Cron or wire a Windows Task Scheduler job to hit wp-cron.php (or run wp cron event run --due-now via WP-CLI) on a five-minute interval.
  • No exposed admin tools: Never leave phpMyAdmin or Adminer sitting at /phpmyadmin on a public IIS binding.

Run a quick IIS AppPool recycle and verify the site comes back cleanly, then test restoring your database backup to a scratch schema. The installer gets WordPress running; knowing your PHP path, NTFS permissions, and backup restore steps is what keeps it supportable six months later.