One of the eye catching and most talked feature of Sitecore 10 is support on Dockers Container. Sitecore is providing support on Dockers container officially now. It means in case of any issue on Dockers, we can reach to Sitecore for getting support and solutions. It's a huge relief for the company would like to use Dockers Container for the development and production.
Below are the links that can give me more contest on what is Dockers and its benefits
Now would like to talk about how we can install Sitecore 10 on Dockers container.
Software Requirements
- Windows 10 1809 or later
- Windows Server 1809 or later
- Docker Desktop for Windows
Hardware Requirements
- Sitecore recommend having 32 GB of RAM on Developers machine. We can install on 16 GB RAM machine as well but it would be very slow.
- CPU should be quad or higher.
- We should have 25-30 GB of disk space free.
Note: We should have high speed internet connectivity while installing Sitecore 10 on Dockers. It downloads data around 20 GB.
Network Requirement
Required Port | Role | Description |
---|---|---|
433 | Traefik | HTTP Proxy |
8079 | Traefik | Traefik dashboard |
8080 | Traefik | HTTP proxy |
8984 | Solr | Solr API and dashboard |
14330 | SQL | SQL Server |
Make sure the above ports are available to use in your machine.
Prepare your machine for Docker
Enable Hyper-V Windows Feature
Make sure Virtualization is enabled in your machine. You can check this task manager.
Docker Desktop Installation & Configuration
Install Docker Desktop for Windows. After installation of Docker, you will Docker icon available on the windows tray (at the right bottom corner).
Click on the Docker icon in Windows tray and select Switch to Windows Containers. It would take some time for switching. After that you are ready from Docker setting prospective.
Installation Preparation
To start with first thing is need to download the Container Deployment Package from Sitecore. Please make sure before downloading this package you have logged in on the Sitecore. You would find two folders when you extract the downloaded packages. You should be using ltsc2019.
Now you need to decide the Sitecore topology. Mostly developers use xp0 topology so I am taking this for this blog.
Prepare .env file
Inside the folder ltsc2019\sitecore-xp0, you can get .env file. It is an environment configuration for the container and Docker composer loads this file automatically while startup.
If you see the environment file, lots of information is missing like Sitecore admin password, SQL sa password, Sitecore license etc.
Sitecore provide a PowerShell script to fill these information automatically.In the downloaded PowerShell script just provide these two information:
- Sitecore admin password (SitecoreAdminPassword)
- SQL Server sa password (SqlSaPassword)
Execute the below command in the PowerShell before executing the init.ps1 scrip for smooth installation.
Set-ExecutionPolicy -Scope CurrentUser Unrestricted
Execute init.ps1 script in PowerShell (administrator mode)
Provide your Sitecore license files path while executing the init.ps1 file.
It would popup one message for installing certificate. You should click on Yes.
Now your .env file is ready to use. You can see all the missing information in the .env files now.
Sitecore 10 Installation on Docker
Execute below command on PowerShell (administrator) to download the Sitecore container image for Dockers and attaching those images in the local Docker.
docker-compose.exe up --detach
It would take around 40 minutes (depends on the internet speed) to complete. After completing you should see screen similar to this.
If you open the Docker dashboard, you can see all these images would be running conditions.
You can browse your Sitecore CM website now:
CM: https://xp0cm.localhost/sitecore/login
CD: https://xp0cm.localhost
Issues faced during installation and their fixes
I already had SOLR instance running on the port 8984. So I have stopped this service to fixe this issue and free 8984 port to use.
IIS was running on my local machine. So I have stopped the IIS and detach again.
References:
SITECORE CLI LOGIN ERROR - /.well-known/openid-configuration: Bad Gateway
WALKTHROUGH OF ASP.NET RENDERING SDK
SETTING UP ASP.NET RENDERING SDK
DISABLE SITECORE PUBLISHING SERVICE
SETUP SITECORE PUBLISHING SERVICE
SITECORE CONNECT CONNECTOR - CONTENT HUB