Documentation / KIFAA Deployment Guide

KIFAA Deployment Guide

Mt
Antony Njagi KigunduCore Mtaalam Technologies

1. Overview

KIFAA is a self-hosted platform with four moving parts:

  1. API server — Python/FastAPI, 43 REST routers.
  2. Frontend — React/Vite dashboard (45 pages), served by Nginx.
  3. Database — PostgreSQL 15 with the TimescaleDB extension for metrics.
  4. Background workers — Celery with a Redis broker for scheduling (metric evaluation, alerts, AD sync, UPS polling, reports).

Endpoints run the lightweight Go agent — a single cross-compiled binary (Windows amd64/arm64, Linux amd64/arm64) that polls the API every 5 seconds.

2. Prerequisites

RequirementMinimumRecommended
CPU2 cores4+ cores
RAM4 GB8 GB+ (timescale queries love RAM)
Disk40 GB SSDSSD, sized for ~1 GB per 10 agents per month + retention
OSUbuntu 22.04+ / Debian 12Same
SoftwareDocker + Docker Compose v2Same

3. Docker Compose setup

Download the deployment bundle (provided with your KIFAA license from Core Mtaalam) and create the environment file:

unzip kifaa-deploy.zip && cd kifaa-deploy
cp .env.example .env
# Edit .env: DB passwords, secret key, base URL, SMTP/Telegram tokens

Bring up the stack:

docker compose up -d
docker compose logs -f api # watch the API come up

The stack starts PostgreSQL (with TimescaleDB initialized via the timescaledb image), Redis, the API, Celery workers, the Celery beat scheduler and the frontend behind Nginx.

Multiple workers? If you scale the API to several uvicorn workers, startup table creation can race and throw pg_type duplicate-key errors. KIFAA handles this with an idempotent create + rollback pattern — if you ever see it, just restart the API container.

4. Deploying agents

Agents are distributed from the built-in Agent Downloads portal (no manual file copies). In the UI:

  1. Open Agents → Downloads and grab the binary for the target OS.
  2. Install with a registration token (generated in Agents → Add):
# Windows (PowerShell, admin)
.\kifaa-agent.exe --server https://kifaa.example.com --token REGISTER_TOKEN

# Linux
./kifaa-agent --server https://kifaa.example.com --token REGISTER_TOKEN \
--install-systemd

The agent registers itself, then reports CPU, RAM, disk, network, services, software inventory and hardware specs every 5 seconds. Adding a new collector later requires no agent redeploy — collectors are modular server-side.

5. SSL & reverse proxy

For production, put KIFAA behind the bundled Nginx and enable Let’s Encrypt via the platform’s ACME integration (HTTP-01 challenge):

# In the UI: Settings → SSL Certificates → Let's Encrypt
# Add the domain, verify DNS points at this server, click "Request & Auto-renew"

KIFAA also tracks certificate expiry across the fleet and alerts before certificates lapse — dogfooding its own monitoring.

6. First run

  1. Open https://kifaa.example.com and log in with the admin account from .env.
  2. Create the initial admin user under Administration → Users and assign the admin role.
  3. Configure notification channels — Telegram bot token + chat ID, and SMTP for email reports.
  4. Add your first monitor — an agent, or a simple port/URL uptime check.
  5. Schedule a patch window under Patch Management and target a small test group first.

Everything from here is dashboard-driven: alerts, compliance reports, AD operations, UPS policies and the quarterly security report builder.

7. Troubleshooting

SymptomCause / fix
Agent shows OfflineCheck agent service status and that SERVER_URL is reachable from the endpoint. Verify the registration token wasn’t rotated.
Dashboards slow with 137M+ rowsConfirm the time window is narrow (last 2 hours for “latest value” views). The aggregate tables handle deep history.
No Telegram alertsBot token + chat ID in Settings → Notifications; test with “Send test alert”.
Certificate not auto-renewingConfirm port 80 is reachable for the HTTP-01 challenge and the renewal schedule is enabled (Celery beat must be running).
DB filling upReduce the retention policy (default 30 days of raw metrics; summaries are kept longer).

Backups: take a PostgreSQL dump or volume snapshot before major upgrades. KIFAA’s own backup discipline (4-hour automated backups, pre-migration snapshots) applies to your business data — apply the same rule to KIFAA itself.

Need help deploying? We do this for a living →

Keep building

Want this kind of capability in your business?

Tell us what you are trying to run — we will tell you the honest way to run it. Free consultation, no obligation.

Talk to the team