---
title: Installing Factry Historian for production use
slug: how-tos/C1i5-installing-factry-historian-for-production-use
docTags: neOSbBe4J9rk8QtBRT8AU
createdAt: 2025-09-01T12:12:42.873Z
---

This guide will help you install Factry Historian with standard settings for a production-ready installation. It is written for **technical users** who are comfortable working with a terminal and know basic networking concepts.

At the end of this guide, you will find additional steps to configure TLS certificates, external authentication providers, proxy servers, and other settings.

:::hint{type="warning"}
During this guide, you will have to configure users, passwords and secrets. We recommend storing these secrets securely, for example in your **password manager**.
:::

## Prerequisites

Before you start, make sure you have the following in place:

1. License
2. Infrastructure
3. System Resources
4. Networking

### License

To download Factry Historian and install it for production use, make sure you have obtained a license key and signed a license agreement with Factry. If you have not done so already, [please contact Factry to obtain a license](https://www.factry.io/company/contact).

Once both are in place, Factry will provide you with access to the Factry Historian portal. On the portal, you will be able to download all binaries needed for this guide.

### Infrastructure

- A supported version of Ubuntu server LTS ([Download latest Ubuntu LTS image](https://ubuntu.com/download/server))
- Terminal access with administrative privileges

### System Resources

| **Load** | **Writes / second** | **Queries / second** |
| -------- | ------------------- | -------------------- |
| Low      | \< 5.000            | \< 5                 |
| Moderate | \< 100.000          | \< 25                |
| High     | >= 100.000          | >= 25                |

**Low**

- **CPU**: 4 cores
- **Memory**: 8 GB RAM
- **Database disk**: >= 500 IOPS

**Moderate**

- **CPU**: 8 cores
- **Memory**: 16 GB RAM
- **Database disk**: >= 1.000 IOPS

**High**

High loads should be tested before being deployed to production:

- **CPU**: 16 cores
- **Memory**: 64 GB RAM
- **Database disk**: >= 1.000 IOPS

Required disk space starts at 100GB and should be expanded based on expected write load.

### Networking

To install and access the services using this guide:

- Internet access to download Factry Historian and prerequisities
- A fixed (local) IP adress for the server

For a standard setup, the following ports should be available before starting the setup:

- **Factry Historian**: TCP port 8000 (HTTP) and 8001 (gRPC)
- **Grafana:** TCP port 3000

## Install Dependencies

### 1. Update package list and download wget

```bash
sudo apt-get update && sudo apt-get install wget
```

### 2. PostgreSQL

**Install PostgreSQL**

```bash
sudo apt-get install -y postgresql postgresql-contrib
```

**Verify if PostgreSQL is running**

```bash
sudo systemctl status postgresql
```

![](https://api.archbee.com/api/optimize/SMPo4IS9FkillUAMsur2c/n9MobQKbqJO7yxWqgHvUe-20250916-140212.png)

**Create PostgreSQL superuser**

- Replace `<username>` with your desired username (e.g. `factry`)
- You will be prompted to enter and confirm the password for the PostgreSQL superuser.

```bash
sudo -u postgres createuser -s <username> -P
```

**Create Grafana database and administrator user**

Open the PostgreSQL CLI:

```bash
sudo -u postgres psql
```

Then perform the following commands. Replace `<'password'>` with your desired password (e.g. `'my-password'`, keep the surrounding `'`). Replace `<username>` with your desired username (e.g. `factry`).

```sql
CREATE USER grafana WITH ENCRYPTED PASSWORD <'password'>;
CREATE DATABASE factry_historian OWNER <username>;
CREATE DATABASE grafana OWNER grafana;
exit
```

The first line creates the grafana user. The second line creates the database factry\_historian with the given username as the owner. The third line creates the database grafana with the grafana user as the owner. The fourth line exits the postgreSQL CLI.

### 3. InfluxDB

**Download and install InfluxDB**

The first line downloads and installs the InfluxDB (**v1.12.x**) database which stores the time-series data points and logs collected via Factry Historian.

```bash
cd /tmp
wget https://dl.influxdata.com/influxdb/releases/v1.12.4/influxdb_1.12.4-1_amd64.deb
sudo apt-get install -y ./influxdb_1.12.4-1_amd64.deb
sudo systemctl enable --now influxdb
```

**Verify if InfluxDB is running**

```bash
sudo systemctl status influxdb
```

**Create InfluxDB users**

Open the InfluxDB client CLI.

```bash
influx
```

Create a user with administrative privileges in InfluxDB.

- Replace `<admin_username>` with your desired administrator username (e.g. `factry`) and replace `<password>` with your desired password (keep the `'` around the password).
- You will be prompted to enter and confirm the password.

```bash
CREATE USER <admin_username> WITH PASSWORD '<password>' WITH ALL PRIVILEGES;
```

Shows the users available in InfluxDB, check if the admin user is created.

```bash
SHOW USERS;
```

:::BlockQuote
user                   admin
\----                   -----
\[admin\_username]       true
:::

Exit the InfluxDB CLI.

```bash
exit
```

**Configure InfluxDB**

Open your text editor of choice and make the following changes:

```bash
sudo vi /etc/influxdb/influxdb.conf
```

In the `[data]` section:

- edit `query-log-enabled` to `false` to disable (an abundance of) queries being captured in the logs.

In the `[http]` section:

- edit `auth-enabled` to `true` to enable authentication on InfluxDB.
- edit `log-enabled` to `false` to disable (an abundance of) API queries being captured in the logs.

:::hint{type="info"}
Make sure to remove the `#` before the indicated lines for them to be picked up as configuration and not as a comment.
:::

```ini
[data]
query-log-enabled = false

[http]
auth-enabled = true
log-enabled = false
```

After making changes, restart InfluxDB for the changes to take effect

```bash
sudo systemctl restart influxdb
```

### 4. Grafana

**Download and install Grafana**

Download the latest supported version of Grafana, by following their [guide](https://grafana.com/grafana/download?edition=oss). E.g. for version 12.1.1, use the following commands:

```bash
sudo apt-get install -y adduser libfontconfig1 musl
wget https://dl.grafana.com/grafana/release/12.1.1/grafana_12.1.1_16903967602_linux_amd64.deb
sudo dpkg -i grafana_12.1.1_16903967602_linux_amd64.deb
sudo systemctl enable --now grafana-server
```

**Configure Grafana**

Open your text editor of choice and make the following changes:

```bash
sudo vi /etc/grafana/grafana.ini
```

In the `[database]` section:

- edit `type` to `postgres` to setup the Grafana internal database with PostgreSQL
- set `host`to `localhost:5432`(or the host\:ip of your PostgreSQL database)
- set `name` to `grafana` to set the database name
- set `user` to `grafana` to set the user to connect (user created in [2.PostgreSQL](docId\:C1i5Q5n3P8RMlJj5LVhxe) )
- set `password` to the password of that user (Replace `<my-password>` with the password and keep the surrounding `"""` to allow special characters)
- set `ssl_mode` to `disable` to successfully connect with the PostgreSQL database over localhost

:::hint{type="info"}
Make sure to remove the `;`  before the indicated lines for them to be picked up as configuration and not as a comment.
:::

```ini
[database]
type = postgres
host = localhost:5432
name = grafana
user = grafana
password = """<my-password>"""
ssl_mode = disable
```

After making changes, restart Grafana for the changes to take effect

```bash
sudo systemctl restart grafana-server
```

**Verify if Grafana is running**

```bash
sudo systemctl status grafana-server
```

**Install Factry Historian datasource in Grafana**

Install the [Factry Historian datasource plugin](https://grafana.com/grafana/plugins/factry-historian-datasource/) in Grafana to easily fetch Historian data in Grafana, and restart Grafana for the changes to take effect.

```bash
sudo -u grafana grafana-cli plugins install factry-historian-datasource
sudo systemctl restart grafana-server
```

### 5. Lock dependency versions (Optional)

Lock the versions of the installed services to prevent unintentional updates to the installed services when (automated) patches are performed on the server.

```bash
sudo apt-mark hold postgresql influxdb grafana
```

### 6. Install Factry Historian

Login to the Factry Historian Portal and download the Factry Historian installation executable for your CPU architecture.

1. Navigate to [https://portal.factry.cloud](https://portal.factry.cloud)
2. Login with your credentials
3. Once logged in, click Downloads in the header menu
4. In the Downloads panel:
   - Select a release channel (Stable)
   - Select a product (Factry Historian)
   - Select a version
   - Select an OS/Platform (Linux/AMD64)
5. For an offline installation, click **Download** to download the binary and manually copy it to the host system. For installation on a system with internet access, click **Copy URI** to copy the link and download it with e.g. `wget`.
6. Place to executable on a location where you have write access e.g. your home folder.

Replace the `factry-historian-server_vx.x.x` filename with the filename of your executable. Perform the command(s) in the CLI:

```bash
chmod a+x factry-historian-server_vx.x.x
sudo ./factry-historian-server_vx.x.x install
```

**Verify if Factry Historian is running**

```bash
sudo systemctl status factry-historian-server
```

For more options and details, follow [Downloading and Installing Factry Historian server](docId\:sWKCAYy17F7TL9mntIDrj).

### 7.  Synchronize server time with NTP (Recommended)

Show the time and date on the server and the state of NTP synchronization.

```bash
timedatectl
```

- Check if the time and date are set correctly. Note that the timezone is typically set in UTC: [Compare time between different timezones](https://dateful.com/time-zone-converter).
- Check if `NTP service` states `active`, which indicates that the server is synchronized with an NTP server.

:::BlockQuote
&#x20;              Local time: Wed 2025-09-17 12:35:41 UTC
&#x20;          Universal time: Wed 2025-09-17 12:35:41 UTC
&#x20;                RTC time: Wed 2025-09-17 12:35:41
&#x20;               Time zone: Etc/UTC (UTC, +0000)
System clock synchronized: yes
&#x20;             NTP service: active
&#x20;         RTC in local TZ: no
:::

:::hint{type="info"}
Is the date and time not correct or the NTP service is not active? See the [Troubleshooting section](docId\:C1i5Q5n3P8RMlJj5LVhxe).
:::

### 8. Confirm service availability

Verify if you can access Factry Historian and Grafana in the browser:

- Historian: `http://xx.xx.xx.xx:8000`
- Grafana: `http://xx.xx.xx.xx:3000`

If that is not the case, see the [Troubleshooting section](docId\:C1i5Q5n3P8RMlJj5LVhxe).

:::hint{type="info"}
Make sure to use `http://` in your browser. Some browsers override it automatically to `https://`, in which case use an incognito window.
:::

🎉 **Congratulations!** You have successfully installed Factry Historian and Grafana.

## Next steps

### Security

For additional security, we recommend the following additional steps:

- Add HTTPS: [reverse proxy Factry Historian and Grafana](docId\:Hzv6xWojQnCTwCthjRrJt), then [install the certificates](docId\:KXtR223cFsfY9cLHVNBc3) on the proxy webserver.
- [Configure the firewall](docId\:oOLMnbb6Av_1WYgYMiC9H)
- Configure external [Authentication Providers](docId\:tMrvAihp5fXU5o0z5TgbD)

### Configuration

- Further configure Factry Historian according to your preferences. Consult the [Reference documentation](docId\:YzfeERqJg7KyvPZpHFq4e).

### Data collection

- [Add and configure a collector](docId\:Iv4_SD56TdxcqKRKCj4kv)

## Troubleshooting

### Services: See logs

These lines show the service logs of the according service unit with `-u`, and with `-r`sorted in reversed time order (newest logs on top).

```bash
journalctl -u postgresql -r
journalctl -u influxdb -r
journalctl -u grafana-server -r
journalctl -u factry-historian-server -r
```

### Services: Verify if port is accessible

Check if the server is accepting TCP connections (replace `xx.xx.xx.xx` with your Factry Historian Ubuntu server IP address) on the appropriate port. For example, with `telnet`:

```bash
telnet xx.xx.xx.xx 8000
```

If successful, the output states `Connected to ...`.
Press `CTRL + ]` and `CTRL + C` to exit the command.

### NTP synchronization for correct date and time

Open the NTP synchronization settings using your editor of choice:

```bash
vi /etc/systemd/timesyncd.conf
```

Change the configuration to point to public NTP servers, or configure your company's NTP servers.

An example with Ubuntu's NTP servers:

:::BlockQuote
NTP=ntp.ubuntu.com
FallbackNTP=ntp.ubuntu.com
:::

Save the file and exit your editor.

Restarts the timesyncd service for the changes to take effect. Next, enables NTP synchronization. Then check if the status of the timesync service is set to `Active`.

```bash
systemctl restart systemd-timesyncd
timedatectl set-ntp true
systemctl status systemd-timesyncd
```

### Need help?

Contact [Factry](https://www.factry.io/) for licenses, support, or migrating from legacy historians.
