Self-hosting
Beacon runs as one Docker Compose stack: Nginx, the dashboard, the ingest service, the worker, Postgres, ClickHouse and Redis. You need a server with Docker and Compose.
Install
Section titled “Install”-
Get the code at the latest release and copy the env file. Releases are tagged
vX.Y.Zand listed on the tags page.Terminal window git clone https://github.com/tbdsux/beacon.gitcd beacongit checkout v0.1.0cp .env.example .env -
Set the secrets in
.env:POSTGRES_PASSWORD,CLICKHOUSE_PASSWORD,REDIS_PASSWORD,AUTH_SECRET,INGEST_SECRETandAPP_URL. Use long random values, for example:Terminal window openssl rand -hex 24Every variable is described in Environment variables.
-
Start the stack. Compose builds the images from the checked-out code, and every
upruns the database migrations before the apps start.Terminal window docker compose up -d -
Open
APP_URLand finish setup.
Nginx serves plain HTTP on HTTP_PORT (default 80). To serve HTTPS from the same container,
follow the steps at the top of infra/nginx/tls.conf.template.
If a proxy or tunnel in front of Beacon already terminates TLS (Cloudflare Tunnel, Caddy, a
load balancer), enable the trusted-proxy block in
infra/nginx/templates/00-beacon-http.conf.template so visitor IPs come from the right header.
Upgrading
Section titled “Upgrading”Back up first: before 1.0, a minor release (0.1 to 0.2) can include breaking changes. Then check out the new release and rebuild. Migrations run on start.
git fetch --tagsgit checkout v0.2.0docker compose up -d --buildPrebuilt images
Section titled “Prebuilt images”Every release also publishes the app images to the GitHub Container Registry, for running Beacon without this Compose file:
| Image | Runs |
|---|---|
ghcr.io/tbdsux/beacon-dashboard |
The dashboard and its API |
ghcr.io/tbdsux/beacon-ingest |
The ingest service and the tracker script |
ghcr.io/tbdsux/beacon-worker |
Background jobs: exports, digests, alerts, retention |
ghcr.io/tbdsux/beacon-migrate |
One-shot Postgres and ClickHouse migrations |
Each is tagged with the exact version (0.1.0), its minor line (0.1) and latest, for
linux/amd64 only. Run all four at the same version, let beacon-migrate finish before the
others start, and give each the environment that docker-compose.yml sets for it. A proxy in
front must send INGEST_PREFIX paths to ingest and the rest to the dashboard, as
infra/nginx/templates/beacon-locations.inc.template does.
Countries, regions and cities need a MaxMind GeoLite2 or DB-IP Lite .mmdb file. Mount it into
the ingest container and set GEOIP_DB_PATH to its path; the ingest service in
docker-compose.yml shows how. Without it, locations show as Unknown.
Digests and email alerts need SMTP. A superadmin sets it up in the dashboard under Settings → Email. Webhook alerts work without it.
Backups
Section titled “Backups”Back up Postgres, the ClickHouse analytics tables and Redis to backups/<UTC timestamp>:
infra/scripts/backup.shRestore one:
infra/scripts/restore.sh backups/<timestamp>