Self-Host Umami: Simple & Fast Privacy-Focused Web Analytics
What is Umami Analytics?
Umami is a simple, fast, and privacy-focused web analytics solution that makes it easy to collect, analyze, and understand your website data while maintaining complete visitor privacy and data ownership. This lightweight alternative to Google Analytics provides essential insights without cookies, personal data collection, or complex setup requirements. Perfect for developers and businesses who want straightforward analytics with full GDPR compliance.
Key Features of Umami Analytics
🚀 Simple & Fast Performance
- Easy Setup: Get up and running in minutes with minimal configuration
- Lightweight Script: Fast-loading tracking code that doesn't impact website performance
- Real-Time Data: Live visitor tracking and instant metric updates
- Clean Interface: Intuitive dashboard focused on essential metrics
- Mobile Responsive: Full functionality on all devices and screen sizes
🔒 Privacy & Compliance
- No Cookies: Completely cookie-free tracking with no consent banners required
- Anonymous Data: All visitor data is anonymized with no personal information collected
- GDPR Compliant: Built-in compliance with global privacy regulations
- Data Ownership: Complete control over your analytics data with self-hosting
- No Third-Party: Zero data sharing with external services or advertising networks
📊 Essential Analytics Features
- Visitor Insights: Unique visitors, page views, bounce rate, and session duration
- Traffic Sources: Referral tracking and source attribution analysis
- Page Performance: Top pages, entry points, and content engagement metrics
- Geographic Data: Country-level visitor distribution without IP tracking
- Device Analytics: Browser, operating system, and device type insights
🔧 Developer-Friendly Features
- Multiple Databases: Support for PostgreSQL, MySQL, and other databases
- API Access: REST API for custom integrations and data export
- Event Tracking: Custom event tracking for user interactions and conversions
- Multi-Website: Manage analytics for multiple websites from single dashboard
- Team Access: User management with role-based permissions
Why Choose Umami Over Other Analytics?
Umami vs Google Analytics 4
Feature | Umami (Self-Hosted) | Google Analytics 4 |
---|---|---|
Privacy | ✅ No Personal Data | ❌ Extensive Tracking |
Cookies | ✅ Cookie-Free | ❌ Multiple Cookies |
Data Ownership | ✅ Complete Control | ❌ Google Servers |
Setup Complexity | ✅ Simple Setup | ❌ Complex Configuration |
GDPR Compliance | ✅ Built-In | ❌ Requires Configuration |
Performance | ✅ Lightweight | ❌ Heavy Script |
Umami vs Plausible
- Database Flexibility: Multiple database options vs PostgreSQL only
- Self-Hosting: Simpler setup and maintenance requirements
- Cost: Free forever vs paid hosted service
- Customization: Full control over features and appearance
Umami vs Matomo
- Resource Usage: Minimal server requirements vs heavy infrastructure needs
- Simplicity: Clean, focused interface vs feature-heavy dashboard
- Maintenance: Low maintenance overhead vs regular optimization required
- Privacy Default: Privacy-first design vs privacy as add-on feature
Quick Deployment Options
Option 1: One-Click Zeabur Deploy (Recommended)
Perfect for users wanting managed hosting with automatic scaling and maintenance.
Why Zeabur for Umami?:
- Managed Database: PostgreSQL setup with automatic backups and optimization
- Auto-Scaling: Handle traffic spikes without manual intervention
- SSL & CDN: Global content delivery with automatic HTTPS certificates
- Team Dashboard: Multi-user access with collaborative analytics management
Option 2: Docker Self-Hosting
Ideal for developers and organizations with existing infrastructure.
# Clone Umami repository
git clone https://github.com/umami-software/umami.git
cd umami
# Set up environment variables
cp .env.example .env
# Edit .env with your database and configuration
# Deploy with Docker Compose
docker-compose up -d
Production Docker Configuration:
version: '3.8'
services:
umami:
image: ghcr.io/umami-software/umami:postgresql-latest
ports:
- "3000:3000"
environment:
- DATABASE_URL=postgresql://umami:password@postgres:5432/umami
- DATABASE_TYPE=postgresql
- APP_SECRET=your_secret_key
- HOSTNAME=your-domain.com
depends_on:
- postgres
volumes:
- umami_data:/app/.next
postgres:
image: postgres:15
environment:
- POSTGRES_USER=umami
- POSTGRES_PASSWORD=secure_password
- POSTGRES_DB=umami
volumes:
- postgres_data:/var/lib/postgresql/data
volumes:
umami_data:
postgres_data:
Option 3: Railway Deployment
Best for teams needing managed infrastructure with automated deployments.
Enterprise Features:
- Managed PostgreSQL: Optimized database with automatic backups
- Git Integration: Automatic deployments from your repository
- Custom Domains: Free SSL certificates and domain management
- Team Collaboration: Multi-user access with permission controls
Getting Started with Umami
Initial Setup Process
- Deploy Instance: Choose your preferred deployment method above
- Database Setup: Configure PostgreSQL or MySQL database connection
- Create Admin Account: Set up administrator account with secure credentials
- Add Website: Configure your first website for analytics tracking
- Install Script: Add Umami tracking code to your website
Website Integration
<!-- Add to your website's <head> section -->
<script async src="https://your-umami.com/script.js" data-website-id="your-website-id"></script>
<!-- For custom event tracking -->
<script async src="https://your-umami.com/script.js" data-website-id="your-website-id" data-do-not-track="true"></script>
Custom Event Tracking
// Track custom events
umami.track('Button Click', {button: 'signup'});
umami.track('Download', {file: 'whitepaper.pdf'});
// Track page views (for SPAs)
umami.track(props => ({
url: props.url,
title: props.title
}));
// Track with custom properties
umami.track('Purchase', {
value: 99.99,
currency: 'USD',
plan: 'premium'
});
Essential Configuration
- Website Setup: Configure domains, tracking settings, and data retention policies
- Team Access: Add team members with appropriate permission levels
- Custom Events: Set up event tracking for conversions and user interactions
- Data Export: Configure regular data exports and backup procedures
- Performance Monitoring: Set up alerts for unusual traffic patterns or issues
Popular Use Cases
Small Business Analytics
- Website Performance: Monitor visitor trends and popular content
- Marketing ROI: Track campaign effectiveness across different channels
- Customer Behavior: Understand user paths and conversion funnels
- Local SEO: Analyze geographic traffic patterns and local search performance
Developer & Agency Projects
- Client Reporting: Provide clean, professional analytics for client websites
- Performance Monitoring: Track website performance across multiple projects
- A/B Testing: Monitor different versions and feature rollouts
- Portfolio Analytics: Understand visitor engagement across portfolio websites
Content Creator Analytics
- Content Performance: Track which articles and posts drive the most engagement
- Audience Growth: Monitor visitor trends and content discovery patterns
- Social Media Impact: Measure social media campaign effectiveness
- Monetization Tracking: Track affiliate links and sponsored content performance
E-commerce Insights
- Product Page Analytics: Track which products generate the most interest
- Conversion Tracking: Monitor checkout flow and purchase completion rates
- Traffic Sources: Identify the most valuable marketing channels
- Customer Journey: Understand visitor paths from discovery to purchase
Advanced Features & Integrations
API Integration
# Get website statistics
curl -X GET "https://your-umami.com/api/websites/your-website-id/stats" \
-H "Authorization: Bearer your-api-token" \
-H "Content-Type: application/json"
# Get page views
curl -X GET "https://your-umami.com/api/websites/your-website-id/pageviews" \
-H "Authorization: Bearer your-api-token"
# Track events via API
curl -X POST "https://your-umami.com/api/send" \
-H "Content-Type: application/json" \
-d '{
"website": "your-website-id",
"url": "/api/signup",
"event": "signup",
"data": {"plan": "premium"}
}'
React Integration
import { useEffect } from 'react';
// Custom hook for Umami tracking
function useUmami() {
useEffect(() => {
const script = document.createElement('script');
script.async = true;
script.src = 'https://your-umami.com/script.js';
script.setAttribute('data-website-id', 'your-website-id');
document.head.appendChild(script);
return () => {
document.head.removeChild(script);
};
}, []);
const track = (eventName, eventData) => {
if (window.umami) {
window.umami.track(eventName, eventData);
}
};
return { track };
}
// Usage in components
function SignupButton() {
const { track } = useUmami();
const handleSignup = () => {
track('Signup', { source: 'homepage' });
// Handle signup logic
};
return <button onClick={handleSignup}>Sign Up</button>;
}
WordPress Integration
// Add to WordPress theme functions.php
function add_umami_analytics() {
if (!is_admin()) {
wp_enqueue_script(
'umami-analytics',
'https://your-umami.com/script.js',
array(),
null,
false
);
wp_script_add_data('umami-analytics', 'async', true);
wp_script_add_data('umami-analytics', 'data-website-id', 'your-website-id');
}
}
add_action('wp_enqueue_scripts', 'add_umami_analytics');
// Track custom events
function track_umami_event($event_name, $event_data = array()) {
?>
<script>
if (typeof umami !== 'undefined') {
umami.track('<?php echo esc_js($event_name); ?>', <?php echo wp_json_encode($event_data); ?>);
}
</script>
<?php
}
Umami Community & Support
- GitHub Repository: 20,000+ stars with active open-source development
- Community Discord: Active community for support and feature discussions
- Documentation: Comprehensive guides for setup, API, and integrations
- Regular Updates: Monthly releases with new features and improvements
- Growing Ecosystem: Third-party integrations and community plugins
Migration Guide
From Google Analytics
- Historical Data: Export existing data for reference and comparison
- Parallel Tracking: Run Umami alongside Google Analytics initially
- Goal Recreation: Set up equivalent event tracking in Umami
- Team Training: Familiarize team with Umami's simplified interface
- Full Migration: Remove Google Analytics after confirming data accuracy
From Other Analytics Platforms
- Data Export: Extract historical data from current analytics platform
- Script Replacement: Replace existing tracking code with Umami script
- Event Mapping: Recreate custom events and conversion tracking
- Dashboard Setup: Configure Umami dashboards for reporting needs
- Performance Validation: Verify improved site performance with lightweight tracking
Experience simple, privacy-focused web analytics with Umami - the developer-friendly alternative that respects visitor privacy while providing the insights you need to understand your audience.