> ## Documentation Index
> Fetch the complete documentation index at: https://docs.onefirewall.com/llms.txt
> Use this file to discover all available pages before exploring further.

# WCF Platform On-Prem Installation

> Install the OneFirewall WCF Platform on your own infrastructure with Docker Compose, a single Kubernetes manifest, or Helm.

The **WCF Platform** is the on-prem version of the OneFirewall platform. It runs the OneFirewall API, its database, Elasticsearch, and Kibana in your network, and synchronizes threat intelligence with the OneFirewall cloud.

This page explains how to install it. It is not the WCF Agent: to install the agent that pushes feeds to your firewalls, see [WCF Installation](https://docs.onefirewall.com/essentials/wcf-installation.md).

## Components

| Component | Purpose |
| - | - |
| HAProxy (`onefirewall-proxy`) | Entry point (HTTP/HTTPS), load balancing, IP blocklist, basic auth for Kibana |
| `onefirewall-server` | OneFirewall API (port 8081) |
| MongoDB | Application database |
| Elasticsearch | Threat intelligence (index `stix2_3`) and traffic data |
| Kibana | Reports, served at `/report/` |
| `onefirewall-cloud-connector` | Synchronization with `app.onefirewall.com` |
| `onefirewall-threat-ip-history` | History of malicious IP addresses |
| Blocklist feed | Loads the list of IP addresses to block into HAProxy |
| `onefirewall-intersect-data` | Matches traffic against threat intelligence (optional with Docker) |
| `onefirewall-fluentbit-adapter` | Receives syslog (UDP 514) from firewalls and HAProxy (optional with Docker) |

## 1. Prerequisites

### 1.1 Choose a deployment mode

| Environment | Mode | Elasticsearch |
| - | - | - |
| One server | Docker Compose | Single node |
| Kubernetes without Helm | Single manifest | Single node or 3-node cluster |
| Kubernetes with Helm or CI/CD | Helm chart | Single node or 3-node cluster |

### 1.2 Sizing

| | Basic | Recommended |
| - | - | - |
| **RAM** | 24 GB | 32–48 GB |
| **vCPU** | 8 | 16 |
| **Disk** | 100 GB | 150 GB or more, depending on data retention |

Elasticsearch uses an 8 GB heap by default (`ES_JAVA_OPTS`). With more RAM, you can raise the heap up to half of the memory available to Elasticsearch.

For Kubernetes, you also need Kubernetes 1.25+, `kubectl`, an Ingress controller, and either a default StorageClass or local disks on the nodes. Helm needs Helm 3.10+.

### 1.3 Network requirements

| Direction | Protocol / Port | Purpose |
| - | - | - |
| Inbound | TCP 443 (HTTPS) | API, Kibana reports (`/report/`) |
| Inbound | UDP 514 (Docker) / UDP 31500 (Kubernetes NodePort) | Syslog from firewalls (optional) |
| Outbound | TCP 443 → `registry.onefirewall.com` | Download container images |
| Outbound | TCP 443 → `app.onefirewall.com` | Cloud synchronization and threat feeds |

If outbound traffic goes through an HTTP proxy, set `HTTP_PROXY` / `HTTPS_PROXY` for the cloud connector.

### 1.4 Credentials

Get these values from **[app.onefirewall.com](https://app.onefirewall.com)**:

| Credential | Used by |
| - | - |
| Registry username and password (`registry.onefirewall.com`) | Image download |
| `ALLIANCE_KEY` | `onefirewall-server` |
| `OFA_CONFIG_SECRET` | `onefirewall-server` |
| `JWT_CLOUD`, `JWT_ONPREM` | Cloud connector, blocklist feed |
| Agent ID (`AGID`) | Blocklist feed |
| Member ID, agent tags, adapter JWTs | Fluent Bit adapter (only if you collect syslog) |

> [!TIP]
>
> If a value is not available in the console, or you need the deployment package, contact [support@onefirewall.com](mailto:support@onefirewall.com).

You choose the local credentials yourself:

```bash theme={null}
openssl rand -hex 24                   # MongoDB password (URL-safe)
openssl passwd -6 'YourKibanaPassword'  # password hash for Kibana at /report/
```

## 2. Install

Every mode starts from the `onefirewall-wcf-platform` deployment package. Each folder in the package has a `README.md` with the full list of parameters.

> [tab] Docker Compose
>
> All parameters are in the `.env` file.
>
> **1. Configure**
>
> ```bash theme={null}
> cd docker
> cp .env.example .env
> vi .env    # fill in every value marked OBBLIGATORIO (required)
> ```
>
> Put the Kibana password hash in single quotes: `REPORT_PASSWORD_HASH='$6$...'`.
>
> **2. Prepare the host**
>
> ```bash theme={null}
> ./scripts/init.sh
> ```
>
> The script creates the storage folders, sets the Elasticsearch permissions, and generates a self-signed certificate if `haproxy/certs/onefirewall.pem` does not exist.
>
> **3. Start**
>
> ```bash theme={null}
> docker login registry.onefirewall.com
> docker compose pull
> docker compose up -d
> ```
>
> To enable optional services, set `COMPOSE_PROFILES` in `.env`, for example `COMPOSE_PROFILES=blocklist,fluentbit`. The available profiles are `blocklist`, `fluentbit`, `intersect-data`, and `es-cleaner`.
>
> To use your own certificate, concatenate the certificate and the key into `haproxy/certs/onefirewall.pem`, then run `docker compose restart haproxy`.

> [tab] Kubernetes manifest
>
> `k8s/onefirewall-wcf.yaml` contains every resource: namespace, Secrets, ConfigMaps with the operating parameters, storage, workloads, Services, and Ingress.
>
> **1. Configure**
>
> Edit the sections marked `CONFIGURAZIONE 1/4` to `4/4`, and replace every `CHANGE_ME_*` value:
>
> ```bash theme={null}
> cd k8s
> grep -n CHANGE_ME onefirewall-wcf.yaml
> vi onefirewall-wcf.yaml
> ```
>
> **2. Choose the Elasticsearch mode**
>
> In the `onefirewall-elasticsearch-config` ConfigMap and the `onefirewall-elasticsearch` StatefulSet:
>
> | Mode | `ES_MODE` | `ES_CLUSTER_SIZE` | StatefulSet `replicas` |
> | - | - | - | - |
> | Single node (default) | `single` | `"1"` | `1` |
> | Cluster | `cluster` | `"3"` | `3` |
>
> `ES_CLUSTER_SIZE` and `replicas` must have the same value.
>
> **3. Create the TLS secret**
>
> ```bash theme={null}
> kubectl create namespace ofa
> kubectl -n ofa create secret tls ingress-ofa --cert=tls.crt --key=tls.key
> ```
>
> **4. Apply**
>
> ```bash theme={null}
> kubectl apply -f onefirewall-wcf.yaml
> kubectl -n ofa get pods -w
> ```
>
> The ConfigMaps are read when a pod starts. After you change a parameter, apply the file again and run `kubectl -n ofa rollout restart deployment`.

> [tab] Helm
>
> **1. Create the Secrets**
>
> ```bash theme={null}
> cd helm
> cp cd_scripts/secrets.env.example cd_scripts/secrets.env
> vi cd_scripts/secrets.env
> ./cd_scripts/create-secrets.sh
> ```
>
> You can run the script again to update the Secrets.
>
> **2. Set the parameters**
>
> Replace the `CHANGE_ME_*` values (Agent ID, Member ID, agent tags) in `values-prod.yaml`:
>
> ```bash theme={null}
> grep -n CHANGE_ME values-prod.yaml
> ```
>
> **3. Install**
>
> Use one of the two Elasticsearch values files:
>
> ```bash theme={null}
> helm dependency build .
>
> # Single node
> helm upgrade --install ofa . -n ofa --create-namespace \
>   -f values.yaml -f values-prod.yaml -f values-elasticsearch-single.yaml
>
> # 3-node cluster
> helm upgrade --install ofa . -n ofa --create-namespace \
>   -f values.yaml -f values-prod.yaml -f values-elasticsearch-cluster.yaml
> ```

### Local disks (bare-metal Kubernetes)

If your cluster has no dynamic storage, create PersistentVolumes on the node disks before you install:

1. Set your node names (`kubectl get nodes`) in `k8s/optional/local-persistent-volumes.yaml`.
2. Create the folders listed in the file on each node. Run `chown -R 1000:0` on the Elasticsearch folder.
3. Run `kubectl apply -f k8s/optional/local-persistent-volumes.yaml`.
4. Single manifest only: uncomment the `storageClassName: local-storage-*` lines.

A single-node Elasticsearch needs one Elasticsearch volume. A cluster needs three, one on each node.

> [!WARNING]
>
> A cluster needs `vm.max_map_count=262144` on each node. The single manifest sets it with a privileged init container. If your cluster does not allow privileged containers, remove the init container and run `sysctl -w vm.max_map_count=262144` on each node instead.

> [!NOTE]
>
> Choose the Elasticsearch mode before the first installation. To move existing data from a single node to a cluster, you need a migration. Contact [support@onefirewall.com](mailto:support@onefirewall.com).

## 3. Verify

```bash theme={null}
curl -k https://<host>/healthz             # returns OK
curl -k https://<host>/api/v1/version      # returns the platform version
```

* **Kibana:** open `https://<host>/report/` and sign in with `REPORT_USER` (default `onefirewall`) and your password.
* **Docker:** `docker compose ps` lists every service as `running`.
* **Kubernetes:** `kubectl -n ofa get pods` lists every pod as `Running`.

## 4. Troubleshooting

| Symptom | Likely cause |
| - | - |
| `ErrImagePull` or `pull access denied` | Wrong registry credentials. Check them in [app.onefirewall.com](https://app.onefirewall.com). |
| Elasticsearch stops with `max virtual memory areas` | Set `vm.max_map_count=262144` on the host or node. |
| Elasticsearch (Docker) stops with `AccessDeniedException` | Run `sudo chown -R 1000:0 docker/storage/elasticsearch`. |
| PVC stays `Pending` | No matching StorageClass or local PersistentVolume. |
| The cloud connector does not sync | Wrong `JWT_CLOUD` / `JWT_ONPREM`, or the outbound proxy (`HTTPS_PROXY`) is missing. |
| `401` on `/report/` | The Kibana password hash is wrong, or (Docker) it is not in single quotes. |

> [!WARNING]
>
> Elasticsearch, Kibana, and MongoDB do not require authentication. Do not expose them to the internet. Docker binds them to `127.0.0.1`. In Kubernetes they are `ClusterIP` Services. Kibana is reachable only through HAProxy at `/report/`, with basic auth.

For any other problem, contact [support@onefirewall.com](mailto:support@onefirewall.com). Include the output of `docker compose logs`, or of `kubectl -n ofa get pods` and `kubectl -n ofa logs <pod>`.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.