Sitecore Installation Framework - XM0 Templates


Sitecore released Sitecore Installation Framework alongside Sitecore 9.0 Initial Release. Sitecore has offered XP Single (XP0) and XM Scaled (XM1) templates for every version of Sitecore since that first release, but they have never offered XM Single (XM0) templates.
The XM1 templates install a Content Delivery (CD) role that I have rarely found use for. Over the years I have built custom XM0 templates for clients and myself, taking a slightly different approach each time. Recently while working on a blog post that required testing on several versions of Sitecore, I had the idea to formalize these XM0 templates and offer them to you, dear community.
Behold: XM0 templates for all 25 versions of Sitecore from Sitecore 9.0 Initial Release through Sitecore 10.5: https://github.com/coreyasmith/sitecore-installation-framework-xm0-templates.
XM0 Template Features
These XM0 templates are a starter kit for your own Sitecore installs. They not only install Sitecore XM in a Standalone configuration, but they install a fully updated headless stack with Sitecore Experience Accelerator (SXA), Headless Services (or JavaScript Services), Sitecore PowerShell Extensions (SPE), and Sitecore Management Services (for versions that support it).
The templates install the latest version of each cumulative hotfix, module, and module hotfix that is compatible with that Sitecore version. For example: the XM0 templates for Sitecore 9.1 Initial Release install Sitecore Identity Server 8.0.37, not 2.0.0, because 8.0.37 is the latest version supported by Sitecore 9.1.
The templates pack several quality-of-life improvements not found in the XP0 and XM1 templates offered by Sitecore:
- Tidy logs: The install script writes logs to a logs folder rather than littering up the install root.
- Package validation:
Validate-Packages.ps1validates that you’ve got all the right packages downloaded for the install. - No unnecessary Solr cores: The templates only create the Solr cores necessary for XM, unlike Sitecore’s XM1 templates that create all the Solr cores required for XP.
- No performance counter errors: The App Pool user is granted permissions to read performance counters so the Sitecore logs aren’t flooded with performance counter errors.
- SIF certificates valid with Node.js: The templates add the SIF root certificate to
NODE_EXTRA_CA_CERTS, so noUNABLE_TO_VERIFY_LEAF_SIGNATUREerrors when your head app connects to Sitecore; no need to setNODE_TLS_REJECT_UNAUTHORIZED=0. - Packages enabled in Sitecore 10.5: Sitecore disables packages by default in 10.5. The templates for 10.5 undo that.
- Automated hotfix package installs: The templates install Sitecore (module) hotfixes by converting them into SCWDPs with the Sitecore Azure Toolkit.
- Automated update package installs: The templates install hotfixes that were provided as
.updatepackages.
There are many other features, particularly around automated install of Sitecore’s hotfix packages, but the above are the biggest highlights to me.
Even if you need to install XP0, you will likely find things in these templates that will benefit your own XP0 installs with SIF.
How I Do Local Installs
My first order of business on any Sitecore XM/XP project is to build a Sitecore install repository. I take an inventory of all modules, cumulative hotfixes, and support patches installed on the production server. I then source the packages needed for install and upload them to a safe store, e.g., SharePoint, OneDrive, Box. Note that this is extremely important, particularly if you’ve installed cumulative hotfixes, because Sitecore deletes old cumulative hotfixes when they upload new ones.
Once I’ve got the packages secured, I build SIF templates to automate a base install of Sitecore that matches production as closely as necessary for local development. I then share this repository with my team so that all developers are developing against an instance of Sitecore that matches production.
I have wasted countless hours unsuccessfully reproducing production bugs on my local instance, only to find that the client’s platform team installed a Sitecore Support patch in production without notifying our team. The goal of the Sitecore install repository is to avoid this wasted time.
As the XM0 templates I have built show: you can automate any Sitecore package install with SIF; there’s no excuse not to. These templates are meant to serve as a starting point for your own Sitecore install repository. Remove what you don’t need; install different patches as necessary; and draw inspiration from the patterns that have been successful for me.
Containers Are Easier Than This
Containers have not been viable for most of my clients, so it does not matter if containers are easier than local installs for those projects.
Windows containers are fussy. There’s always something breaking randomly, or an obscure startup error that I have never seen in all my time using Linux containers (which I 🩷 and use extensively). I used to use containers for Sitecore development personally, but a local IIS install has never let me down. So now I am happier this way.
Conclusion
I hope you find these templates helpful. Please leave a comment with thoughts and suggestions, or open an issue on GitHub.
The blog feature image background is by PHILIPPE SERRAND on Pexels.