Sitecore 9.0.2 installation with SQL Server 2017 on Ubuntu 16.04

A few days back I was reading about SQL Server 2017 installation on Ubuntu. I tried it by installing and configuring the SQL Server 2017 on the Ubuntu virtual machine. It worked well and the main surprise was it ran with 2GB of RAM given to Ubuntu virtual machine.

After that, I engaged in installing Sitecore 9.0 update 2, and while installing SQL Server, a thought came to try SQL Server 2017 on Ubuntu with Sitecore 9.0 update 2. I ran through a couple of installation failure and thought to share the installation steps with precise information so any other Sitecore guy should not waste his time.

Let’s make it work.

  1. Prepare Windows Server 2016 / Windows 10 with following installed (Refer installation guide for Sitecore 9.0 update 2):
    – IIS 10.0 / IIS 8.5
    – .NET Framework 4.6.2 or later
    – Microsoft Visual C++ 2015 Redistributable Requirements
    – Solr 6.6.2 (HTTPS enabled)
    – Apply for file system permissions
    – Microsoft PowerShell version 5.1 or later
    – Web Platform Installer 5.0 – See the next step to see what to install
  2. Install only the following components using Web Platform Installer
    – Web Deploy 3.6 Hosting Servers
    – URL Rewrite 2.1
  3. Install the Sitecore Installation Framework using the following commands:
    # Add PowerShell gallery
    Register-PSRepository -Name SitecoreGallery -SourceLocation https://sitecore.myget.org/F/sc-powershell/api/v2
    
    # Install SIF module
    Install-Module SitecoreInstallFramework
    
    #If you need to update it later use the following command:
    Update-Module SitecoreInstallFramework
    
  4. Install SQL Server Management Studio for 2017. Download it from here.
  5. Now, according to the KB article, https://kb.sitecore.net/articles/019579, we need to work out for some registry entries.
    1. Locate the installation folder of SSMS version that you installed and browse to the bin directory. In my case, it is ‘C:\Program Files (x86)\Microsoft SQL Server\140\DAC\bin’.
    2. Create a new string key named ‘DacFxPath‘, under the registry key ‘\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\3‘, and set the path to point to the SSMS bin directory path.
    3. Create another new string key named ‘DacFxDependenciesPath‘, under the registry key ‘\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\IIS Extensions\MSDeploy\3′, and set the path to point to the SSMS bin directory path.
  6. Install Ubuntu 16.04 and use following commands to setup MS SQL 2017 on it.
    # import the public repository GPG Key:
    wget -qO- https://packages.microsoft.com/keys/microsoft.asc | sudo apt-key add -
    
    # Register the Microsoft SQL Server Ubuntu repository:
    sudo add-apt-repository "$(wget -qO- https://packages.microsoft.com/config/ubuntu/16.04/mssql-server-2017.list)"
    
    # Run the following commands to install SQL Server:
    sudo apt-get update
    sudo apt-get install -y mssql-server
    
    # Configure the SQL Server (Use 2 to install Developer edition which is free):
    sudo /opt/mssql/bin/mssql-conf setup
    
    # verify the server is running:
    systemctl status mssql-server
  7. (Optional) To install SQL Server command-line tools follow the steps given at https://docs.microsoft.com/en-us/sql/linux/quickstart-install-connect-ubuntu?view=sql-server-2017#tools
  8. Try to connect the SQL Server 2017 installed on Ubuntu 16.04 from SSMS. If you see any connectivity issue, fix that. You may need to setup firewall to allow the connection on 1433 port in Ubuntu 16.04. I leave these steps for you to find and configure. 🙂
  9. Enable the contained database authentication using following query:
    sp_configure 'contained database authentication', 1; 
    GO 
    RECONFIGURE; 
    GO
  10. Now we are done with the setup and you can use the PowerShell script provided in Installation guide for Sitecore 9.0 Update 2. MAKE SURE THAT YOU SET IP ADDRESS OF YOUR UBUNTU MACHINE FOR THE $SqlServer parameter value to connect.

Happy installation!!!

Write me at jatin@jprajapati.in if you have any queries.