Self-host Quickstart
Get set up with Trench in less than 5 minutes
Deploy Trench
The only prerequisite for Trench is a system that has Docker and Docker Compose installed see installation guide. We recommend having at least 4GB of RAM and 4 CPU cores for optimal performance if you’re running a production environment.
After installing Docker, you can start the local development server by running the following commands:
The above command will start the Trench server that includes a local ClickHouse and Kafka instance on http://localhost:4000
. You can update the .env
to change any of the configuration options.
Send a sample event
You can find and update the default public and private API key in the .env
file. Using your public API key, you can send a sample event to Trench as such:
Quering events
You can query events using the /events
endpoint (see API reference for more details).
You can also query events directly from your local Trench server. For example, to query events of type ConnectedAccount
, you can use the following URL:
This will return a JSON response with the event that was just sent:
Execute raw SQL queries
Use the queries endpoint to analyze your data. Example:
Sample query result:
Going Further
While the above steps are a great starting point, the following video tutorial exemplifies the many things you can do with Trench. In this video, we build a mini version of Google Analytics using Trench and Grafana:
Related Resources
Was this page helpful?