Deploy a CMS Site to Optimizely Cloud
Why this matters
Section titled βWhy this mattersβGetting your first deployment right sets the foundation for your entire development workflow. A clean initial setup means predictable builds, reliable promotions, and confidence that what you test is what your users see.
Step 1: Connect your repository
Section titled βStep 1: Connect your repositoryβOptimizely Cloud builds code directly from a Git repository. You need to connect your projectβs repository to the cloud platform.
- Log into the Optimizely Cloud management portal
- Navigate to your project
- Go to Settings > Repository
- Copy the Git remote URL provided by the portal
- Add it as a remote in your local repository:
git remote add opti <repository-url-from-portal>- Push your code to the Integration branch:
git push opti main:developThe platform automatically detects the push and starts a build.
Step 2: Verify the build
Section titled βStep 2: Verify the buildβAfter pushing, monitor the build process in the management portal.
- Navigate to Deployments in the portal
- Watch the build log for errors
- A successful build shows a green status and logs ending with βDeployment completedβ
If the build fails, check for:
- Missing NuGet packages β Ensure
nuget.configreferences all required feeds - Compilation errors β Fix locally, commit, and push again
- Timeout β Large solutions may need build configuration adjustments
Step 3: Configure environment variables
Section titled βStep 3: Configure environment variablesβBefore your application runs correctly, set the environment-specific configuration.
- In the management portal, go to Settings > Environment Variables
- Select the Integration environment
- Add required variables:
| Variable | Purpose | Example |
|---|---|---|
ASPNETCORE_ENVIRONMENT | Runtime environment | Integration |
ConnectionStrings__EPiServerDB | CMS database | Auto-configured |
Optimizely__Cdn__Enabled | CDN toggle | true |
- Click Save and redeploy for changes to take effect
Step 4: Configure custom domains (optional)
Section titled βStep 4: Configure custom domains (optional)βIf you want a custom domain instead of the default *.optimizely.cloud hostname:
- Go to Settings > Domains
- Click Add Domain
- Enter your domain name (e.g.,
www.example.com) - Create a CNAME record pointing your domain to the provided target
- Wait for DNS propagation (up to 24 hours)
- The platform provisions an SSL certificate automatically
Step 5: Validate your deployment
Section titled βStep 5: Validate your deploymentβOnce the Integration deployment succeeds:
- Open the Integration URL from the portal dashboard
- Verify the site loads correctly
- Log into the CMS admin interface (
/episerver/cms) - Confirm content types are registered
- Create a test page and publish it
- Verify the published page renders on the front end
Step 6: Promote to Preproduction
Section titled βStep 6: Promote to PreproductionβWhen Integration is validated, promote to Preproduction:
- In the portal, navigate to Deployments
- Find the successful Integration deployment
- Click Deploy to Preproduction
- Monitor the deployment log
- Validate the Preproduction environment using the same checks from Step 5
Step 7: Go live to Production
Section titled βStep 7: Go live to ProductionβAfter Preproduction validation:
- Click Deploy to Production in the portal
- Monitor the zero-downtime deployment
- Verify the Production site with your custom domain
- Check health metrics in the monitoring dashboard
Troubleshooting first deployments
Section titled βTroubleshooting first deploymentsβ| Symptom | Likely cause | Fix |
|---|---|---|
| Build fails with NuGet errors | Missing package feed | Add Optimizely feed to nuget.config |
| Site starts but shows errors | Missing environment variables | Configure connection strings in portal |
| 502 Bad Gateway | Application crash on startup | Check deployment logs for exceptions |
| CSS/JS not loading | Static file middleware not configured | Ensure UseStaticFiles() is called |
| CMS admin login fails | Admin account not seeded | Run initialization on first startup |