Self-hosted product analytics. One snippet. No third parties. No cookie banners.
Own your analytics. No tracking scripts calling external APIs, no GDPR headaches, no vendor lock-in.
your website → lightweight event endpoint → SQLite → real-time dashboard
- Fork this repo
- Create a new project on Railway and deploy from your fork
- Add the snippet to your site:
<script src="https://your-railway-url/track.js" async></script>- View your dashboard at
https://your-railway-url/dashboard.html
- Hetzner CX22 — €4/mo, fast, European servers
- DigitalOcean Droplet — $6/mo, easy UI
Get a server running Ubuntu 22+.
curl -fsSL https://get.docker.com | shgit clone https://github.com/yourusername/trackvault
cd trackvault
docker compose up -dIn your DNS provider, add an A record:
analytics.yoursite.com → YOUR_SERVER_IP
apt install nginx certbot python3-certbot-nginx -y
cat > /etc/nginx/sites-available/trackvault << 'EOF'
server {
server_name analytics.yoursite.com;
location / {
proxy_pass http://localhost:3000;
proxy_set_header X-Forwarded-For $remote_addr;
}
}
EOF
ln -s /etc/nginx/sites-available/trackvault /etc/nginx/sites-enabled/
nginx -t && systemctl reload nginx
certbot --nginx -d analytics.yoursite.com<script src="https://analytics.yoursite.com/track.js" async></script>https://analytics.yoursite.com/dashboard.html
Set a token in docker-compose.yml:
environment:
- DASHBOARD_TOKEN=your-secret-tokenThen restart:
docker compose up -dAccess at:
https://analytics.yoursite.com/dashboard.html?token=your-secret-token
⚠️ For production, consider placing Trackvault behind basic auth or a VPN instead of a URL token.
npm install
npm startOpen http://localhost:3000/dashboard.html. To send a test event without touching your site, paste this in your browser console:
fetch('http://localhost:3000/event', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ path: '/test', referrer: '', ua: 'test', w: 1920, h: 1080, sid: 'abc123', ts: Date.now() })
})| Trackvault | Plausible | Umami | GA4 | |
|---|---|---|---|---|
| Self-hosted | ✅ | ✅ | ✅ | ❌ |
| No cookies | ✅ | ✅ | ✅ | ❌ |
| No external requests | ✅ | ❌ | ❌ | ❌ |
| Setup time | ~5 min | ~15 min | ~15 min | ~20 min |
| Dependencies | Node + SQLite | Postgres | MySQL/Postgres | |
| Free | ✅ | $9/mo cloud | ✅ | ✅ |
| Variable | Default | Description |
|---|---|---|
PORT |
3000 |
Server port |
DB_PATH |
./data/events.db |
SQLite file location |
DASHBOARD_TOKEN |
(none) | If set, dashboard requires ?token=VALUE |
No cookies, no cross-site tracking. Data stays on your server. You are fully in control of compliance.
docker cp trackvault-pockettrack-1:/app/data/events.db ./backup.dbApache License 2.0
