How To Install Sitecore 9

In this tutorial, you will learn how to install Sitecore 9 on your local PC.  In terms of installing Sitecore, version 9 is completely different than other versions.  Gone are the days running the Sitecore installer.  In version 9, you will be using a lot more Powershell.  For old Sitecore hands, this change might be daunting at first.  Speaking from experience, the install process is still relatively simple.

Useful Resources

Prerequisites

First, for people brand new to Sitecore, you will need an account to access https://dev.sitecore.net/Downloads.aspx and a valid license.  If you don't have either of these, then I suggest you read Why Is Sitecore Development So Difficult To Get Into?.

Next, you will need a local version of Solr installed that runs over HTTPS.  For a complete walkthrough of how to do this, check out this tutorial here.

You'll also need all the usual suspects.NET, Visual Studio, SQL, IIS and Powershell.  If you're working on a new PC, I suggest creating a very barebones vanilla .NET website and just make sure everything works.   If your system is set-up, this process will be really easy.  If say your SQL server hasn't got mixed mode authentication enabled for example, the installer will fail and troubleshooting the exact cause will be more troublesome as the area of impact will be larger.  

Create An Install Folder

To install Sitecore, you'll need to create a folder on your PC with the install files, some config and a license.  I created mine on my D drive, 'D:\Sitecore9Installation'. 

  • To get the Sitecore install files, head over to the dev portal and download version 9.  Up-zip the file and copy the 'Sitecore 9.0.0 rev. 171002 (OnPrem)_single.scwdp.zip' and the 'Sitecore 9.0.0 rev. 171002 (OnPrem)_xp0xconnect.scwdp.zip into your install folder
  • Copy your license file into the folder.
  • Extract the contents of 'XP0 Configuration files rev.171002.zip' and copy all the config files into the install folder

My installation folder looks like this:

Installing The Sitecore Install Framework

The older installer is dead. To install Sitecore you will need to use the 'SIF' which is installed via Sitecore's Myget repository via Powershell.

# Add the Sitecore MyGet repository to PowerShell
Register-PSRepository -Name SitecoreGallery -SourceLocation https://sitecore.myget.org/F/sc-powershell/api/v2

# Install the Sitecore Install Framwork module
Install-Module SitecoreInstallFramework

# Install the Sitecore Fundamentals module (provides additional functionality for local installations like creating self-signed certificates)
Install-Module SitecoreFundamentals

# Import the modules into your current PowerShell context (if necessary)
Import-Module SitecoreFundamentals
Import-Module SitecoreInstallFramework

NOTE: Don't re-run this. I stupidly tried to run this twice and it makes the script fail. After some debugging, my SIF was installed in 'C:\Program Files\WindowsPowerShell\Modules'

Install The Core Files

This is the step where we pull everything together and install the core files.

Within the Sitecore 9 install guide, half-way through the document, you'll find a PowerShell script to install Sitecore.  If you try and copy and paste that script, you'll probably encounter issues.  Instead, I used one I found online, which you can copy and paste:

#define parameters 
$prefix = "sc90"
$PSScriptRoot = "C:SitecoreInstallSitecore 9.0.0 rev. 171002"
$XConnectCollectionService = "$prefix.xconnect"
$sitecoreSiteName = "$prefix.local"
$SolrUrl = "https://localhost:8983/solr"
$SolrRoot = "C:solr-6.6.2"
$SolrService = "solr662"
$SqlServer = "localhost"
$SqlAdminUser = "sc90"
$SqlAdminPassword = "password" 
 
#install client certificate for xconnect 
$certParams = 
@{     
    Path = "$PSScriptRootxconnect-createcert.json"     
    CertificateName = "$prefix.xconnect_client" 
} 
Install-SitecoreConfiguration @certParams -Verbose

#install solr cores for xdb 
$solrParams = 
@{
    Path = "$PSScriptRootxconnect-solr.json"     
    SolrUrl = $SolrUrl    
    SolrRoot = $SolrRoot  
    SolrService = $SolrService  
    CorePrefix = $prefix 
} 
Install-SitecoreConfiguration @solrParams -Verbose

#deploy xconnect instance 
$xconnectParams = 
@{
    Path = "$PSScriptRootxconnect-xp0.json"     
    Package = "$PSScriptRootSitecore 9.0.0 rev. 171002 (OnPrem)_xp0xconnect.scwdp.zip"
    LicenseFile = "$PSScriptRootlicense.xml"
    Sitename = $XConnectCollectionService   
    XConnectCert = $certParams.CertificateName    
    SqlDbPrefix = $prefix  
    SqlServer = $SqlServer  
    SqlAdminUser = $SqlAdminUser
    SqlAdminPassword = $SqlAdminPassword
    SolrCorePrefix = $prefix
    SolrURL = $SolrUrl      
} 
Install-SitecoreConfiguration @xconnectParams -Verbose

#install solr cores for sitecore 
$solrParams = 
@{
    Path = "$PSScriptRootsitecore-solr.json"
    SolrUrl = $SolrUrl
    SolrRoot = $SolrRoot
    SolrService = $SolrService     
    CorePrefix = $prefix 
} 
Install-SitecoreConfiguration @solrParams -Verbose
 
#install sitecore instance 
$sitecoreParams = 
@{     
    Path = "$PSScriptRootsitecore-XP0.json"
    Package = "$PSScriptRootSitecore 9.0.0 rev. 171002 (OnPrem)_single.scwdp.zip" 
    LicenseFile = "$PSScriptRootlicense.xml"
    SqlDbPrefix = $prefix  
    SqlServer = $SqlServer  
    SqlAdminUser = $SqlAdminUser     
    SqlAdminPassword = $SqlAdminPassword     
    SolrCorePrefix = $prefix  
    SolrUrl = $SolrUrl     
    XConnectCert = $certParams.CertificateName     
    Sitename = $sitecoreSiteName         
    XConnectCollectionService = "https://$XConnectCollectionService"    
} 
Install-SitecoreConfiguration @sitecoreParams -Verbose

I'll quickly cover the options that you will need to manually configure the script and, hopefully, they should be pretty simple

  • $prefix: The name of your website.  This is the name that will be created in IIS etc..
  • $PSScriptRoot: The folder location for your Sitecore install folder, created in the step above, e.g. 'D:\Sitecore9Installation'
  • $SolrUrl: The Solr URL. The default should be 'https://solr-sc9:8983/solr'.  Make sure Solr is running first before running the install script!
  • $SqlServer: SQL Server URL, mine is '.\sqlexpress'
  • $SqlAdminUser: SQL User, mine is 'sa'
  • $SqlAdminPassword: Your DB password (check these work first!)

NOTE: If you look through the script above, you'll notice it references the exact versions of Sitecore ZIP files within your install directory, e.g. 9.0.0 rev. 171002. If you are using a slightly different revision, you'll get a file not found error thrown. Make sure the sitecoreParams -> Package matches the name of the files within your Install directory!

Alternative Approach

I managed to get this up and running pretty easily, however, if you struggle, or you simply can't be arsed with all the PowerShell, another alternative you could consider is, <a href="http://www.rockpapersitecore.com/2017/10/introducing-sif-less-for-easy-sitecore-9-installation/">SIF-less</a>.

Install

If everything works as expected Sitecore should now be installed and launched in your browser!

Post-Install

DO not forget to run this. Within SQL manager, you will need to run a SQL script to allow xConntect to run smoothly.

  :SETVAR DatabasePrefix sitecore91
:SETVAR UserName collectionuser
:SETVAR Password Test12345
:SETVAR ShardMapManagerDatabaseNameSuffix _Xdb.Collection.ShardMapManager
:SETVAR Shard0DatabaseNameSuffix _Xdb.Collection.Shard0 
:SETVAR Shard1DatabaseNameSuffix _Xdb.Collection.Shard1

GO

IF(SUSER_ID('$(UserName)') IS NULL) 
BEGIN  
       CREATE LOGIN [$(UserName)] WITH PASSWORD = '$(Password)'; END; 
GO 
 
USE [$(DatabasePrefix)$(ShardMapManagerDatabaseNameSuffix)]  
IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N'$(UserName)') BEGIN 
    CREATE USER [$(UserName)] FOR LOGIN [$(UserName)]   
       GRANT SELECT ON SCHEMA :: __ShardManagement TO [$(UserName)]        GRANT EXECUTE ON SCHEMA :: __ShardManagement TO [$(UserName)] END; 
GO 
 
USE [$(DatabasePrefix)$(Shard0DatabaseNameSuffix)]  
 
IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N'$(UserName)') BEGIN 
    CREATE USER [$(UserName)] FOR LOGIN [$(UserName)]   
       EXEC [xdb_collection].[GrantLeastPrivilege] @UserName = '$(UserName)' END; 
GO 
 
USE [$(DatabasePrefix)$(Shard1DatabaseNameSuffix)]  
 
IF NOT EXISTS (SELECT * FROM sys.database_principals WHERE name = N'$(UserName)') BEGIN 
    CREATE USER [$(UserName)] FOR LOGIN [$(UserName)]   
       EXEC [xdb_collection].[GrantLeastPrivilege] @UserName = '$(UserName)' END; 
 
GO 
  

Note You need to run this script in SQLCMD mode; More info to do that can be found here.

 

submit to reddit

Jon D Jones

Software Architect, Programmer and Technologist Jon Jones is founder and CEO of London-based tech firm Digital Prompt. He has been working in the field for nearly a decade, specializing in new technologies and technical solution research in the web business. A passionate blogger by heart , speaker & consultant from England.. always on the hunt for the next challenge

Back to top