How to Install Optimizely Foundation?

What is Optimizely Foundation?

Optimizely Foundation is an open-source project offered by Episerver, now Optimizely, providing a structured and modular reference architecture for developers. It enables the integration of various Optimizely products into solutions. With projects for CMS, Customized Commerce, Personalization, Search & Navigation, and the Community API, developers can select and include or exclude specific components as needed.

It has undergone rigorous testing, including penetration and load testing, and is certified to run on the DXP Service. Optimizely Foundation offers a starting point for development and showcases best practices through the Mosey demo site.

Optimizely Foundation Installation Instructions

In this article we’ll describe how to install the Optimizely Foundation open-source starter solution, as well as tips for fixing issues you may encounter along the way.

Prerequisites: installed the Optimizely CLI and templates, SQL, Node,.js, .NET 6

Follow these instructions to install the Optimizely Foundation Starter Solution.

Optimizely Foundation Installation FAQs

How to Install Optimizely Foundation?

1. Open command prompt as administrator
2. git clone https://github.com/episerver/Foundation.git
3. cd foundation
4. git checkout main
5. setup.cmd
6. dotnet run –project .\src\Foundation\Foundation.csproj

How to fix Foundation Error ‘DataException: A transient error occured in the database’?

Make sure you have ‘Named Pipes’ enabled in SQL Server Configuration Manager.

1. Open SQL Server Configuration Manager.
2. Select the ‘SQL Server Services’ menu item and ensure that the ‘SQL Server’ and ‘SQL Server Agent’ processes are running.
3. Expand ‘SQL Native Client Configuration’ menu item and select ‘Client Protocols.
4. In the list displayed, select ‘Named Pipes’ and set it to ‘Enabled’.

How to fix Foundation ‘Object Reference’ Error in AnonymousCartMergingMiddleware.cs?

On first build and run of the site, if you are debugging you may get and ‘Object Reference’ error with the following line of code:

AnonymousCartMergingMiddleware.cs: context.Features.Get<IAnonymousIdFeature>().AnonymousId

Just continue and the site should still load.

How to fix Foundation Error ‘No such host is known’?


1. Create a free Developer Find Index from the Optimizely Search & Navigation site.
2. In the solution, go to appsettings.json.
3. in the ‘Find’ configuration section, replace the ‘DefaultIndex’ and ‘ServiceUrl’ values from the generated code snippet.
4. In Admin Mode, run the ‘Search & Navigation Content Indexing Job’.

More information can be found on the Optimizely Developer Forum.

Leave a Comment