Blog/Sitecore ·2 Dec 2026 ·

How to run Sitecore 10.5 in Docker with SPE, SXA and Headless Services

A step by step setup of a local Sitecore 10.5 developer workstation on Docker, using the official Container Deployment Package (Traefik), extended with Sitecore PowerShell Extensions, Sitecore Experience Accelerator and Sitecore Headless Services.

Why Docker?

With containers, the whole environment lives in a single folder. You can start it, stop it, and throw it away without leaving anything on the host. That is very handy.

Out of the box the official package gives you a vanilla Sitecore. On a real project you almost always need modules on top of it, like Sitecore PowerShell Extensions (SPE), Sitecore Experience Accelerator (SXA) or Sitecore Headless Services. So this post covers both parts: getting vanilla Sitecore running, and extending it with additional modules.

Everything below was done on Sitecore XP 10.5.0 rev. 014188.

0. Prerequisites

The Sitecore documentation explains the software, hardware and network requirements.

What is not mentioned there is that Docker Desktop needs to be switched to Windows containers, by right-clicking the Docker icon in the tray and selecting Switch to Windows containers….

However, a default Docker installation does not always offer this option. If you don’t see it when you right-click, you need to uninstall Docker, manually clean up the Docker files from C:\Program Files\Docker, C:\ProgramData\Docker and %LOCALAPPDATA%\Programs\DockerDesktop, and install it again as administrator, for all users. During the installation make sure to select the Windows containers checkbox.

Docker Installation guide for Windows

Also make sure that the ports used by the containers are free. If you have a local IIS, SQL Server or Solr from a non-container installation, stop them first. IIS listening on port 443 is the most common conflict:

iisreset /stop

1. Download the Container Deployment Package

Go to the Sitecore Experience Platform 10.5 download page, find the Sitecore Container deployments section and click the Container Deployment Package (Traefik) link.

At the moment of writing the link points to a GitHub release. Download SitecoreContainerDeployment.10.5.0.014188.3067.zip from its assets and unzip it.

The same section also links to the Developer Workstation Deployment with Docker Guide, and to the Image and Tags List, which you will need later to pick module image versions.

2. Pick the topology folder

Inside the zip you will find:

compose
├── ltsc2022
│   ├── xm1
│   ├── xp0
│   ├── xp1
│   └── upgrade
└── ltsc2025
    ├── xm1
    ├── xp0
    ├── xp1
    └── upgrade
k8s
└── ...

Depending on your Windows version choose ltsc2022 or ltsc2025. Then pick the topology: xm1, xp0 or xp1.

The remaining part of this blog post assumes the xm1 topology.

3. Run compose-init.ps1

The .env file already contains things like the registry, image versions and host names, but the passwords, secrets, certificates and license are empty. They are filled in when you run compose-init.ps1. Open PowerShell as administrator, go to the xm1 folder and run:

.\compose-init.ps1

You will be asked for the path to your license file and passwords.

The script also creates the TLS certificates, trusts its root certificate and adds xm1cm.localhost, xm1cd.localhost and xm1id.localhost to your hosts file.

4. Start vanilla Sitecore

Still in the xm1 folder:

docker compose up -d

The first run might take a while, as it downloads multiple Docker images.

When it’s done, open https://xm1cm.localhost/sitecore and log in as admin with the password you passed to the init script.

5. Add SPE, SXA and Headless Services

The Sitecore module reference page contains information about the image repository and the Dockerfile instructions needed for each module you want to install.

5.1. Extend .env

Add these lines at the end of .env, so we can use them instead of hardcoding them. SITECORE_DOCKER_MODULES_REGISTRY is the prefix of the registry that contains the module images. We also need three variables with the versions of the images that we will use.

SITECORE_DOCKER_MODULES_REGISTRY=scr.sitecore.com/sxp/modules/
SITECORE_SPE_VERSION=8.0-ltsc2025
SITECORE_SXA_VERSION=10.5-ltsc2025
SITECORE_HEADLESS_SERVICES_VERSION=23.0-ltsc2025

If you picked the ltsc2022 folder, use the -ltsc2022 tags instead.

5.2. The folder structure

Inside the xm1 folder, create a build folder. In it, create a subfolder for each image we customize (cd, cm, mssql-init and solr-init), each with an empty file called Dockerfile. Next to docker-compose.yml, create an empty docker-compose.override.yml.

xm1
├── build
│   ├── cd
│   │   └── Dockerfile
│   ├── cm
│   │   └── Dockerfile
│   ├── mssql-init
│   │   └── Dockerfile
│   └── solr-init
│       └── Dockerfile
├── docker-compose.yml
└── docker-compose.override.yml

5.3. The cd Dockerfile

build\cd\Dockerfile:

# escape=`

ARG BASE_IMAGE
ARG HEADLESS_SERVICES_IMAGE
ARG SXA_RESOURCES_IMAGE

FROM ${HEADLESS_SERVICES_IMAGE} as hs
FROM ${SXA_RESOURCES_IMAGE} as sxa
FROM ${BASE_IMAGE}

COPY --from=hs C:\module\cd\content C:\inetpub\wwwroot
COPY --from=hs C:\module\tools C:\module\tools

COPY --from=sxa C:\module\cd\content C:\inetpub\wwwroot
COPY --from=sxa C:\module\tools C:\module\tools

RUN C:\module\tools\Initialize-Content.ps1 -TargetPath C:\inetpub\wwwroot; `
  Remove-Item -Path C:\module -Recurse -Force;

5.4. The cm Dockerfile

build\cm\Dockerfile:

# escape=`

ARG BASE_IMAGE
ARG HEADLESS_SERVICES_IMAGE
ARG SPE_RESOURCES_IMAGE
ARG SXA_RESOURCES_IMAGE

FROM ${HEADLESS_SERVICES_IMAGE} as hs
FROM ${SPE_RESOURCES_IMAGE} as spe
FROM ${SXA_RESOURCES_IMAGE} as sxa
FROM ${BASE_IMAGE}

COPY --from=hs C:\module\cm\content C:\inetpub\wwwroot
COPY --from=hs C:\module\tools C:\module\tools

COPY --from=spe C:\module\cm\content C:\inetpub\wwwroot

COPY --from=sxa C:\module\cm\content C:\inetpub\wwwroot
COPY --from=sxa C:\module\tools C:\module\tools

RUN C:\module\tools\Initialize-Content.ps1 -TargetPath C:\inetpub\wwwroot; `
  Remove-Item -Path C:\module -Recurse -Force;

5.5. The mssql-init Dockerfile

build\mssql-init\Dockerfile:

# escape=`

ARG BASE_IMAGE
ARG HEADLESS_SERVICES_IMAGE
ARG SPE_RESOURCES_IMAGE

FROM ${HEADLESS_SERVICES_IMAGE} as hs
FROM ${SPE_RESOURCES_IMAGE} as spe
FROM ${BASE_IMAGE}

COPY --from=hs C:\module\db C:\resources\jss
COPY --from=spe C:\module\db C:\resources\spe

5.6. The solr-init Dockerfile

build\solr-init\Dockerfile:

# escape=`

ARG BASE_IMAGE
ARG SXA_RESOURCES_IMAGE

FROM ${SXA_RESOURCES_IMAGE} as sxa
FROM ${BASE_IMAGE}

COPY --from=sxa C:\module\solr\cores-sxa.json C:\data\cores-sxa.json

5.7. docker-compose.override.yml

Docker Compose automatically merges docker-compose.override.yml on top of docker-compose.yml. That way the original file stays untouched, and you can upgrade it later by replacing it with a newer one.

services:
  cd:
    image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-cd:${VERSION:-latest}
    build:
      context: ./build/cd
      args:
        BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xm1-cd:${SITECORE_VERSION}
        HEADLESS_SERVICES_IMAGE: ${SITECORE_DOCKER_MODULES_REGISTRY}sitecore-headless-services-xm1-assets:${SITECORE_HEADLESS_SERVICES_VERSION}
        SXA_RESOURCES_IMAGE: ${SITECORE_DOCKER_MODULES_REGISTRY}sitecore-sxa-xm1-assets:${SITECORE_SXA_VERSION}
  cm:
    image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-cm:${VERSION:-latest}
    build:
      context: ./build/cm
      args:
        BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xm1-cm:${SITECORE_VERSION}
        HEADLESS_SERVICES_IMAGE: ${SITECORE_DOCKER_MODULES_REGISTRY}sitecore-headless-services-xm1-assets:${SITECORE_HEADLESS_SERVICES_VERSION}
        SPE_RESOURCES_IMAGE: ${SITECORE_DOCKER_MODULES_REGISTRY}sitecore-spe-assets:${SITECORE_SPE_VERSION}
        SXA_RESOURCES_IMAGE: ${SITECORE_DOCKER_MODULES_REGISTRY}sitecore-sxa-xm1-assets:${SITECORE_SXA_VERSION}
  mssql-init:
    image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-mssql-init:${VERSION:-latest}
    build:
      context: ./build/mssql-init
      args:
        BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xm1-mssql-init:${SITECORE_VERSION}
        HEADLESS_SERVICES_IMAGE: ${SITECORE_DOCKER_MODULES_REGISTRY}sitecore-headless-services-xm1-assets:${SITECORE_HEADLESS_SERVICES_VERSION}
        SPE_RESOURCES_IMAGE: ${SITECORE_DOCKER_MODULES_REGISTRY}sitecore-spe-assets:${SITECORE_SPE_VERSION}
  solr-init:
    image: ${REGISTRY}${COMPOSE_PROJECT_NAME}-solr-init:${VERSION:-latest}
    build:
      context: ./build/solr-init
      args:
        BASE_IMAGE: ${SITECORE_DOCKER_REGISTRY}sitecore-xm1-solr-init:${SITECORE_VERSION}
        SXA_RESOURCES_IMAGE: ${SITECORE_DOCKER_MODULES_REGISTRY}sitecore-sxa-xm1-assets:${SITECORE_SXA_VERSION}

5.8. Build and start

If the vanilla environment is still running, stop it first:

docker compose down

Then build the custom images and start everything again:

docker compose up -d --build

6. Check that the modules are there

  • SPE: on the Launchpad you should now see PowerShell ISE and PowerShell Reports. Open the ISE and run Get-Item master:/ to be sure it works.
  • SXA: in the Content Editor, right-click the /sitecore/content item and you should see the SXA Tenant option under Insert.
  • Headless Services: in the Content Editor you should see the JSS templates under /sitecore/templates/Foundation/JavaScript Services.

Day to day

docker compose up -d         # start in detached mode
docker compose up -d --build # rebuild the images after changing a Dockerfile or a module version, then start
docker compose down          # stop, data in mssql-data and solr-data is kept

To start completely fresh, run docker compose down and delete the contents of mssql-data and solr-data, but leave the readme.md files in place. The next docker compose up -d deploys clean databases and cores again.

Upgrading a module is now a one-line change: bump SITECORE_SPE_VERSION, SITECORE_SXA_VERSION or SITECORE_HEADLESS_SERVICES_VERSION in .env, then run docker compose up -d --build.

Happy Sitecoring!

Written by

Bartłomiej Mucha

Sitecore MVP Technology 2019

I started programming on my first computer, the Commodore 64, in 2000, and have been implementing solutions in Sitecore since 2011.

Connect on LinkedIn →

Related reading