Run script to prepare for deployment

Version: 10.5

The Sitecore container deployment package provides a script for automating some of the preparations for Sitecore deployment to a developer machine. The compose-init.ps1 file is located with the .env file.

The compose-init.ps1 file performs the following actions:

  • compresses the Sitecore license file
  • creates the Identity Server token signing certificate
  • populates the .env file
  • generates TLS/HTTPS certificates
  • installs the root certificate into your Trusted Root Certification Authorities
  • updates Windows host names

The script accepts a number of parameters. The following table shows the parameters you can use.

ParameterDescriptionExampleMandatory
LicenseXmlPathPath to the Sitecore license file. You must specify this.-LicenseXmlPath "c:\license.xml"Yes
TopologyThe name of your chosen topology.-Topology "XM1"No
IdHostA custom host name for the Identity Server.-IdHost mySCID_1No
CdHostA custom host name for the CD server.-CdHost mySCCD_1No
CmHostA custom host name for the CM server.-CmHost mySCCM_1No
SitecoreAdminPasswordA custom password for the admin user.-SitecoreAdminPassword df8732V45GHNo
SqlSaPasswordA custom password for the database SA users.-SqlSaPassword poi34l2xGH45No
EnvFilePathPath to the .env file. Specify this if the .env file is located in a different folder.-EnvFilePath "c:\compose\.env"No
SitecoreGalleryRepositoryLocationPath to the location of the Sitecore Gallery repository. Specify this if you are not using the official repository.-SitecoreGalleryRepositoryLocation "https:\\<path_to_repository>"No
IdFolderPath to the folder where the Identity Server data are located. Specify this if the data are not located in .\id.-IdFolder "c:\compose\id"No
CertDataFolderPath to the folder where the traefik certificates are located. Specify this if the certificates are not located in .\traefik\certs.-CertDataFolder "c:\compose\certs"No
SqlServerName of the Sql server instance (only for upgrade.env file)-SqlServer “mssql”No
SqlServerFolderPath to the folder where the Sql Server data are located. Specify this if the data are not located in .\mssql.-SqlServerFolder "c:\compose\mssql"No
SqlUserNameName of the user of sql server (only for upgrade.env file)-SqlUserName “sa”No
SqlServerCertificatePasswordA custom password for the mssql.pfx certificate file.-SqlServerCertificatePassword "poi34l2xGH45"No
IsAlwaysEncryptedOption for sql server which allows using of encryption (only for upgrade.env file)-IsAlwaysEncrypted $falseNo
ProcessingEngineTasksDatabaseUsernameName of the least privileged user in database (only for upgrade.env file)-ProcessingEngineTasksDatabaseUsername “dbo”No
SolrConnectionPasswordPassword for user used in connection of Sitecore to Solr-SolrConnectionPassword df8732V45GHYes

If you do not specify passwords for the admin or SA users, the script assigns default values to them.

To use the script:

  1. Open a Windows command window with administrator access. Navigate to the folder containing the compose-init.ps1 file.

  2. Run the script. For example:

    .\compose-init.ps1 -Topology "<your_topology>" -LicenseXmlPath "<path_to_the_license_file>" -IdHost <custom_Id_host_name> -CdHost <custom_cd_host_name> -CmHost <custom_cm_host_name> -SitecoreAdminPassword <your_password_for_Sitecore_admin> -SqlSaPassword <your_password_for_sql_sa_user>
    Note

    If your Traefik certificates folder already contains certificates the script does not install new certificates.

If you have suggestions for improving this article, let us know!