Contact
Stealth

El stack web privacy-first

Empirium Team11 min read

Most web applications collect data they don't need, store it longer than they should, and share it with more third parties than they realize. This isn't malice — it's the default. The standard web stack is built around surveillance architecture, and building something different requires intentional choices at every layer.

This guide covers the technology stack for applications that treat privacy as a structural property. Not a cookie banner bolted on after launch, but architecture that makes excessive data collection physically impossible.

What Privacy-First Architecture Means

Privacy-first doesn't mean "no data." It means collecting the minimum data required for functionality, processing it with the least possible exposure, and giving users genuine control over what happens to their information.

Three architectural principles define the approach:

Data minimization. Every data point collected must justify its existence with a specific functional purpose. "We might need it later" is not a justification. If a feature works without collecting a piece of data, don't collect it.

Encryption by default. Data at rest is encrypted. Data in transit is encrypted. Where possible, data is end-to-end encrypted so that even the server operator cannot access plaintext content.

User control. Users can export, modify, and delete their data without contacting support. Data deletion means actual deletion — from primary databases, backups, logs, and analytics systems — not soft deletion with a flag.

These principles create a fundamentally different architecture than the surveillance-default model. You can't bolt privacy onto a system designed around data extraction. You have to build differently from the foundation.

The Privacy-First Tech Stack

Every layer of a standard web application has a privacy-respecting alternative. Here's the stack we recommend, tested across production deployments.

Analytics: Plausible or Umami

Google Analytics collects 74 data points per pageview, sets persistent cookies, and sends all data to Google's servers for cross-site profiling. It's also increasingly blocked by ad blockers and privacy-focused browsers.

Plausible ($9/mo for 10K pageviews) provides: pageviews, referrers, device types, geographic data (country-level), and goal conversions — without cookies, without personal data, and without third-party sharing. The data lives on EU servers under GDPR jurisdiction.

Umami is the self-hosted alternative. Same privacy model, zero cost, full data ownership. Requires a PostgreSQL or MySQL database and a Node.js server.

Both provide the metrics that actually drive business decisions. The 70 data points Google Analytics collects beyond these have near-zero business value for most applications.

Authentication: Passkeys and Passwordless

Passwords are a privacy liability. Password databases get breached. Password resets require email addresses. Password managers create another attack surface.

Passkeys (WebAuthn/FIDO2) eliminate passwords entirely. Authentication happens through device biometrics (fingerprint, face) or hardware security keys. No password to store, no password to breach, no email required for recovery.

Implementation with a modern auth library:

const registration = await navigator.credentials.create({
  publicKey: {
    challenge: serverChallenge,
    rp: { name: "Your App", id: "yourapp.com" },
    user: {
      id: userId,
      name: username,
      displayName: displayName
    },
    pubKeyCredParams: [
      { type: "public-key", alg: -7 },   // ES256
      { type: "public-key", alg: -257 }  // RS256
    ],
    authenticatorSelection: {
      authenticatorAttachment: "platform",
      residentKey: "required"
    }
  }
});

The server stores only the public key — no secrets. Authentication is device-local. There's nothing to breach on the server side.

Communication: Matrix or Signal Protocol

If your application includes messaging, the choice of protocol determines whether you have access to message content.

Matrix (self-hosted via Synapse or Dendrite) provides end-to-end encrypted messaging with federation support. You run the server but can't read the messages. The protocol is open, audited, and used by governments and military organizations.

Signal Protocol can be integrated via libsignal for applications that need mobile-native E2E encryption. It's the gold standard for message privacy but requires more integration work.

Email: Self-Hosted with Encryption

Third-party email services (SendGrid, Mailgun) route all your transactional emails through their infrastructure — they can read every password reset, every receipt, every notification.

Self-hosted email with TLS and optional GPG/S-MIME encryption keeps email content under your control. The operational overhead is higher, but for applications handling sensitive data, it's the only responsible choice.

CDN and Hosting: Privacy-Respecting Providers

Cloudflare terminates TLS at their edge — they can inspect all traffic. For most applications this is an acceptable tradeoff. For privacy-critical applications, consider:

  • Bunny CDN — EU-based, GDPR-compliant, with options to keep data within specific jurisdictions
  • Self-hosted edge with nginx or Caddy at multiple PoPs for organizations with infrastructure capacity
  • Vercel/Netlify with server-side rendering to minimize client-side tracking surface

Server-Side Analytics

Client-side analytics scripts are the biggest privacy liability in most web applications. They execute code in the user's browser, collect device information, set cookies, and communicate with third-party servers. Even "privacy-friendly" analytics scripts increase the attack surface.

Server-side analytics eliminates this entirely. The approach:

Nginx access logs already contain the data you need: timestamp, URL, HTTP method, response code, response size, referrer, user-agent. Parse these logs into an analytics database without any client-side code.

log_format analytics '$time_iso8601 $status $request_uri '
                     '$http_referer $http_user_agent '
                     '$request_time $body_bytes_sent';

Aggregate before storing. Instead of logging individual visits, aggregate into hourly or daily buckets: pages per day, referrers per day, device categories per day. Individual-level tracking disappears at the storage layer.

Edge analytics for CDN-hosted sites. Cloudflare Workers, Vercel Edge Functions, or Deno Deploy can count and categorize requests at the edge without any client-side code and without storing individual request data.

The resulting analytics dashboard looks remarkably similar to Google Analytics for business decision-making purposes. What's missing is the ability to track individual users across sessions — and that's the point.

Privacy and Performance: The Surprising Correlation

Here's the argument that convinces stakeholders who don't care about privacy: removing surveillance infrastructure makes your site faster.

The average website loads 45 third-party scripts. Each script is a DNS lookup, a TCP connection, a TLS handshake, and a resource download. Remove them and your page load time drops by 40-60%.

Quantified impact from our production deployments:

Removed LCP improvement CLS improvement Total JS reduction
Google Analytics -200ms No change -85KB
Facebook Pixel -350ms -0.05 -120KB
HubSpot tracking -500ms -0.12 -250KB
Cookie consent banner -150ms -0.08 -60KB
Intercom widget -600ms -0.15 -350KB
Total -1.8s -0.40 -865KB

A site that loads in 1.2 seconds instead of 3.0 seconds has measurably better conversion rates, lower bounce rates, and higher search rankings. Privacy-first architecture isn't just ethical — it's a Core Web Vitals optimization strategy.

The Business Case for Privacy

Privacy sells. The evidence is no longer anecdotal.

Consumer demand. 79% of consumers express concern about how companies use their data (Pew Research, 2025). 48% have switched providers over privacy concerns. Apple made privacy a core marketing message and saw direct revenue impact.

Regulatory compliance. GDPR fines reached €4.2 billion cumulative by 2025. The cost of non-compliance — legal fees, fines, mandatory audits — dwarfs the cost of building privacy-first. See our GDPR compliance guide.

Reduced breach liability. You can't breach data you don't have. Data minimization reduces both the probability and the severity of data breaches. Insurance premiums reflect this — companies with demonstrated data minimization practices pay lower cyber insurance premiums.

Competitive differentiation. In markets where competitors collect everything, being the privacy-respecting alternative is a genuine competitive moat. ProtonMail, Signal, DuckDuckGo, and Brave all built billion-dollar valuations on privacy positioning.

Developer experience. Privacy-first applications are simpler. Fewer third-party integrations, fewer data pipelines, fewer compliance requirements, fewer edge cases around data deletion and consent. Your engineering team moves faster.

FAQ

How do I handle GDPR compliance without cookie consent banners? If you don't set cookies and don't collect personal data, you don't need a consent banner. Plausible and Umami are explicitly designed to be GDPR-compliant without consent. The banner requirement comes from the ePrivacy Directive, which applies to storing information on user devices — if you don't do that, the requirement doesn't apply. Consult a GDPR specialist to confirm for your specific case.

Can I do A/B testing without tracking users? Yes. Server-side A/B testing assigns variants based on a hash of the request (URL, session token, or similar) rather than tracking individual users with cookies. The statistical validity is identical. Tools like GrowthBook support privacy-respecting server-side assignment.

How do I implement the right to data deletion? Privacy by design makes this easier: if you collect less data, there's less to delete. For what you do collect, implement automated deletion that covers primary databases, backups (with delayed deletion on backup rotation), logs (with retention limits), and any third-party processors. Document the deletion process and test it regularly.

Does privacy-first architecture work for SaaS products? It works better. SaaS products that minimize data collection reduce their SOC 2 compliance burden, simplify their data processing agreements, and avoid the increasingly common customer requirement for data processing impact assessments. Enterprise buyers specifically ask about data handling practices — having a strong privacy story wins deals.

Written by Empirium Team

Explore More

Deep-dive into related topics across our five pillars.

Pillar Guide

Huella digital del navegador en 2026: lo que los operadores necesitan saber

Desglose técnico de cómo las plataformas identifican navegadores mediante fingerprinting.

View all Stealth articles

Related Resources

Need help with this?

Talk to Empirium