selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

Trench logo

Self-host Trench

trench-js@0.0.17

Open-source analytics infrastructure for event tracking

BetaOpen SourceMIT
Updated6 months ago
LanguageTypescript
Setup difficultyModerate
Stars
1 665
CPU
4 CPU cores
RAM
4GB RAM
Port
4000 (Trench server HTTP API)
Requires
Apache Kafka, ClickHouse
Install with Docker Compose

What is Trench?

This analytics platform runs on Kafka and ClickHouse to ingest and query high-volume event streams in real time. It implements the Segment tracking API, respects GDPR and PECR rules without cookies, and lets users export data through webhooks. A single Docker Compose file spins up the API, Kafka, and ClickHouse together, while a managed cloud tier adds autoscaling and SLA guarantees.

Should you self-host Trench?

Trench scores 52/100 on selfhost.directory (how scoring works) and ranks #9 of 27 in Analytics. It has 1 665 GitHub stars.

There was no stable release in the past 12 months, so check the repository's recent activity before you rely on it.

Setup is moderate: expect some configuration beyond a single command. It is MIT-licensed and written mostly in Typescript.

Its closest alternative on selfhost.directory is PostHog (81/100, 40 492 stars). It scores higher overall, so compare the two before you pick. See Trench vs PostHog side by side.

Features

  • GDPR/PECR compliance
  • Kafka SASL authentication
  • Kafka SSL/TLS support
  • LLM/RAG support
  • Raw SQL query execution
  • Real-time event processing
  • Real-time SQL queries
  • Segment API Compatibility
  • Webhook destinations

Trench README

How to install Trench

Install Trench with Docker Compose

Docker and Docker Compose

git clone https://github.com/frigadehq/trench.git cd trench/apps/trench cp .env.example .env docker-compose -f docker-compose.yml -f docker-compose.dev.yml up --build --force-recreate --renew-anon-volumes

Requires Docker and Docker Compose installed. Recommended 4GB RAM and 4 CPU cores for production.

Trench releases & version history

More in Data Pipeline

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…