
nopCommerce is an open-source eCommerce platform built with Microsoft technologies. nopCommerce 4.20 is running fully with .NET Core and many of us want to run it on a Linux machine. There are different ways to do that — the easiest way is using Docker. In this article, we’ll see how to run a nopCommerce app on a Linux machine using Docker.
Before proceeding further, let’s understand about Docker and its components that we will use in this article.
Docker
Docker is a lightweight, open, and secure platform. It is a way to simplify the process of building, shipping, and running applications in a different environment. Docker bundles up all the dependencies of an application and runs it in a container. In a simple word, on the off chance that you need to use MSSQL, you do not need to download, install, and manage a bunch of packages, simply run the container with Docker and use it — as simple as that.
Image
An image is used to build a container, it has necessary files to run something on an operating system, like Windows or Ubuntu, and then it has your application framework along with database files that support that. So, if you’re using ASP.NET, NodeJS, or Python, Images have that typical code.
Container
Images are just the definitions which cannot be run directly. To run the images, we need containers. Containers are the instances that help to run images with a different configuration like port, IP Address, etc.
Docker Compose
Docker Compose is used to run multiple containers under a single instance. It creates a network with different containers, through the network containers can communicate with each other. So, if the application has a dependency on other containers, Docker Compose is the right fit.
As we tend to run a nopCommerce app with an MS SQL server, we'll use Docker Compose.
Assumptions
All commands in this post assume that -
- You are running a Linux machine.
- Docker is installed on your system.
Step 1 - Use Docker command without Sudo
Execution of Docker command requires root privileges and to add privilege, we have to add "sudo" prefix to execute the command. To make it easy, let's add your username to the Docker group so we don’t need to pass “sudo” every time we use a Docker command.
- $sudo usermod -aG docker ${USER}
Step 2 - Check Docker version
As Docker is already installed on the system, check the version using the following command.
| docker –v |
- adminvm@adminvm-VirtualBox:~$ docker -v
- Docker version 18.09.7, build 2d0083d
Step 3 - Install Docker Compose
As we have to communicate nopCommerce with SQL Server containers, we need to install Docker Compose to the machine. Do keep in mind that Docker Compose needs to be installed separately; it doesn't install with default Docker installation.
Install Docker Compose with the following commands.
- sudo curl -L
- "https://github.com/docker/compose/releases/download/1.22.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
- sudo mv /usr/local/bin/docker-compose /usr/bin/docker-compose
- sudo chmod +x /usr/bin/docker-compose
Afterward, check the Docker Compose version with the following, and you should see the version there.
| docker-compose -v |
- adminvm@adminvm-VirtualBox:~$ docker-compose -v
- docker-compose version 1.22.0, build f46880fe
Step 4 - Understand “docker-compose.yml” file
Download nopCommerce 4.20 source code on your machine and open the docker-compose.yml file located at the root.

Let’s understand the parameters of this file.
| Parameter |
Description
|
| version |
It indicates the compose file version; version 3 is the most recent and recommended.
|
| services |
It contains a configuration that applies to each container.
It has all the information about the containers and images and environment variables.
|
| volumes | Volumes are used to persist data generated by and used by Docker containers. |








Boris VolegovPosted Mar 21, 2020, 8:09 AM
Thank you for a great article. Just curious what Linux distro did you use? Each time I'm trying to run this on Ubuntu, it goes for quite a while and then at the step 42 I get the following message:RUN apk add --no-cache icu-libs, /bin/sh: 1: apk: not found
Raju PaladiyaPosted Dec 31, 2019, 4:58 AM
Great article. Thanks you for sharing. Really helpfull.
Brandon MillerPosted Sep 18, 2019, 11:09 AM
This is great for a brand new install but what do I do for an existing install? I already have a seperate MSSQL container housing my database and host my binaries through IIS. I can't seem to figure out how you access the binaries/configs with this method. I imagine you'd have the same problem when going to upgrade to the next release.
sayful islamPosted Aug 20, 2019, 4:04 PM
@Divyang Desai: Thanks for sharing the tutorial. According to your suggestion, everything works fine for me except the plugin! Would you please share why no plugin installed in 4.20 version? Even when I want to install any new plugin from admin panel, the docker container goes down!
Smi10 KalathiyaPosted Jul 25, 2019, 9:06 AM
Thanks divyang for sharing such a wonderful article.