nopCommerce
Introduction
We show how to deploy a free and open-source ecommerce on the ThreeFold Grid. We will be deploying on a full VM with an IPv4 address.
nopCommerce is an open-source ecommerce platform based on Microsoft's ASP.NET Core framework and MS SQL Server 2012 (or higher) backend Database.
Prerequisites
- A TFChain account
- TFT in your TFChain account
Deploy a Full VM
We start by deploying a full VM on the ThreeFold Dashboard.
- On the Threefold Dashboard, go to the full virtual machine deployment page
- Deploy a full VM (Ubuntu 22.04) with an IPv4 address and at least the minimum specs shown below
- IPv4 Address
- Minimum vcores: 2 vcores
- Minimum GB of RAM: 4 GB
- Minimum storage: 50 GB
- After deployment, note the VM IPv4 address
Create an SSH Tunnel
We create an SSH tunnel with port 5432:80, as it is this combination that we will set for nopCommerce on the docker-compose file.
- Open a terminal and create an SSH tunnel
ssh -4 -L 5432:127.0.0.1:80 root@VM_IPv4_address>
Simply leave this window open and follow the next steps.
Preparing the VM
We prepare the full to run nopCommerce.
- Connect to the VM via SSH
ssh root@VM_IPv4_address
- Update the VM
apt update
- Install Docker
- Install docker-compose
apt install docker-compose -y
Set a Firewall
You can set a firewall to your VM for further security. This should be used in production mode.
- Add the permissions
-
ufw allow 80
ufw allow 443
ufw allow 22
-
- Enable the firewall
-
ufw enable
-
- Verify the fire wall status
-
ufw status verbose
-
Download nopCommerce
- Clone the repository
git clone https://github.com/nopSolutions/nopCommerce.git
cd nopCommerce - Build the image
cd nopCommerce
docker-compose -f ./postgresql-docker-compose.yml build - Run the image
docker-compose -f ./postgresql-docker-compose.yml up
Access nopCommerce
You can access the nopCommerce interface on a browser with port 5432 via the SSH tunnel:
localhost:5432
For more information on how to use nopCommerce, refer to the nopCommerce docs.
Install nopCommerce
You will need to set your ecommerce store and database information.
- Enter an email for your website (e.g.
admin@example.com
) - For the database, choose PostgreSQL and check both options
Create a database
andEnter raw connection
. Enter the following information (as per the docker-compose information)Server=nopcommerce_database;Port=5432;Database=nop;User Id=postgres;Password=nopCommerce_db_password;
- Note: For production, you will need to set your own username and password.
Access the Ecommerce from the Public Internet
Set a DNS Record
- Go to your domain name registrar
- In the section Advanced DNS, add a DNS A Record to your domain and link it to the IP address of the VM you deployed on:
- Type: A Record
- Host: @
- Value: "IPv4_Address"
- TTL: Automatic
- It might take up to 30 minutes to set the DNS properly.
- To check if the A record has been registered, you can use a common DNS checker:
-
https://dnschecker.org/#A/example.com
-
- In the section Advanced DNS, add a DNS A Record to your domain and link it to the IP address of the VM you deployed on: