Self-hosted, privacy-friendly web analytics
Beacon counts visitors without setting cookies or storing IP addresses, and keeps every event in your own Postgres and ClickHouse. These docs cover running it, adding it to your sites, and reading the dashboard.
From nothing to your first pageview
Run the stack
On a server with Docker, set the secrets in
.envand start everything. The database migrations run on start.Terminal window cp .env.example .envdocker compose up -dAdd the snippet
Add a website in the dashboard and paste its script tag into the
<head>of every page. Building with a framework? Use the SDK instead.index.html <scriptdefersrc="https://beacon.example.com/x/s.js"data-website-id="your-website-uuid"></script>Watch it arrive
Open your site, then the website's Live tab: your visit shows up within seconds. The tracker sent just this event, with no cookie. Ingest turns your IP and user agent into a visitor ID that changes every month, and stores neither.
POST /x/e {"website": "your-website-uuid","type": "pageview","url": "https://acme.example/pricing","title": "Pricing","referrer": "https://news.ycombinator.com/","screen": "1440x900","language": "en-US"}
Then read it in the dashboard
Every website gets an overview, events, funnels, a live view and Web Vitals. Click any row in a breakdown to filter the whole dashboard by it.

Browse the docs
Getting started
- Introduction
What Beacon is, what it records, and how its parts fit together.
- Self-hosting
Run Beacon on your own server with Docker Compose.
- First run
Create the superadmin account, add a website and check that events arrive.
Tracking
- Script tag
Track a site with the zero-install script, no build step needed.
- JavaScript SDK
Install @tbdhdev/beacon-sdk in an app with a build step.
- Framework guides
Set up @tbdhdev/beacon-sdk in React, Next.js, Vue, Nuxt, Svelte, SvelteKit, Solid, TanStack and Astro.
- Server-side events
Send events from your backend, and route browser events through your own site.
- Privacy
How Beacon counts visitors without cookies, and what it stores.
Dashboard
- Overview
Read a website's traffic, compare periods, filter, and mark events on the chart.
- Events
See your custom events and the values of their properties.
- Funnels
Measure how many visitors complete a sequence of pages and events.
- Live
Watch events arrive and see who is on the site right now.
- Web Vitals
Core Web Vitals from real visitors, overall and per page.
- Website settings
Get the tracking code, share the dashboard, and configure what a website collects.
- Sharing
Publish a read-only dashboard and a pageview badge.
- Exports
Download a website's raw events as CSV or JSON.
- Alerts and digests
Get scheduled summaries and be told about traffic spikes and downtime.
Administration
- Users and roles
Add people to Beacon and choose which websites they can see.
- API keys
Create keys for server-side events, deploy annotations and the stats API.
- Profile and security
Change your name, email and password, turn on two-factor sign-in, and manage sessions.
- Instance settings
Settings that apply to the whole Beacon instance. Superadmins only.
- System
Check ingest, storage and background jobs at a glance. Superadmins only.
Reference
- HTTP API
Read stats, add annotations and embed badges over HTTP.
- Environment variables
Every setting in .env, by the service that reads it.