Back to articles
Technology Insight

Scaling Privacy: Building a Self-Hosted Static Site Analytics Platform with Umami and ClickHouse on VPS

May 26, 2026

The Shift Toward Privacy-First Web Analytics

In the contemporary digital landscape, the relationship between data collection and user privacy has reached a critical inflection point. For years, Google Analytics has been the industry standard, providing robust insights at the cost of centralized data control and complex privacy implications. However, with the rise of strict regulations like GDPR, CCPA, and PECR, businesses are increasingly seeking alternatives that prioritize data sovereignty without sacrificing performance.

For static site owners—ranging from documentation portals to high-traffic corporate blogs—the requirement is clear: a lightweight, transparent, and high-performance tracking solution. This is where the combination of Umami and ClickHouse, hosted on a Virtual Private Server (VPS), emerges as a premier architectural choice.

Why Self-Hosting Umami with ClickHouse?

Umami is an open-source, privacy-focused web analytics alternative that is simple to use and easy to deploy. While it traditionally supports PostgreSQL or MySQL, the integration with ClickHouse elevates it to an enterprise-grade solution. ClickHouse is a column-oriented database management system (DBMS) that allows for generating analytical reports in real-time using SQL queries.

  • Data Sovereignty: You own the hardware, the database, and the data. No third-party access means simplified compliance.
  • Performance at Scale: ClickHouse is optimized for high-volume data ingestion and complex aggregations, making it perfect for sites with millions of monthly visitors.
  • Cookie-less Tracking: Umami does not use cookies or collect personally identifiable information (PII), ensuring your site remains user-friendly and legally compliant by default.
  • Minimal Overhead: The tracking script is incredibly lightweight, ensuring that your Largest Contentful Paint (LCP) and overall PageSpeed scores remain unaffected.

Architecting the Infrastructure on a VPS

Building this stack requires a strategic approach to infrastructure. Unlike shared hosting, a VPS provides the dedicated resources necessary to run a real-time OLAP (Online Analytical Processing) database like ClickHouse alongside the Umami application layer.

Minimum System Requirements

To ensure a smooth experience, especially when dealing with the memory-intensive nature of ClickHouse, we recommend the following minimum specifications:

  • CPU: 2 Cores (Intel Xeon or AMD EPYC preferred)
  • RAM: 4GB (8GB recommended for larger datasets)
  • Storage: 40GB+ NVMe SSD for fast I/O operations
  • Network: 1Gbps uplink for low-latency data ingestion

The Software Stack

Our deployment strategy utilizes Docker and Docker Compose for containerization. This approach ensures environment parity and simplifies the update lifecycle for both the application and the database.

Pro Tip: Always use a Reverse Proxy like Nginx or Traefik with SSL termination via Let's Encrypt to ensure that your analytics dashboard and tracking endpoint are served over a secure HTTPS connection.

Step-by-Step Deployment Strategy

1. Preparing the Environment

First, update your VPS and install the necessary dependencies. This involves setting up the Docker engine and the Compose plugin. Security is paramount; ensure that your firewall (UFW or firewalld) only permits traffic on ports 80, 443, and your specific SSH port.

2. Configuring ClickHouse for Analytics

ClickHouse requires specific configuration to handle Umami's data schema effectively. Unlike traditional relational databases, ClickHouse stores data in columns, which allows it to read only the necessary columns for a query. This results in near-instantaneous report generation even as your data grows into the millions of rows.

3. Deploying Umami

The Umami container connects to the ClickHouse instance via a secure internal network. You will need to define environment variables such as DATABASE_URL and HASH_SALT to secure your installation. By using the official Umami Docker image, you benefit from pre-compiled assets and an optimized Node.js environment.

Optimizing for Static Site Integration

Static sites, built with frameworks like Next.js, Hugo, or Gatsby, are designed for speed. Integrating a tracking script must be handled with care. Umami provides a single-line script tag that can be injected into the of your HTML.

Enhancing Accuracy with Proxying

One common challenge with client-side tracking is the prevalence of ad-blockers. To mitigate this, many advanced users choose to proxy the tracking script through their own domain. Instead of loading from [analytics.yourdomain.com/script.js](https://analytics.yourdomain.com/script.js), you can route the request through your main site's subpath (e.g., [yourmainstore.com/lib/telemetry.js](https://yourmainstore.com/lib/telemetry.js)). This makes the tracking less likely to be flagged by aggressive filters while maintaining privacy standards.

Analyzing the Data: Beyond Basic Pageviews

Once your self-hosted platform is live, Umami offers a clean, intuitive interface to monitor your traffic. However, the true power of this setup lies in Event Tracking. You can programmatically trigger events for specific user actions, such as:

  1. Newsletter Signups: Track conversion rates without identifying individual users.
  2. Outbound Link Clicks: Understand which external resources your audience finds most valuable.
  3. File Downloads: Monitor engagement with whitepapers or software assets.

Because you are using ClickHouse, you can even connect external BI (Business Intelligence) tools like Grafana or Apache Superset directly to your database for more advanced data visualization and cross-platform reporting.

Maintenance and Security Best Practices

Owning your infrastructure comes with the responsibility of maintenance. To keep your analytics platform running optimally:

  • Regular Backups: Use ClickHouse backup tools to snapshot your data frequently and store it in a remote S3-compatible bucket.
  • Log Rotation: Ensure Docker logs are capped to prevent disk space exhaustion.
  • Updates: Stay updated with the latest Umami releases to benefit from security patches and new features.

Security Note: Never expose your ClickHouse port (typically 8123 or 9000) to the public internet. Use internal Docker networks or VPN tunnels for administrative access.

Conclusion

Transitioning to a self-hosted, privacy-first analytics platform is a significant step toward digital independence. By leveraging the speed of ClickHouse and the simplicity of Umami, businesses can gain deep insights into their audience while respecting the fundamental right to privacy. This stack not only provides a competitive advantage in terms of performance and SEO but also builds long-term trust with your users.

As the web continues to evolve, the tools we use to understand it must evolve as well. Investing in a robust, VPS-hosted analytics solution today ensures that your data remains your most valuable asset—and yours alone.

Scaling Privacy: Building a Self-Hosted Static Site Analytics Platform with Umami and ClickHouse on VPS | DPTCloud