Deploying a nopCommerce App
Introduction
nopCommerce is a popular open-source ASP.NET e-commerce platform. This guide shows how to containerize nopCommerce with a Dockerfile, connect it to SQL Server, persist media and plugins, and deploy it to Klutch.sh over HTTP.
Prerequisites
- GitHub repository containing your Dockerfile.
- SQL Server database (managed or deployed separately).
- Klutch.sh project ready in klutch.sh/app.
Project structure
.└── DockerfileSample Dockerfile
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS baseWORKDIR /appENV ASPNETCORE_URLS=http://+:8080EXPOSE 8080
# Copy prebuilt nopCommerce publish outputCOPY . /app
ENTRYPOINT ["dotnet", "Nop.Web.dll"]If you need to build from source in the container, add a build stage with the SDK image to restore and publish before copying into the runtime image.
Required environment variables
ConnectionStrings__DefaultConnection– SQL Server connection string, e.g.,Server=tcp:HOST,1433;Database=nop;User Id=USER;Password=PASS;TrustServerCertificate=True;ASPNETCORE_URLS=http://+:8080Nop__UseFastInstallationService=true(for first run, optional)
Optional environment variables
ASPNETCORE_ENVIRONMENT=ProductionNop__DisplayFullErrorStack=falseNop__UseRedisForCaching=false(enable and configure if you add Redis)
Persistence
Persist media, plugins, and logs:
- Mount path:
/app/App_Data - Mount path:
/app/wwwroot - Size: based on expected catalog assets, logs, and plugin packages
Networking
- Protocol: HTTP
- Internal port:
8080 - Users reach
https://example-app.klutch.shwhile Klutch.sh routes to port8080inside the container.
Health check (recommended)
curl -I http://localhost:8080Deployment on Klutch.sh
- Push your Dockerfile and published nopCommerce files to GitHub.
- In klutch.sh/app, create a new app and select GitHub as the source.
- Klutch.sh automatically detects the Dockerfile in the repository root.
- Select HTTP traffic and set the internal port to
8080. - Add environment variables for the SQL Server connection string and any nopCommerce settings. Mark secrets as sensitive.
- Attach persistent volumes at
/app/App_Dataand/app/wwwrootsized for media, plugins, and logs. - Deploy. On first run, complete the nopCommerce setup using your SQL Server credentials.
Verification
-
UI: open
https://example-app.klutch.shand confirm the storefront or setup screen loads. -
Quick check:
Terminal window curl -I https://example-app.klutch.sh
Next steps
- Disable the fast installation service after initial setup.
- Configure CDN/cache for static assets and enable HTTPS at the edge.
- Schedule backups for SQL Server and the mounted data directories.