CiviCRM on Windows Server 2025 on Azure User Guide
Overview
CiviCRM is open source constituent relationship management software for nonprofits, charities, associations and advocacy groups. Contacts and households, donations and recurring giving, memberships, events, email mailings, cases and reports all live in one web application.
This image runs CiviCRM 6.20.2 Standalone, the edition that needs no separate CMS such as WordPress or Drupal. It runs on Windows Server 2025 Datacenter (Desktop Experience). IIS serves it through PHP 8.4 (FastCGI) at https://<your VM>/civicrm/, and its database is in MariaDB 11.4 LTS on the same VM.
On the first boot of every VM, the image:
- creates this VM's own MariaDB database and passwords;
- runs CiviCRM's own installer, which makes this VM's settings file, site keys and
adminuser with its own password; - makes this VM's own TLS certificate.
Until all that is done, IIS stays off. CiviCRM runs under its own IIS application pool identity, and MariaDB as its own virtual service account listening on the loopback only; neither runs as LocalSystem.
The Windows Server licence is included in the virtual machine price that Microsoft bills. CiviCRM is open source under the GNU AGPL v3 with the CiviCRM Licensing Exception. 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:
- CiviCRM 6.20.2 Standalone from the official release, in
C:\Program Files\CiviCRM, served by IIS as the site CiviCRM in its own application pool CiviCRM (ApplicationPoolIdentity). - The IIS URL Rewrite module from Microsoft. It routes CiviCRM's pages through
index.php, sends HTTP to HTTPS, and refuses CiviCRM's private folder and every file that is not a page or a static asset. - PHP 8.4.28 (NTS x64, FastCGI) in
C:\Program Files\PHP, with the extensions CiviCRM uses and OPcache. - MariaDB Server 11.4.14 LTS in
C:\Program Files\MariaDB 11.4, running asNT SERVICE\MariaDBon127.0.0.1:3306only, with its data inC:\ProgramData\CiviCRM\mariadb-data. - Per-VM secrets made at first boot: the CiviCRM
adminpassword, the MariaDB passwords, CiviCRM's site and signing keys, and a self-signed TLS certificate. - HTTPS on TCP 443, with 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.
- 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.
Prerequisites
You need 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 organisation; choose a larger size for many concurrent users or large mailings.
In the network security group, allow inbound TCP 3389 (Remote Desktop), TCP 443 (CiviCRM) and TCP 80 (the redirect to HTTPS), from your own address ranges only.
Step 1: Deploy from the Azure Marketplace
- Sign in to the Azure Portal and choose Create a resource.
- Search the Marketplace for
CiviCRM on Windows Server 2025by 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, on the Networking tab, narrow each rule's source to your own address range.
- 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:civicrm-windows-server:default:latest
az vm create \
--resource-group <your-rg> \
--name civicrm \
--image cloudimg1647283583153:civicrm-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 civicrm --port 3389 --priority 1000
az vm open-port --resource-group <your-rg> --name civicrm --port 443 --priority 1010
az vm open-port --resource-group <your-rg> --name civicrm --port 80 --priority 1020
az vm open-port opens each port to any address. Afterwards, narrow the rules to your own ranges in the network security group.
First boot takes a few minutes. When the VM first starts, Windows finishes its setup. Then the image creates this VM's database, runs CiviCRM's installer, makes the passwords and the certificate, and starts IIS. Until then, nothing answers on ports 80 and 443. The setup is finished when the file
C:\ProgramData\CiviCRM\cloudimg-firstboot.doneexists (Step 4).
Step 3: Connect with Remote Desktop
Connect to the VM's public IP address with your Remote Desktop client: mstsc on Windows, or Windows App on macOS. Sign in with the administrator name and password you set at deployment.
Open Windows PowerShell as administrator for the commands below.
Step 4: Confirm CiviCRM is running
Get-Content C:\ProgramData\CiviCRM\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
done 2026-12-02T16:12:07.3892747Z address=20.172.171.83 certificate=7477A9FE603871BFFE0E564F5F72157BAC444E78
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

- First line: when first boot finished, with this VM's address and certificate.
- Services: IIS (
W3SVC) and MariaDB start automatically with Windows. - Ports: ports 80 and 443 belong to
Systembecause IIS listens through the Windows HTTP stack. MariaDB listens on127.0.0.1only, so it cannot be reached from the network.
To see the installed versions:
Select-String -Path 'C:\Program Files\CiviCRM\core\xml\version.xml' -Pattern 'version_no' | ForEach-Object { $_.Line.Trim() }
& 'C:\Program Files\PHP\php.exe' -r 'echo PHP_VERSION, PHP_EOL;'
& 'C:\Program Files\MariaDB 11.4\bin\mariadb.exe' --version
<version_no>6.20.2</version_no>
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
Step 5: Read your administrator password
First boot wrote CiviCRM's administrator login and password, and the MariaDB passwords, to a file. Only the SYSTEM account and the Administrators group can read it:
(Get-Acl C:\ProgramData\CiviCRM\civicrm-credentials.txt).Access | Format-Table IdentityReference, FileSystemRights, AccessControlType -AutoSize
Get-Content C:\ProgramData\CiviCRM\civicrm-credentials.txt
IdentityReference FileSystemRights AccessControlType
----------------- ---------------- -----------------
NT AUTHORITY\SYSTEM FullControl Allow
BUILTIN\Administrators FullControl Allow
CiviCRM on Windows Server 2025 by cloudimg: this VM's own credentials, made at its first boot.
CiviCRM: https://20.172.171.83/civicrm/login (on this VM: https://localhost/civicrm/login)
CIVICRM_URL=https://20.172.171.83/
CIVICRM_ADMIN_USERNAME=admin
CIVICRM_ADMIN_PASSWORD=<this VM's admin password>
MARIADB_ROOT_USERNAME=root
MARIADB_ROOT_PASSWORD=<this VM's MariaDB root password>
CIVICRM_DB_NAME=civicrm
CIVICRM_DB_USERNAME=civicrm
CIVICRM_DB_PASSWORD=<this VM's CiviCRM database 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 admin password in CiviCRM (Administer > Users and Permissions) and see the user guide:
https://www.cloudimg.co.uk/guides/civicrm-on-windows-server-2025-azure/

The passwords are hidden above; your file holds the passwords themselves. The CiviCRM login is always admin, and every password is random and different on every VM. Keep them somewhere safe, and change the admin password after your first sign-in (Step 7).
Step 6: Sign in to CiviCRM
On your own computer, browse to https://<vm-public-ip>/civicrm/login. https://<vm-public-ip>/ takes you there too, and http:// addresses redirect to HTTPS.
The certificate is this VM's own self-signed one, so your browser warns about it the first time. Accept it to continue, or install a trusted certificate (see Use your own DNS name and certificate below). On the VM itself, Microsoft Edge trusts it and opens https://localhost/civicrm/login without a warning.

Sign in as admin with the password from Step 5. A wrong password, or a blank username or password, is refused. CiviCRM opens its CiviCRM Home dashboard:

On a new site, the System Status notice lists set-up tasks, such as Organization Setup and Configure Default Mailbox. Select View details and manage alerts to see each one and how to resolve it.
CiviCRM's web installer cannot be reached from the web. It answers only while CiviCRM has no settings file, and first boot made that file before IIS started.
Step 7: Set up your organisation and users
- Your organisation: open Administer > Administration Console > Organization Address and Contact Info and enter your organisation's name, email address and postal address.
- Your contact record: search for Admin, Standalone under Contacts > Find Contacts and set its name and email address. The installer gives it the placeholder
admin@example.com, and the default organisation contact's email is a placeholder too.

- The admin password and named users: go to Administer > Users and Permissions. Change the
adminpassword there, and create a user for each person who will use CiviCRM rather than sharingadmin. - Email: follow the Configure Default Mailbox item in System Status, and set up your outbound mail server under Administer > System Settings > Outbound Email.
Step 8: Check the web server and the services' identities
Open Internet Information Services (IIS) Manager and select Application Pools. CiviCRM serves the site with No Managed Code (PHP runs through FastCGI) under its own ApplicationPoolIdentity, a low privilege account.

The same from PowerShell:
Import-Module WebAdministration
Get-ChildItem IIS:\AppPools | Select-Object Name, State, managedRuntimeVersion, @{n='Identity';e={$_.processModel.identityType}} | Format-Table -AutoSize
Get-CimInstance Win32_Service -Filter "Name='MariaDB'" | Format-List Name, StartName, StartMode, State
name state managedRuntimeVersion Identity
---- ----- --------------------- --------
CiviCRM Started ApplicationPoolIdentity
Name : MariaDB
StartName : NT SERVICE\MariaDB
StartMode : Auto
State : Running
To check the redirect, the sign-in page, that CiviCRM's private folder is never served, and this VM's certificate and bindings:
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() }
}
Get-Status http://localhost/civicrm/login
Get-Status https://localhost/
Get-Status https://localhost/civicrm/login
Get-Status https://localhost/private/civicrm.settings.php
Get-ChildItem Cert:\LocalMachine\My | Where-Object FriendlyName -like 'CiviCRM*' | Format-List Subject, NotAfter, Thumbprint, FriendlyName
Get-WebBinding -Name CiviCRM | Format-Table protocol, bindingInformation -AutoSize
301 Moved Permanently https://localhost/civicrm/login
302 Found /civicrm/home
200 OK
404 Not Found
Subject : CN=20.172.171.83
NotAfter : 12/2/2029 4:11:37 PM
Thumbprint : 7477A9FE603871BFFE0E564F5F72157BAC444E78
FriendlyName : CiviCRM web server (this VM, cloudimg)
protocol bindingInformation
-------- ------------------
http *:80:
https *:443:

Server Components
| Component | Version or setting | Where |
|---|---|---|
| CiviCRM | 6.20.2 Standalone | C:\Program Files\CiviCRM (the site root) |
| IIS | Site CiviCRM on the site root, pool CiviCRM (ApplicationPoolIdentity, No Managed Code), PHP through FastCGI, URL Rewrite 2.1 | C:\Windows\System32\inetsrv |
| PHP | 8.4.28 NTS x64, php.ini from upstream's production settings |
C:\Program Files\PHP |
| MariaDB Server | 11.4.14 LTS, service MariaDB, NT SERVICE\MariaDB, Automatic, 127.0.0.1:3306 |
C:\Program Files\MariaDB 11.4, data C:\ProgramData\CiviCRM\mariadb-data |
| HTTPS | TCP 443, this VM's self-signed certificate (RSA 2048, private key not exportable, valid 3 years) | Cert:\LocalMachine\My, friendly name "CiviCRM web server (this VM, cloudimg)" |
| HTTP | TCP 80, redirects to HTTPS | Windows Firewall rules in the group CiviCRM |
| Windows Server | 2025 Datacenter, Desktop Experience, build 26100 |
Filesystem Layout
| Path | What it holds |
|---|---|
C:\Program Files\CiviCRM\ |
CiviCRM's code (core, ext, index.php). Read-only to the web server |
C:\Program Files\CiviCRM\private\civicrm.settings.php |
CiviCRM's settings: the database connection, this VM's site and signing keys, and the base URL. Read-only to the web server and never served |
C:\Program Files\CiviCRM\private\ |
CiviCRM's cache, logs, translations, attachments and temporary files. Never served |
C:\Program Files\CiviCRM\public\ |
Files CiviCRM publishes, such as images in mailings. The web server can write here, but no PHP runs from it |
C:\ProgramData\CiviCRM\mariadb-data\ |
The MariaDB database (my.ini is here too). MariaDB's service account, SYSTEM and Administrators only |
C:\ProgramData\CiviCRM\civicrm-credentials.txt |
This VM's passwords. SYSTEM and Administrators only |
C:\ProgramData\CiviCRM\log\ |
PHP's error log (php-errors.log) |
C:\ProgramData\CiviCRM\cloudimg-firstboot.log |
What first boot did (never a password) |
Managing the Services
From an elevated PowerShell window:
# restart the web server (after a php.ini or IIS change)
iisreset
# restart the database
Restart-Service MariaDB
To open the database as root (the password is MARIADB_ROOT_PASSWORD in the credentials file):
& 'C:\Program Files\MariaDB 11.4\bin\mariadb.exe' -u root -p civicrm
On Startup
At the first start of your VM, the scheduled task cloudimg-firstboot runs as SYSTEM:
- It keeps IIS stopped and disabled, and waits until Azure has finished setting up the VM.
- It creates this VM's MariaDB instance: the service, the root password, and the
civicrmdatabase and its user, on the loopback only. - It runs CiviCRM's own installer without the web. The installer writes
civicrm.settings.phpwith this VM's keys, creates the tables, and createsadminwith a random password, which CiviCRM stores only as a hash. - It writes
C:\ProgramData\CiviCRM\civicrm-credentials.txt, readable by administrators only. - It makes this VM's TLS certificate, named for the VM's public and private addresses, and binds it to port 443.
- It sets IIS to start automatically, starts it, and waits for the sign-in page to answer. Then it writes
cloudimg-firstboot.doneand removes itself.
If anything fails, IIS stays stopped and disabled, and the task tries again at the next start. On every later start, IIS and MariaDB start with Windows.
Security Recommendations
- Keep ports 80 and 443 to your own networks. CiviCRM holds your contacts, donations and members. Open 443 only to the networks your users are on, and prefer a VPN or private network.
- Change the
adminpassword after your first sign-in, and create named users with only the permissions they need. - Keep CiviCRM up to date. New releases and security releases are announced at civicrm.org. Back up first (below), then follow CiviCRM's upgrade documentation for Standalone. Your data and settings live in the database and in the
privateandpublicfolders, so keep those; CiviCRM offers its database upgrade when you next sign in asadmin. - Extensions: the web server cannot write CiviCRM's code or
extfolder, so extensions are not installed from the browser. To add one, download it as an administrator on the VM, check it, and copy it intoC:\Program Files\CiviCRM\ext. Then enable it under Administer > System Settings > Extensions.
Use your own DNS name and certificate
First boot's certificate is self-signed, and CiviCRM builds its links (in emails and password resets) from the VM's addresses only. To use your own DNS name:
- Point your DNS name at the VM's public IP address.
- Import a certificate for that name (a
.pfxwith its private key) intoCert:\LocalMachine\My, and bind it to port 443 of the CiviCRM site:
powershell
$cert = Import-PfxCertificate -FilePath C:\path\to\crm.example.org.pfx -CertStoreLocation Cert:\LocalMachine\My -Password (Read-Host -AsSecureString 'PFX password')
Import-Module WebAdministration
(Get-WebBinding -Name 'CiviCRM' -Protocol https -Port 443).AddSslCertificate($cert.Thumbprint, 'My')
- Tell CiviCRM its new name. As administrator, open
C:\Program Files\CiviCRM\private\civicrm.settings.phpin Notepad and find the$cloudimgHostslist near the top. It holds this VM's own addresses: its public and private IP, its computer name and localhost. Add your name in lower case, for example'crm.example.org'. To make it the address CiviCRM uses by default (in scheduled emails, for example), also set$cloudimgBaseto'https://crm.example.org'. Save the file and browse tohttps://crm.example.org/civicrm/login.
CiviCRM follows the address the browser used only when it is in that list. A request with any other Host header gets the default address, so a forged Host header can never steer a password reset link.
Maintenance
- Windows updates: Windows Update is on, as Microsoft ships it. Restarting the VM restarts IIS and MariaDB automatically.
- Scheduled jobs: CiviCRM's scheduled jobs (sending mailings, reminders, and processing bounces) need something to run them regularly; the image does not schedule them. Set them up as CiviCRM's documentation describes for Standalone, once your outbound email is configured.
- Back up your data: CiviCRM keeps its data in the database and in the
privateandpublicfolders. Back up all three together, with the settings file:
powershell
New-Item -ItemType Directory C:\Backup -Force | Out-Null
& 'C:\Program Files\MariaDB 11.4\bin\mariadb-dump.exe' -u root -p --single-transaction --routines --triggers --result-file=C:\Backup\civicrm.sql civicrm
Compress-Archive -Path 'C:\Program Files\CiviCRM\private', 'C:\Program Files\CiviCRM\public' -DestinationPath C:\Backup\civicrm-files.zip -Force
Or use Azure Backup for the whole VM.
- Logs:
- IIS: C:\inetpub\logs\LogFiles
- PHP's error log: C:\ProgramData\CiviCRM\log\php-errors.log
- CiviCRM's own logs: C:\Program Files\CiviCRM\private\log
- MariaDB: C:\ProgramData\CiviCRM\mariadb-data\<computer name>.err
- First boot: C:\ProgramData\CiviCRM\cloudimg-firstboot.log
- Firewall: Windows Firewall allows 443 and 80 through the rules in the CiviCRM group; the network security group decides who can reach them.
Troubleshooting
CiviCRM 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\CiviCRM\cloudimg-firstboot.log
The sign-in is refused
The username is admin (lower case). Copy the password from CIVICRM_ADMIN_PASSWORD= in C:\ProgramData\CiviCRM\civicrm-credentials.txt. If you changed the password in CiviCRM, the file still holds the first one.
Links point to the IP address instead of your DNS name
Add your DNS name to $cloudimgHosts in civicrm.settings.php (see Use your own DNS name and certificate), and set $cloudimgBase if you want it as the default.
Uploads larger than 64 MB fail
PHP accepts up to 64 MB per uploaded file and 128 MB per request. Raise upload_max_filesize and post_max_size in C:\Program Files\PHP\php.ini, and maxAllowedContentLength in the site's web.config, then run iisreset.
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.
CiviCRM is free and open source software licensed under the GNU AGPL v3 with the CiviCRM Licensing Exception; cloudimg is not affiliated with or endorsed by CiviCRM LLC or the CiviCRM project. Microsoft and Windows Server are trademarks of the Microsoft group of companies.