---
title: Advanced Setup
slug: AfzI-advanced-setuo
icon: {"lucideIcon":"👩‍💻"}
docTags: 
createdAt: 2025-08-27T12:21:09.534Z
---

The [quick start setup](docId\:MYrFSdThXLh5xQK06iK-m) is designed for quick evaluation and runs with defaults directly from the `docker-compose.yml`. For deeper evaluation, you can configure the stack using environment variables.

This page explains how to extend the setup with your own .env file and details the **mandatory** and **optional** variables you can use.

## Creating an environment file

In the `/advanced` directory, create a file named .env:

```bash
touch .env
```

Docker Compose will automatically load variables from this file and substitute them into the configuration.

If you would use a different name, you can later pass the correct `.another-env` to `docker compose --env-file .another-env up -d`.

## Required environment variables

These variables must be set to ensure the services start securely and consistently.

| **Variable**                  | **Description**         |
| ----------------------------- | ----------------------- |
| DB\_PASSWORD                  | PostgreSQL password     |
| INFLUXDB\_ADMIN\_PASSWORD     | InfluxDB admin password |
| GF\_SECURITY\_ADMIN\_PASSWORD | Grafana admin password  |

Alternatively, you can also pass these environment variables via the command line.

## Optional environment variables

You can also define the optional variables to adapt the setup to your environment.

**General**

| **Variable** | **Default** | **Description**                    |
| ------------ | ----------- | ---------------------------------- |
| TZ           | UTC         | Timezone for the Docker containers |

**Factry Historian**

| **Variable**        | **Default**       | **Description**                 |
| ------------------- | ----------------- | ------------------------------- |
| VERSION             | latest            | Factry Historian version to use |
| AUTO\_MIGRATE       | true              | Auto-perform migrations         |
| DB\_NAME            | factry\_historian | PostgreSQL database name        |
| DB\_USER\_NAME      | factry            | PostgreSQL username             |
| GRPC\_PORT          | 8001              | gRPC port                       |
| GRPC\_BIND\_ADDRESS | 0.0.0.0           | gRPC bind address               |
| REST\_PORT          | 8000              | REST API port                   |
| REST\_BIND\_ADDRESS | 0.0.0.0           | REST API bind address           |

**Grafana**

| **Variable**                   | **Default**       | **Description**                  |
| ------------------------------ | ----------------- | -------------------------------- |
| GF\_VERSION                    | latest            | Grafana OSS version              |
| GF\_SERVER\_ROOT\_URL          | http\://127.0.0.1 | Grafana root URL                 |
| GRAFANA\_PORT                  | 3000              | Grafana server port              |
| GF\_AUTH\_ANONYMOUS\_ENABLED   | false             | Enable anonymous access          |
| GF\_AUTH\_ANONYMOUS\_ORG\_NAME | Factry            | Organization for anonymous users |
| GF\_BIND\_ADDRESS              | 0.0.0.0           | Grafana bind address             |

**InfluxDB**

| **Variable**          | **Default** | **Description**         |
| --------------------- | ----------- | ----------------------- |
| INFLUXDB\_ADMIN\_USER | factry      | InfluxDB admin username |

## Validating your configuration

Before starting the stack, run:

```bash
docker compose config
```

This will render the final configuration with your environment variables applied, making it easy to confirm credentials and port mappings.

:::hint{type="info"}
**Keep secrets safe!&#x20;**&#x41;void committing .env files with passwords into Git. Instead, use a secret management tool or keep a local .env excluded via .gitignore.
:::
