- [Access the Ecommerce from the Public Internet](#access-the-ecommerce-from-the-public-internet)
- [Set a DNS Record](#set-a-dns-record)
- [Access the Ecommerce](#access-the-ecommerce)
- [HTTPS with Caddy](#https-with-caddy)
- [Manage with Systemd](#manage-with-systemd)
- [Access Admin Panel](#access-admin-panel)
- [Manage nopCommerce with Systemd](#manage-nopcommerce-with-systemd)
- [References](#references)
---
## 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](https://www.nopcommerce.com/en) is an open-source ecommerce platform based on Microsoft's ASP.NET Core framework and MS SQL Server 2012 (or higher) backend Database.
We start by deploying a full VM on the ThreeFold Dashboard.
* On the [Threefold Dashboard](https://dashboard.grid.tf/#/), go to the [full virtual machine deployment page](https://dashboard.grid.tf/#/deploy/virtual-machines/full-virtual-machine/)
* 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.
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
```
![](./img/nopcommerce_1.png)
For more information on how to use nopCommerce, refer to the [nopCommerce docs](https://docs.nopcommerce.com/en/index.html).
## 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` and `Enter raw connection`. Enter the following information (as per the docker-compose information)
You should see in the logs that it successfully obtains an SSL certificate, and after that you can try navigating to your site's domain again to verify it's working. Using a private window or adding `https://` specifically might be necessary until your browser drops its cache.
![](./img/nopcommerce_3.png)
When you're satisfied that everything looks good, hit `ctl-c` to exit Caddy and we'll proceed to making this persistent.
#### Manage with Systemd
We create a systemd service to always run the reverse proxy for port 80.
For further information on how to set nopCommerce, read the [nopCommerce documentation](https://docs.nopcommerce.com/en/index.html?showChildren=false).