Updog is a privacy-focused, self-hosted web analytics platform. It provides real-time insights into your website's traffic without compromising user privacy.
- Real-time Analytics: View current visitors, pageviews, and active sessions in real-time.
- Privacy Focused: Designed to respect user privacy.
- Detailed Metrics: Track top pages, referrers, device types, browsers, and operating systems.
- Geographic Data: Visualize visitor locations with country and city-level granularity (powered by MaxMind).
- Multi-Domain Support: Manage and track multiple domains from a single dashboard.
- Flexible Storage: Supports both SQLite (default) and PostgreSQL databases.
- Self-Hosted: Full control over your data and infrastructure.
- Go: Version 1.25 or higher.
- Make: For running build commands.
- Docker (Optional): For containerized deployment.
-
Clone the repository:
git clone https://github.com/zackb/updog.git cd updog -
Download dependencies:
go mod download
To build the project, run:
make buildThis will create the updog binary in the current directory.
To run the application locally:
make runFor development mode (with verbose logging):
make run-devThe server will start on port 8080 by default. Access the dashboard at http://localhost:8080.
Updog is configured via environment variables.
| Variable | Description | Default |
|---|---|---|
HTTP_PORT |
The port the HTTP server listens on. | 8080 |
DATABASE_URL |
Database connection string. Use postgres://... for PostgreSQL. If empty or sqlite, defaults to SQLite. |
file:db.db?cache=shared&_fk=1 |
MAXMIND_CITY_DB |
Path to the MaxMind GeoLite2 City database. | data/maxmind/GeoLite2-City.mmdb |
TLS_CERT_PATH |
Path to the TLS certificate file for HTTPS. | "" |
TLS_KEY_PATH |
Path to the TLS key file for HTTPS. | "" |
DEV |
Set to true or 1 to enable development mode. |
false |
To track a website, add the following snippet to the <head> of your HTML pages:
<script async src="https://your-updog-instance.com/static/script/ua.js"></script>
<script>
window._uaq = window._uaq || [];
function ua(){_uaq.push(arguments);}
ua('pageview', {domain: location.hostname, path: location.pathname, ref: document.referrer});
// Replace with your hosted Updog endpoint
ua('config', {endpoint: 'https://your-updog-instance.com'});
</script>Replace https://your-updog-instance.com with the URL of your Updog installation.
To run the test suite:
make testTo build the Docker image locally:
make docker-localTo build multi-architecture images (requires Docker Buildx):
make docker-multiarch