Free open source Historian - Installation
Maxim Krylov
Co-founder of Kiptr.com and
MaxTech Systems
Historians are a widely used tool in industrial setups. By default, a historian is a database with time-series production data. But in fact, there is a lot around this database. Data has to be collected, stored and displayed. There are a lot of various approaches and preferences, so the market for data historians is quite large.

Licenses for historian software can be quite expensive. And there is a reason for that - it's a lot of work to create such a complicated software package.
We will focus on making a historian that will be based on open source software. One obvious advantage of this system - it is absolutely free to use.

Here is my setup on the last project - historian is running full screen on the left monitor. I was using it 100% of time and it gave me an extremely valuable information.
And below is an example of the dashboard I created to monitor our huge fans during commissioning while historian was not yet available.
We will use 3 packages:
1. Node-RED to connect to PLC and acquire data
2. InfluxDB to store data
3. Grafana to create trends and visualize our data
Also, to make this project 100% free, we will install all the software in Linux operating system. It is possible to do the same in Windows but Windows requires a license and we want to make the project totally free. Another bonus - this installation can be done on Raspberry Pi or a similar platform. Historian can be left running there and be independent from your laptop.
All the software we are going to use have the graphical UI so we will need minimal number of command line commands and programming skills.
Linux VM
So, let's go ahead and download our Linux distribution. I will be using Ubuntu (can be downloaded here). You can choose any other flavor you like.
Next, we will create the new virtual machine. For that you can use whatever software you prefer. I am using VMWare Fusion for my mac, so the screenshots will show that. VMWare Workstation for Windows will have very similar steps.
Lets pickup the first option - Install from disk or image. Next, select the image that we have just downloaded. Follow the straight forward guidance, enter your credentials and hit continue and finish. Settings can be default.

I chose "Minimal Installation" but you can go with all the default software. Follow system prompts and finish the installation.
Restart the VM once OS is installed, download latest patches, restart again.
That's it for the operating system - we now have a clean installation. At this moment I'd recommend to take a snapshot of the VM. In case something goes wrong it will be easy to roll back to the start.
Node-RED
Now it's time to install our software packages.
Let's start with Node-RED. What we want to do here is install it with all dependencies and make it automatically start when OS boots up.
For that, click on "Show Applications" icon in the lower left corner and start Terminal app.
First, we would need to install curl - enter the following command:

sudo apt install curl

Enter your password and hit Enter.
You should be able to copy and paste to the VM. Keep in mind that Paste in terminal can be done with the right click menu. Hot keys are a little tricky and depend on your host machine - google your particular case.
Next, we will run a script that will install Node-RED and all dependencies. Script is taken from the official Node-Red instructions. Advantage of this method is that it automatically sets up Node-RED to run as a service.

bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered)

Once this is done, let's turn on the automatic restart feature:

sudo systemctl enable --now nodered.service

Now you can restart your VM to make sure Node-RED automatically starts.
Let's open the browser and navigate to localhost:1880
You should see the welcome message.

InfluxDB
Now let's install InfluxDB - our database.
For the latest version please go to the official download page. At the moment of writing this article the latest version is 2.5.1
Select Ubuntu/Debian from the list of operating systems and copy the script.

Paste the script to terminal and run it.
When everything installs - start the service or reboot. InfluxDB should start itself when OS boots up.

sudo service influxdb start

If everything went ok - you should be able to see the web interface of InfluxDB at http://localhost:8086
Grafana
Now the last step in our installation - Grafana. Official instructions are here. We will simply follow them.
First step:

sudo apt-get install -y apt-transport-https
sudo apt-get install -y software-properties-common wget
sudo wget -q -O /usr/share/keyrings/grafana.key https://apt.grafana.com/gpg.key

Add this repository for stable releases:

echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com stable main" | sudo tee -a /etc/apt/sources.list.d/grafana.list


After you add the repository:

sudo apt-get update
And finally installing the package:

sudo apt-get install grafana-enterprise
To start the service and verify that the service has started:

sudo systemctl daemon-reload
sudo systemctl start grafana-server
Following command will show you the status info of the server. Or you can simply go to Grafana web interface at http://localhost:3000

sudo systemctl status grafana-server
One last step - configure the Grafana server to start at boot:

sudo systemctl enable grafana-server.service
Grafana should now be available at localhost:3000/