Blog

How to install GrandNode - step by step guide for Linux, Windows, MacOS, Raspberry PI

Friday, October 4, 2019 Comments (0)

From A to Z Installation Guide for GrandNode

List of content

1. General overview

GrandNode is an ASP.NET Core open source e-commerce platform for creating up e-commerce sites – online stores. GrandNode is not only open source e-commerce, it’s the most advanced e-commerce platform on the market, with out of the box features like multi tenant, multi vendor, multi store, memberships and subscriptions, B2B features and many, many more. Feel free and read GrandNode features.

GrandNode System Requirements


Before we start describing the installation processes please be sure that you meet GrandNode system requirements.
First of all let’s start with the supported browsers, because without browser you won’t be able to see the GrandNode.
We support the latest released and stable browsers, such as:
- Mozilla Firefox
- Google Chrome
- Microsoft Edge
- Opera
- Safari

Windows System Requirements


GrandNode with .NET Core 3.0 version can be installed on following versions:
- Windows 7 SP1
- Windows 8.1
- Windows 10 (version 1607+)
- Windows Server 2012 R2 SP1+

To install GrandNode with success you will need to install database server also, we support:
- MongoDB 4.0 or above

Finally, to run it on a Windows Server, you need to have:
- IIS at least in version 8.0 or above

If you are a programmer, you will have to install Microsoft Visual Studio 2019 with installed .NET Core 3.0 libraries.

Linux System Requirements


Below you will find the complete list of supported operating systems:
- Red Hat Enterprise Linux, CentOS, Oracle Linux – 7 – x64
- Fedora – 29, 30 – x64
- Debian – 9+ – x64, ARM32, ARM64
- Ubuntu – 18.04 – x64, ARM32, ARM64
- Linux Mint – 18+ – x64
- openSUSE – 15+ - x64
- SUSE Enterprise Linux (SLES) – 12 SP2+ -x64
- Alpine Linux – 3.8+ - x64, ARM64

If you have the operating system installed, it’s time to install server. We recommend to use the following one:
- nginx 1.14.0

If you want to host the MongoDB on the same server, you need to install MongoDB server – at least MongoDB 4.0 or higher.

MacOS System Requirements


It’s possible to install GrandNode on Mac OS X. It’s dedicated mostly for developers, here is the supported operating system version:
- Mac OS X in version 10.13+ - x64

On Mac OS you will have to download also Visual Studio for Mac with .NET Core SDK for Mac. Download Visual Studio. https://www.visualstudio.com/vs/visual-studio-mac/

2. Automatic Installation

Software installers


Since we joined the DigitalOcean marketplace you are able to install GrandNode fully automatic. To be honest it’s also the easiest way to install GrandNode. Below you will find the step by step how to install GrandNode on DigitalOcean.

First of all, create account on DigitalOcean.

Homepage of Digital Ocean

This step is very simple, just fill the visible field and press the create account button. You can always use the External Authentication methods like Google or GitHub login.
In the DigitalOcean account section it’s time to create droplet. To perform this action, please click the green button at the top of the screen and choose the „Droplets” from dropdown options.

On the droplet creation window please click the „Marketplace” and press the See all marketplace apps.

Droplet creation window on DigitalOcean

Go to „Blogs & Forums” and search for GrandNode. Hover it and click Create Droplet.

Choose GrandNode from marketplace apps list

Page will reload and you will be redirected to the customization window.

It’s time to choose the best parameters for your server. With 1Click App, GrandNode can be installed on the 5$ cloud, so it’s totally up to you, which package you will choose. The most important thing in this step is a server location, you should choose the nearest location to your customers. If you have customers only from USA, choose New York or San Francisco. It will increase the GrandNode performance.

Please don’t miss the Finalize and create section, because there is a field in which you are able to name your application.

Finalize and create window on DigitalOcean

After successfull installation you need to make a several things. First of all, open the IP of your droplet, it will redirect you to your newly created GrandNode.
You will see the installation screen. It’s the standard installation page of GrandNode.
Provide the necessary information, such as:
- Admin e-mail and password
- Mark the checkbox if you want to install sample data
- Fill the server name, by default its localhost:27017,
- Enter the name of database and finally leave the username and password fields empty.
- Specify also the Collation

Once the installation is complete, reboot your machine and you can finalize your online store.
There is also one recommended thing, please check how to install free SSL certificate in GrandNode. Setting up an SSL certificate enables HTTPS connection, which secures the traffic between the server and the clients. After you install a SSL certificate, you need to allow access from port 443 (by default open ports are: 22, 80).
That’s end! You can be proud, you’ve successfully run GrandNode on Linux server.

Deploy to Azure with Microsoft Visual Studio


3. Manual Installation

Linux Installation from source code


Manual installations are always more tricky than automated one, but with our installation guide, you will master this process for good. Please note that in this guide, we're using the newest version of GrandNode with ASP.NET Core 3.0. It's still in the development process, but it will be released within the end of the year, so we've decided to create the installation guide only for the updated version. If you have problems with older versions of GrandNode. Please let us know in the comments or write a post on community forum.

This part will cover How to run GrandNode on Ubuntu 18.04, if you want, we are looking for contributors who prepare guides for other distributions of Linux. Let’s start from the beginning. Of course I suppose that you have running Ubuntu 18.04. Open the command line and let’s roll the magic. In the first step you will learn how to download GrandNode from GitHub.
In the command line, please enter the following commands:

mkdir ~/source
cd ~/source
git clone –single-branch –branch Release-x.xx https://github.com/grandnode/grandnode.git

In the x.xx place, please enter the current version of GrandNode. The number for newest released can be found in GrandNode release notes. 
This command will clone the latest stable version of GrandNode. Please note that you can always download the latest development version of GrandNode, if you are a developer and want to contribute in our project, just remove the parameters from the command above and use the: git clone https://github.com/grandnode/grandnode.git
In the next step we will install the latest version of nginx. We will use it to host GrandNode.

How to install nginx on Ubuntu 18.04, probably it's your next question. The best information for you is that nginx comes with the Ubuntu’s default repositories, so we can install it with apt packaging system. Just update your local package index and install it with:

sudo apt update
sudo apt install nginx

And that’s all. Simple. Now it’s time to create our development environment.

Let’s install the ASP.NET Core 3.0.

wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb

Above steps are done only once per machine, so if you done it previously you don’t have to do it again.
Now we will install the .NET SDK, but firstly we want to update the products available for installation:

sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get install dotnet-sdk-3.0

Now it’s time to prepare a directories for our website. We need to create the main catalog for GrandNode, to perform that, please use the following command:

mkdir /var/webapps

Now it’s time to run our magic and run GrandNode. We need to go to our application’s root directory. We will be able to pull in/download all the required NuGet packages, let’s do that now.

cd ~/source/grandnode
dotnet restore GrandNode.sln

You can take a sip of coffee, it may take a while. After that action, we can continue our spells. Provide the following code:

sudo dotnet build Plugins/Grand.Plugin.DiscountRequirements.Standard && sudo dotnet build Plugins/Grand.Plugin.ExchangeRate.McExchange && sudo dotnet build Plugins/Grand.Plugin.ExternalAuth.Facebook && sudo dotnet build Plugins/Grand.Plugin.Feed.GoogleShopping && sudo dotnet build Plugins/Grand.Plugin.Payments.CashOnDelivery && sudo dotnet build Plugins/Grand.Plugin.Payments.CheckMoneyOrder && sudo dotnet build Plugins/Grand.Plugin.Payments.BrainTree && sudo dotnet build Plugins/Grand.Plugin.ExternalAuth.Google && sudo dotnet build Plugins/Grand.Plugin.Payments.PayInStore && sudo dotnet build Plugins/Grand.Plugin.Payments.PayPalStandard && sudo dotnet build Plugins/Grand.Plugin.Shipping.ByWeight && sudo dotnet build Plugins/Grand.Plugin.Shipping.FixedRateShipping && sudo dotnet build Plugins/Grand.Plugin.Shipping.ShippingPoint && sudo dotnet build Plugins/Grand.Plugin.Tax.CountryStateZip && sudo dotnet build Plugins/Grand.Plugin.Tax.FixedRate && sudo dotnet build Plugins/Grand.Plugin.Widgets.GoogleAnalytics && sudo dotnet build Plugins/Grand.Plugin.Widgets.Slider && sudo dotnet publish Grand.Web -c Release -o /var/webapps/grandnode

Pretty long, but this simple && characters, will run your commands one by one, it will save your time and automate this process a little. The last command is used to copy compiled version of GrandNode to our application directory, created in previous step.

Please note, sometimes you can face problems with pasted commands execution. In that case, please rewrite the command manually. In most cases it does the trick and executes commands.

Let’s wait with the fireworks, it’s time to give proper permissions to our user and that user will run our service:

sudo chown –R www-data:www-data /var/webapps/grandnode

Now it’s time to automate the whole process. We need to create a systemd file, to create a daemon (service) init script, we will use VIM:

sudo vi /etc/systemd/system/grandnode.service

And below is prepared an example service file, you can copy it and use:

[Unit]
Description=GrandNode

[Service]
WorkingDirectory=/var/webapps/grandnode
ExecStart=/usr/bin/dotnet /var/webapps/grandnode/Grand.Web.dll
Restart=always
RestartSec=10
SyslogIdentifier=dotnet-grandnode
User=www-data
Environment=ASPNETCORE_ENVIRONMENT=Production

[Install]
WantedBy=multi-user.target

Press ESC and enter :wq to save changes and exit from editor. After successful creation, we need to enable and start service:

sudo systemctl enable grandnode.service
sudo systemctl start grandnode.service

Now the most tricky part. Everything works fine, but we are not able to connect with our GrandNode from our computer. The reason is simple, GrandNode is running locally on our machine on port 5000. In thix example, we will present the simplest way of reverse-proxy traffic to your application. It will forward traffic from port 80 to your local machine on port 5000.
Open the nginx configuration with VIM or favourite text editor:

sudo vi /etc/nginx/conf.d/default.conf

The simplest way is to replace the content of file, delete current content and paste this one:

server {
listen 80;
location / {
proxy_pass http://localhost:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}

As before, press ESC and write :wq to exit and save changes. With the VIM editor open next file – proxy.conf to configure it.

proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffers 32 4k;

As previous, exit and save changes. By default we won’t be able to use this file, we need to include it to the general nginx config. Open following file:

sudo vi /etc/nginx/nginx.conf

Below the http { line paste the following code include /etc/nginx/proxy.conf, as it’s shown below.

Nginx configuration file

In the same file, we can make one thing to improve GrandNode performance. Please look for commented section "GZIP Settings". Just remove the all # marks from the beginnings of the lines. It will allow us, to use the gzip compression for GrandNode.

Save changes as earlier. Now check the nginx configuration with following command:

sudo nginx –t

If everything is ok, you will be able to reload the Nginx configuration. You can do it by running:

sudo systemctl reload nginx.service

Let’s install last packages, firstly we will install the missing libgdiplus package, run the following command:

sudo apt-get –y install libgdiplus && sudo ln -s /lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/libdl.so

Now it’s time to manage how to install MongoDB on Ubuntu. MongoDB installation process is based on official MongoDB installation guide. And this way of installation is highly recommended.
Import the public key used by the package management system, you can do it by running following command:

wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add -

Now we need to create a list file for MongoDB, it’s appropiate for Ubuntu 18.04:

echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list

The installation process is very simple, we need to run two commands:

sudo apt-get update && sudo apt-get install mongodb-org

After successful installation we will be able to enable and start it:

sudo systemctl enable mongod.service && sudo systemctl start mongod.service

Everything is done, so now it's time to run GrandNode! Open the IP of your server and you will see the installation screen of GrandNode. Provide the necessary information, such as:
- Admin e-mail and password
- Mark the checkbox if you want to install sample data
- Fill the server name, by default its localhost:27017,
- Enter the name of database and finally leave the username and password fields empty.
- Specify also the Collation

Linux installation without source code

This way of installation is the faster one and recommended for non-developer users. In this point, we won't use the source code of GrandNode, so we won't have to build solution, build plugins and publish them, we will just learn how to install nginx, how to run MongoDB and how to install GrandNode.

I assume that you've created your machine, in my case it will be Ubuntu 18.04, so we will learn how to run GrandNode on Ubuntu 18.04. Let's start with the nginx installation. As it was provided in the previous way of installation. Nginx comes with the default package in Ubuntu. So to install it, just run following commands:

sudo apt update
sudo apt install nginx

Counter is running, so we have to speed up, to perform the fastest way of GrandNode installation. Now, let's install the MongoDB server to enable data storage. Add the keys of MongoDB package and create list file with:

wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add - && echo "deb [ arch=amd64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list

As previous, we will use the combined commands with &&. Update packages and install MongoDB on Ubuntu

sudo apt-get update && sudo apt-get install mongodb-org

It will install MongoDB and you will be able to enable and start service. 

sudo systemctl enable mongod.service && sudo systemctl start mongod.service

We've installed nginx, we've installed MongoDB and now it's time to install .NET Core 3.0, without it, we won't be able to run GrandNode. Following commands have to be done only once per machine:

wget -q https://packages.microsoft.com/config/ubuntu/18.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb

Let's download .NET Core. 

sudo add-apt-repository universe
sudo apt-get update
sudo apt-get install apt-transport-https
sudo apt-get install aspnetcore-runtime-3.0

Everything should be done without problems, so now it's time to download the latest version of GrandNode. To perform that, we will use the standard command:

wget https://github.com/grandnode/grandnode/releases/download/4.50/GrandNode4.50_NoSource.Web.zip

Now it's possible that we have to install missing package for unziping, if you have it, just skip that step. Install it:

sudo apt-get install unzip

Now, let's unpack the GrandNode package.

unzip GrandNode4.50_NoSource.Web.zip -d /var/webapps/

For easier management, let's renamte the unzipped folder and remove zip package with:

sudo mv GrandNode4.50_NoSource.Web grandnode
sudo rm GrandNode4.50_NoSource.Web.zip

We're almost done! To provide more automation to our application, we will create service for GrandNode, to achieve that, create the service file:

sudo vi /etc/systemd/system/grandnode.service

Then inside it, please paste the following content:

[Unit]
Description=GrandNode

[Service]
WorkingDirectory=/var/webapps/grandnode
ExecStart=/usr/bin/dotnet /var/webapps/grandnode/Grand.Web.dll
Restart=always
RestartSec=10
SyslogIdentifier=dotnet-grandnode
User=www-data
Environment=ASPNETCORE_ENVIRONMENT=Production

[Install]
WantedBy=multi-user.target

Press ESC and enter :wq to save changes and exit from editor. After successful creation, we need to enable and start service:

sudo systemctl enable grandnode.service
sudo systemctl start grandnode.service

Let's assing correct permissions to our GrandNode directory with:

sudo chown -R www-data:www-data /var/webapps/grandnode

Now the most tricky part. Everything works fine, but we are not able to connect with our GrandNode from our computer. The reason is simple, GrandNode is running locally on our machine on port 5000. In thix example, we will present the simplest way of reverse-proxy traffic to your application. It will forward traffic from port 80 to your local machine on port 5000.
Open the nginx configuration with VIM or favourite text editor:

sudo vi /etc/nginx/conf.d/default.conf

The simplest way is to replace the content of file, delete current content and paste this one:

server {
listen 80;
location / {
proxy_pass http://localhost:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}

As before, press ESC and write :wq to exit and save changes. With the VIM editor open next file – proxy.conf to configure it.

proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffers 32 4k;

As previous, exit and save changes. By default we won’t be able to use this file, we need to include it to the general nginx config. Open following file:

sudo vi /etc/nginx/nginx.conf

Below the http { line paste the following code include /etc/nginx/proxy.conf, as it’s shown below.

Nginx configuration file

In the same file, we can make one thing to improve the loading speed of GrandNode. Please look for commented section "GZIP Settings". Just remove the all # marks from the beginnings of the lines. It will allow us, to use the gzip compression for GrandNode. Save changes as earlier. Now check the nginx configuration with following command:

sudo nginx –t

If everything is ok, you will be able to reload the Nginx configuration. You can do it by running:

sudo systemctl reload nginx.service

The last thing, that we should do is to enabled the firewall, run the following commands:

ufw enable
ufw allow www

And open your website! We're done! Everything is done, so now it's time to run GrandNode! Open the IP of your server and you will see the installation screen of GrandNode. Provide the necessary information, such as:
- Admin e-mail and password
- Mark the checkbox if you want to install sample data
- Fill the server name, by default its localhost:27017,
- Enter the name of database and finally leave the username and password fields empty.
- Specify also the Collation

Windows installation without source code


Docker installation


Docker installation is very simple. Basically it can be wrapped into two commands. We will use two different docker containers for GrandNode and MongoDB and then, we will link MongoDB to our e-commerce platform.

Let's start with the first command, I assume that you have Docker installed and running. First thing will be a MongoDB container installation, to perform that action, you should use following command:

docker run -d -p 127.0.0.1:27017:27017 --name mongodb mongo

It will install MongoDB, please remember the name of your container, because it will be used as a MongoDB server name. In the next step, we will download the latest develop version of GrandNode and link installed MongoDB with it. You can do it with:

docker run -d -p 80:80 --name grandnode --link mongodb:mongo grandnode/develop

Now take your server adress and jump into browser, paste the IP address and check if it works. It should open installation screen of GrandNode. Provide the necessary information, such as:
- Admin e-mail and password
- Mark the checkbox if you want to install sample data
- Fill the server name, it's your name of MongoDB container, provided in the previous steps,
- Enter the name of database and finally leave the username and password fields empty.
- Specify also the Collation

Please note, that command used above will download the latest development version of GrandNode. So it's unsupported version, recommended only for C# developers. If you want to download the latest stable version of GrandNode please use the following command, where x.xx is a number of GrandNode release:

docker pull grandnode/grandnode:x.xx

If you don't know which number you should enter in that place, check the GrandNode release notes.

4. How to install GrandNode on Mac?

It's normal that this type of installation is used only by passionates and developers. Single user probably would choose the Linux or Windows servers. It's logical point of view. But as you know, GrandNode is open source cross-platform solution, so it's possible to develop it also on Mac OS. Please check the MacOS system requirements, Let's start with the ASP.NET Core 3.0 SDK installation. To get the newest package of ASP.NET Core 3.0, please go to official Microsoft website and download it from following address:

https://dotnet.microsoft.com/download/dotnet-core/3.0

Please note that it's already installed with the newest version of Microsoft Visual Studio for Mac, so if you keep this software up-to-date, probably you have it installed and you can go to the next step. If not, please install the mentioned SDK.

First of all, please download the newest version of GrandNode with source code. You will get the package with application, please extract the package and open the GrandNode.sln file:

GrandNode on Mac OS

As I mentioned in the previous chapters of this guide, in the GrandNode installation tutorial, we used the newest development version, due to ASP.NET Core 3.0 implementation. If you want to install previous version, reach us and ask for help.

5. How to install GrandNode on Raspberry PI 4?

Tutorial was created with Raspberry Pi 4 and Ubuntu 18.04 with ARM64 processor's architecture. Few steps are totally different than on the typical Linux installation. The beginning is the same, but we need to do one thing. Let's start with the GrandNode download. Run the following commands:

sudo mkdir ~/source
cd ~/source
sudo git clone –single-branch –branch Release-x.xx https://github.com/grandnode/grandnode.git

It's important to have sudo privileges. Now it's time to install the nginx web server. It's verry simple process, you need to enter two commands, as before:

sudo apt update
sudo apt install nginx

Now we will install the .NET Core 3.0, firstly we should install the missing dependencies. Below you will find the one, advanced and combined command which will install them:

sudo apt-get update \ && sudo apt-get install -y --no-install-recommends \ libc6 \ libgcc1 \ libgssapi-krb5-2 \ libicu60 \ libssl1.1 \ libstdc++6 \ zlib1g \ && sudo rm -rf /var/lib/apt/lists/*

This command is visible also on official .Net Core 3.0 installation guide. Now, let's install the .NET Core itself. It's a different process than on regular Linux installation. First of all we should download the .NET Core package for ARM64:

sudo wget https://download.visualstudio.microsoft.com/download/pr/cbc83a0e-895c-4959-99d9-21cd11596e64/b0e59c2ba2bd3ef0f592acbeae7ab27d/dotnet-sdk-3.0.100-linux-arm64.tar.gz
sudo mkdir -p $HOME/dotnet && sudo tar zxf dotnet-sdk-3.0.100-linux-arm64.tar.gz -C $HOME/dotnet
export DOTNET_ROOT=$HOME/dotnet
export PATH=$PATH:$HOME/dotnet

Before next step, we should add proper chmods for our user to our source code directory.

sudo chown -R ubuntu:ubuntu ~/source/grandnode

We have to create a folder for GrandNode on our web server. We will use the command that we've used at the beginning of the chapter.

mkdir /var/webapps

Now it’s time to run GrandNode. We need to go to our application’s root directory. We will be able to pull in/download all the required NuGet packages, let’s do that now.

cd ~/source/grandnode
dotnet restore GrandNode.sln

In the next step, we will build our app and publish source code to our nginx web server directory.

dotnet build Plugins/Grand.Plugin.DiscountRequirements.Standard && dotnet build Plugins/Grand.Plugin.ExchangeRate.McExchange && dotnet build Plugins/Grand.Plugin.ExternalAuth.Facebook && dotnet build Plugins/Grand.Plugin.Feed.GoogleShopping && dotnet build Plugins/Grand.Plugin.Payments.CashOnDelivery && dotnet build Plugins/Grand.Plugin.Payments.CheckMoneyOrder && dotnet build Plugins/Grand.Plugin.Payments.BrainTree && dotnet build Plugins/Grand.Plugin.ExternalAuth.Google && dotnet build Plugins/Grand.Plugin.Payments.PayInStore && dotnet build Plugins/Grand.Plugin.Payments.PayPalStandard && dotnet build Plugins/Grand.Plugin.Shipping.ByWeight && dotnet build Plugins/Grand.Plugin.Shipping.FixedRateShipping && dotnet build Plugins/Grand.Plugin.Shipping.ShippingPoint && dotnet build Plugins/Grand.Plugin.Tax.CountryStateZip && dotnet build Plugins/Grand.Plugin.Tax.FixedRate && dotnet build Plugins/Grand.Plugin.Widgets.GoogleAnalytics && dotnet build Plugins/Grand.Plugin.Widgets.Slider && dotnet publish Grand.Web -c Release -o /var/webapps/grandnode

Let's configure the nginx, before GrandNode start. I will skip the section with Ubuntu service for GrandNode, because I still compete with some problems related with it. Article will be updated when I will fix them. Now, when you start GrandNode it will work locally, what is unwanted behavior, because we want to make it public. We will use the reverse proxy configuration for it. Open the configuration file with:

sudo vi /etc/nginx/conf.d/default.conf

a large field to show off for modifications, but we'll use the simplest one for http redirection. Paste the following content into created file:

server {
listen 80;
location / {
proxy_pass http://localhost:5000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection keep-alive;
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}

Press ESC and write the :wq sequence, to save changes and close file. With the VIM editor open next file – /etc/nginx/proxy.conf to configure it.

proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
client_max_body_size 10m;
client_body_buffer_size 128k;
proxy_connect_timeout 90;
proxy_send_timeout 90;
proxy_read_timeout 90;
proxy_buffers 32 4k;

As previous, exit and save changes. By default we won’t be able to use this file, we need to include it to the general nginx config. Open following file:

sudo vi /etc/nginx/nginx.conf

Below the http { line paste the following code include /etc/nginx/proxy.conf; as it’s shown below.

nginx config again

In the same file, we can make one thing to improve GrandNode performance. Please look for commented section "GZIP Settings". Just remove the all # marks from the beginnings of the lines. It will allow us, to use the gzip compression for GrandNode. Further, comment the line with one the includes, as it's presented on the screenshot below:

commented line in nginx config screenshot

It's time to install MongoDB on Raspberry Pi. Use the following combination to perform that action:

wget -qO - https://www.mongodb.org/static/pgp/server-4.2.asc | sudo apt-key add - && echo "deb [ arch=arch64 ] https://repo.mongodb.org/apt/ubuntu bionic/mongodb-org/4.2 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-org-4.2.list

As previous, we will use the combined commands with &&. Update packages and install MongoDB on Ubuntu

sudo apt-get update && sudo apt-get install mongodb-org

It will install MongoDB and you will be able to enable and start service.

sudo systemctl enable mongod.service && sudo systemctl start mongod.service

That's all. Go to cd /var/webapps/grandnode - give the sudo chmod -R ubuntu:ubuntu /var/webapps/grandnode/Grand.Web.dll and run GrandNode with dotnet Grand.Web.dll

6. Common issues during installation process

Commands that I've pasted don't work


It's pretty often issue. If some of commands that I've used in this guide don't work, for example:
- You've tried to use sudo chown –R www-data:www-data /var/webapps/grandnode and it failed, that means that you should try to enter this command manually.

7. Have more complicated requirements?

GrandNode can be a scalable e-commerce software with Redis Server, Load Balancers, CDN servers with MongoDB replication. We know that this process may be frustrating and problematic. We are here to bring your ideas to life. You can always base on our experience and knowledge. If you don't have time or resources, it's the best time to send us a message, we will install GrandNode in any configuration for you with pleasure!

Leave your comment