Host Grav Blog on Windows With IIS
This guide is how to setup a Grav Blog (the software running this website!) to work on Windows 10/11 or Server, with IIS. This guide assumes you already have IIS up and running on your Windows machine, a domain, routing rules in place, and SSL certificate suitable for your needs, already available to use. I will assume you already know how to, and have created a simple site in IIS with the appropriate domain name, bindings, and a physical path that suits you. In this guide we will use physical path of C:\IIS-sites\grav-admin\ but you can edit this as appropriate for your own system.
Install PHP
- Visit https://windows.php.net/download/ and download the latest version of PHP 8.
- Current release is 8.5 as of this writing
- x64
- Non-Threaded Safe
- ZIP file
- Extract the contents of this package to the directory below, creating folders when they do not already exist, as appropriate:
C:\PHP\8.5\
- In the extracted files, find and edit
php.inito add the following lines:extension=curl extension=gd extension=mbstring extension=openssl extension=zip - Also edit the time zone accordingly:
date.timezone = America/Toronto
Configure PHP in IIS
- Open IIS Manager.
- Select the server node.
- Open FastCGI Settings.

- From the right select "Add Application..."
- Under "Full Path" select or manually enter:
C:\PHP\8.5\php-cgi.exe - "Arguments" is left blank.
- Under "Full Path" select or manually enter:
- Now we open
IIS Manager > Site > Handler Mappings- Add Module Mapping...
- Requested Path =
*.php - Module =
FastCgiModule - Executable =
C:\PHP\8.5\php-cgi.exe - Name =
PHP_via_FastCGI(8.5) - Request Restrictions... > "Mapping" tab > ✅ File or folder > OK
- OK
- Requested Path =
- Add Module Mapping...
- Restart IIS
Note
Some might suggest you edit the Handler Mappings under the Server Node instead of under the Site. I prefer to do this under the Site as a best practice so that I know I am explicitly selecting the right version of PHP for each site, since I might be running a different version of PHP on another site. Check for any Module Mappings configured to map *.php to an older version of PHP like PHP 7.x, and remove those mappings from the site if you see them, to be 100% certain your Grav blog will only be handled via PHP 8.5 (or other PHP 8 version).
Download and Install Grav
- Visit https://getgrav.org/ to download Grav (+ Admin for admin webUI)
- Extract to your folder for storing IIS website directories
C:\IIS-sites\grav-admin\ - Specifically on Windows Server, you will need to add the user group for IIS to have permission to this folder, so that Grav admins can create and edit files through the UI successfully.
- Right click the folder
C:\IIS-sites\grav-admin\in file explorer. - Properties > Security
- Add
IIS_IUSRS
- Right click the folder
- Grant permissions:
- Modify
- Read and Execute
- Write
IIS URL Rewrite Module
If you do not already have it, visit https://www.iis.net/downloads/microsoft/url-rewrite to download and install the x64 installer for URL Rewrite Module 2.1 in your appropriate language at the bottom of the page.
Add URL Rewrite Rules
- Open IIS Manager > Site > URL Rewrite
- Add Rule(s)... > Blank Rule
- Enter the following values and select the following options before applying and saving the rule:
- Name =
Grav - Under Match URL > Pattern =
^(.*)$ - Under Conditions > Add... > Check if input string =
Is Not a File> OK - Under Conditions > Add... > Check if input string =
Is Not a Directory> OK - Under Action > Rewrite URL =
index.php - Under Action > Append query string = ✅
- Under Action > Stop processing of subsequent rules = ✅
- Name =
Set Default Document
- Open IIS Manager > Site > Default Document
- Select
index.php> Select "⬆️ Move Up" until it is at the top of the list.
Test your website by visiting the domain
Grav website should be fully functional now, hosted from IIS on Windows. As of this writing, I am hosting this page on Windows 11 using the instructions here.