This repository contains a clean, reproducible reference architecture for a small self-hosted environment built with Docker Compose, Postgres, n8n, and optional NocoDB. Secure ingress is provided through a Cloudflared Tunnel.
The goal is to document a simple but realistic multi-service environment that demonstrates service composition, environment configuration, secure ingress patterns, and operational considerations. It is not intended as a production deployment, but as a reproducible template for experimentation and local workflows.
- Postgres 16 Primary relational datastore with persistent storage.
- n8n Workflow automation engine.
- NocoDB (optional) Lightweight database UI and API layer (disabled by default; untested draft configuration).
- Cloudflared Tunnel Zero-trust ingress via Cloudflare, avoiding exposed ports.
- Isolated Docker network (
svc) - Named volumes for persistence (
pg_data,n8n_data,nocodb_data) - Modular service definitions (NocoDB optional)
- Secure ingress through Cloudflare Tunnel
- All secrets and environment-specific values externalized via
.env - Real-world operational commands and structure
.
├── .env.example
├── .gitignore
├── cloudflared
│ └── config.example.yml
├── docker-compose.yml
├── docs
│ └── server-setup.md
└── README.md
git clone https://github.com/<youruser>/homelab-reference-architecture.git
cd homelab-reference-architectureCopy the example:
cp .env.example .envThen edit .env with your actual values for Postgres, n8n, and (optional) NocoDB.
Docker Compose loads .env automatically.
This repo includes a sanitized example config:
cloudflared/config.example.yml
Your real config should live under:
./cloudflared/config.yml
./cloudflared/<YOUR_TUNNEL_UUID>.json
These files are ignored by Git and should never be committed.
docker compose up -dCheck logs:
docker compose logs -fView resolved configuration (with variables substituted):
docker compose configFor full host configuration and rebuild notes, see docs/server-setup.md
(Note that the noco configuration is a draft, untested in this setup)
If you want to run NocoDB locally (instead of on your Mac), uncomment the entire nocodb block in docker-compose.yml:
# nocodb:
# image: nocodb/nocodb:latest
# ...Then restart:
docker compose up -ddocker compose pull
docker compose up -ddocker compose downPersistent volumes remain intact unless removed manually:
docker volume ls
docker volume rm <name>- Secrets never appear in source control
.envis ignored by default- Cloudflared credentials are never tracked
- Example configs are sanitized and generic
- You can store private notes/scripts in
./private/(ignored)
This homelab setup reflects a real environment used for:
- workflow experimentation
- integration prototyping
- testing automation and orchestration patterns
- experimenting with zero-trust ingress
- maintaining a reproducible, versioned infra template
It is intentionally small, readable, and practical — suitable for others to fork or extend for their own personal environments.