Skip to Content
The HIC Learning Exchange begins July 13, 2026. View the agenda
ReadingItem 2 of 22 · 10 min

Environment and Infrastructure Set-up

This is the Infrastructure sub-module of the HIC Exchange System Engineering track: server and environment set-up, Docker, PostgreSQL, the data warehouse stack, and deployment. It is the single, unified runbook for standing up the MNCH Data Warehouse platform from bare infrastructure all the way to a running analytics stack — it consolidates the VM provisioning playbook, the Ansible handy playbooks, and the warehouse deployment docs into one continuous flow.

Part 1 of 4Lab 1: Provision & Configure · Lab 2: Deploy & Release · Operations & Troubleshooting

A note on values in this guide. Concrete hosts, usernames, IPs, and DB accounts from the source docs are shown here as placeholders (e.g. <DEPLOY_HOST>, <DEPLOY_USER>, <DB_USER>, <VM_STATIC_IP>). Substitute your environment’s real values when you run the commands — keep the real ones in your secret store / password manager, not in these pages.

The Big Picture

The platform is built in four stacked layers. Each layer is provisioned once and then largely left alone; day-to-day changes flow through the CI/CD pipeline at the top.

Layer 4Warehouse ApplicationPrefect · dbt · Dagster · Superset

Deployed as 3 Docker containers via GitHub Actions CI/CD

Layer 3VM Base ConfigAnsible playbooks 01–06

Updates, firewall, nginx, Docker, PostgreSQL client, SSL

Layer 2Guest VMUbuntu 22.04 on libvirt NAT network

Static private IP · host port-forwarding · reverse proxy · snapshot

Layer 1KVM / libvirt HostPhysical or cloud bare-metal box

Public IP · virbr0 NAT bridge (192.168.122.0/24) · virt-install

And here is the request/data flow once everything is live:

Where the databases live

The warehouse uses one external PostgreSQL server (not containerized), holding four separate databases. Know this distinction — it is the single most common source of confusion:

DatabaseOwned byPurpose
prefect_dbPrefectPrefect’s own orchestration metadata
superset_dbSupersetSuperset app state (users, charts, dashboards)
dagster_dbDagsterDagster run / event-log / schedule storage
<warehouse_db> (default mnch_main_db)the pipelineThe actual data warehouse: landing → staging → intermediate → marts

Phase 0 — Prerequisites Checklist

Before you begin, confirm you have all of the following.

On the KVM host:

  • KVM + libvirt installed (virsh, virt-install)
  • A libvirt NAT bridge (default virbr0, 192.168.122.0/24)
  • A static public IP with the ability to port-forward
  • Ubuntu 22.04 LTS Server ISO available on the host
  • Tools: virsh, virt-install, iptables, netplan, nginx
  • SSH + sudo access to the host; serial-console access for OS install

On your control machine (laptop):

  • Ansible 2.9+ installed (for Phase 2)
  • The GitHub CLI  (gh), authenticated (gh auth login) — for Phase 3
  • SSH key material for the VM deploy user

External dependencies:

  • A reachable PostgreSQL server for the four databases above
  • Credentials for the eBuzima and HMIS/DHIS2 source APIs
  • (Optional but recommended) a domain name pointed at the public IP, for real TLS

What’s next

With the prerequisites in hand, head to Lab 1: Provision the VM & Configure with Ansible to create the guest VM on the KVM host and bring its OS to a secure, Docker-ready baseline.