Self-host quick start
The server receives samples from samplers in push mode. It keeps the time series in ClickHouse and evaluates the thresholds. The Mac app reads the data from the server over a REST and WebSocket API.
The Docker Compose stack has three services:
| Service | What it does |
|---|---|
server |
The Towertail server. It listens on port 8080, on 127.0.0.1 only. |
clickhouse |
Keeps the metrics. |
caddy |
Terminates TLS on ports 80 and 443, and sends requests to the server. |
Requirements
Section titled “Requirements”- A host with Docker and Docker Compose.
- Git, to get the source. The stack builds the server image from the source.
Start the stack
Section titled “Start the stack”-
Get the source and go to the Docker folder:
Terminal window git clone https://github.com/towertail/towertail.gitcd towertail/server/docker -
Write a strong ClickHouse password to the secret file:
Terminal window openssl rand -hex 32 > secrets/ch_password -
Build and start the stack:
Terminal window docker compose up -d --build -
Make sure that the server is up:
Terminal window curl http://127.0.0.1:8080/healthzcurl http://127.0.0.1:8080/readyzThe
/readyzendpoint returns503until the server connects to ClickHouse.
Then make a user token for the Mac app. Read Tokens.
Reach the server
Section titled “Reach the server”Caddy serves the site towertail.local. To use this name on the host, add a line to /etc/hosts that points towertail.local to 127.0.0.1. For a real domain, edit caddy/Caddyfile.
docker compose logs -f serverThe server writes JSON logs to stdout. Each change to a node or to the settings writes one log line with msg=audit.
Upgrade
Section titled “Upgrade”-
Get the new source:
Terminal window git pull -
Build and start the new server:
Terminal window docker compose up -d --build server
ClickHouse migrations apply automatically when the server connects. Mac apps and samplers connect again automatically.
Backup
Section titled “Backup”The server keeps nodes, tokens and settings in one BoltDB file, config.db, in the server-data volume. Copy this file while the server is stopped. If you lose this file, you lose the configuration, but not the metrics.
For settings, read Configuration.