Quick Start
The fastest way to get Sparklytics running:Docker Compose Configuration
Here’s the completedocker-compose.yml file:
Key Configuration Points
Persistent Data Volume
Persistent Data Volume
The
sparklytics-data named volume stores your DuckDB database file. This ensures data persists across container restarts.To use a host directory instead:Auth Modes
Auth Modes
SPARKLYTICS_AUTH controls the authentication behavior:| Mode | Value | First-run UX | Best for |
|---|---|---|---|
| Local auth (recommended) | local | Redirects to /setup once, then /login | Most self-hosted production installs |
| Env password | password | Redirects directly to /login | Simple single-password deployments |
| Open mode | none | No login/setup; dashboard opens directly | Local development only |
password mode, add:HTTPS Cookie Setting
HTTPS Cookie Setting
DuckDB Memory Limit
DuckDB Memory Limit
SPARKLYTICS_DUCKDB_MEMORY sets the query memory limit. Default is 1GB.For better performance on larger VPS instances (16–32 GB RAM):512MB, 1GB, 2GB, 8GB, etc.Running Without docker-compose
If you preferdocker run directly:
Environment Variables Reference
| Variable | Default | Description |
|---|---|---|
SPARKLYTICS_AUTH | local | Auth mode: none, password, or local |
SPARKLYTICS_PASSWORD | — | Required when SPARKLYTICS_AUTH=password |
SPARKLYTICS_HTTPS | true | Set false only for plain-HTTP local dev |
SPARKLYTICS_PORT | 3000 | Listen port |
SPARKLYTICS_DATA_DIR | /data | DuckDB data directory (inside container) |
SPARKLYTICS_DUCKDB_MEMORY | 1GB | Query memory limit |
SPARKLYTICS_CORS_ORIGINS | — | Comma-separated allowed origins for analytics API |
SPARKLYTICS_RETENTION_DAYS | 365 | How long to keep raw events |
SPARKLYTICS_GEOIP_PATH | /geoip/dbip-city-lite.mmdb | Path to city MMDB (bundled in Docker image) |
First Launch Verification
After starting the container, verify everything works:Complete setup (local mode only)
Visit
http://localhost:3000/dashboard — you’ll be redirected to /setup.Set your admin password (minimum 12 characters), then log in.Common Issues
Login succeeds but redirects back to login page
Login succeeds but redirects back to login page
Cause: Running over plain HTTP with
SPARKLYTICS_HTTPS=true, so browser drops the Secure cookie.Fix: Set SPARKLYTICS_HTTPS=false for localhost/non-TLS environments and restart:Data disappears after container restart
Data disappears after container restart
Cause: No persistent volume mounted.Fix: Ensure your
docker-compose.yml has the volumes section:Container fails to start with SPARKLYTICS_AUTH=password
Container fails to start with SPARKLYTICS_AUTH=password
Cause: Missing
SPARKLYTICS_PASSWORD environment variable.Fix: Add the password to your compose file:Docker with Caddy (HTTPS)
For production deployments with automatic HTTPS, see the Reverse Proxy Setup guide. Quick preview:Pre-built Images
Sparklytics provides multi-arch Docker images:sparklytics/sparklytics:latest— latest stable releasesparklytics/sparklytics:v1.0.0— specific version tag
linux/amd64linux/arm64
Updating
To update to the latest version:sparklytics-data volume.
Next Steps
Reverse Proxy Setup
Configure Caddy, Nginx, or Traefik for HTTPS
HTTPS Setup
SSL/TLS configuration and certificate management
Performance Tuning
Optimize for high-traffic deployments
HTML Snippet
Add tracking to your website