Ditch GA4: How to Self-Host Umami Analytics on Vultr for GDPR-Compliant, Ultra-Fast Tracking
Google Analytics 4 (GA4) has become a major headache for developers, indie hackers, and privacy-conscious businesses. It is complex to configure, comes with a bloated JavaScript payload (~50KB+) that hurts your Lighthouse performance scores, and forces you to implement annoying cookie banners to stay compliant with GDPR and CCPA.
If you are looking for a lightweight, privacy-first, beautiful, and completely self-hosted alternative, look no further than Umami Analytics.
In this guide, we will walk you through how to deploy your own self-hosted Umami instance in under 10 minutes using Docker Compose on Vultr Cloud Compute, giving you total ownership of your data with virtually zero ongoing costs.
Why Self-Host Umami Analytics?
Before diving into the code, let's look at why Umami is a superior choice for modern web applications:
- Performance: The Umami tracking script is under 2KB. GA4 is over 50KB. Removing GA4 instantly improves your page load speed and Core Web Vitals.
- Privacy & Compliance: Umami does not collect any personally identifiable information (PII), does not track users across websites, and does not use cookies. This means you do not need a cookie consent banner for analytics!
- Modern UI: No deep nested menus. You get a clean, real-time dashboard displaying visitors, page views, bounce rates, referrers, browsers, and countries on a single screen.
- Multi-Tenant & Multi-Site: You can track hundreds of websites and share access dashboards with clients or team members from a single installation.
Prerequisites
To follow this guide, you will need:
- A cloud server. We highly recommend using Vultr for this. Since Umami is highly optimized, you can run it perfectly on Vultr's entry-tier High Performance instances ($2.50 to $5/month).
- Docker and Docker Compose installed on your server.
- A domain name (e.g.,
analytics.yourdomain.com) pointed to your server's IP address.
Step 1: Launch Your Server on Vultr
- Sign up or log into your Vultr Account.
- Click Deploy Server.
- Select Cloud Compute and choose a location closest to your target audience.
- Choose Ubuntu 24.04 LTS as your operating system.
- Select the Regular Cloud Compute plan (the $5/month plan is more than enough to handle millions of monthly pageviews on Umami).
- Add your SSH keys, click Deploy Now, and wait for your instance to spin up.
Step 2: Connect and Install Docker
Once your server is ready, connect to it via SSH:
ssh root@your_vultr_server_ip
Update your packages and install Docker and Docker Compose:
# Update package lists
sudo apt update && sudo apt upgrade -y
# Install Docker
sudo apt install docker.io -y
# Install Docker Compose
sudo apt install docker-compose-plugin -y
# Verify installations
docker --version
docker compose version
Step 3: Configure Umami with Docker Compose
We will deploy Umami alongside a lightweight PostgreSQL database container to store your tracking data securely.
Create a new directory for your Umami installation:
mkdir ~/umami && cd ~/umami
Create a docker-compose.yml file:
nano docker-compose.yml
Paste the following production-ready configuration into the file:
version: '3.8'
services:
umami-db:
image: postgres:15-alpine
container_name: umami-db
environment:
POSTGRES_DB: umami
POSTGRES_USER: umami_admin
POSTGRES_PASSWORD: super_secure_db_password_here # Change this!
volumes:
- pgdata:/var/lib/postgresql/data
restart: always
healthcheck:
test: ["CMD-SHELL", "pg_isready -U umami_admin -d umami"]
interval: 5s
timeout: 5s
retries: 5
umami:
image: ghcr.io/umami-software/umami:postgresql-latest
container_name: umami
ports:
- "3000:3000"
environment:
DATABASE_URL: postgresql://umami_admin:super_secure_db_password_here@umami-db:5432/umami # Match your DB password!
APP_SECRET: generate_a_random_long_string_here # Change this!
TRACKER_SCRIPT_NAME: custom_tracker_name # Optional: custom script name to bypass adblockers (e.g. "metrics")
depends_on:
umami-db:
condition: service_healthy
restart: always
⚠️ Security Tip: Make sure to replace
super_secure_db_password_hereandgenerate_a_random_long_string_herewith your own unique credentials before saving.
Save and close the file (Ctrl+O, Enter, Ctrl+X).
Step 4: Run the Deployment
With your configuration in place, spin up the database and Umami containers in detached mode:
docker compose up -d
Umami will automatically handle the database migrations and table creation on the first startup. You can monitor the progress with:
docker compose logs -f umami
Once you see Ready on http://localhost:3000, your self-hosted analytics suite is running!
Step 5: Reverse Proxy (Nginx) & SSL Setup (Optional but Recommended)
To access Umami securely over HTTPS (port 443) using your custom domain, install Nginx and Certbot:
sudo apt install nginx certbot python3-certbot-nginx -y
Create a new Nginx block for your Umami server:
sudo nano /etc/nginx/sites-available/umami
Paste the following configuration (replace analytics.yourdomain.com with your real subdomain):
server {
listen 80;
server_name analytics.yourdomain.com;
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Enable the configuration and reload Nginx:
sudo ln -s /etc/nginx/sites-available/umami /etc/nginx/sites-enabled/
sudo systemctl reload nginx
Run Certbot to obtain a free SSL certificate from Let's Encrypt:
sudo certbot --nginx -d analytics.yourdomain.com
Follow the on-screen prompts to configure HTTPS redirection. Your analytics dashboard is now secure!
Step 6: Log In and Set Up Your First Website
- Open your browser and navigate to
https://analytics.yourdomain.com. - Log in using the default credentials:
-
Username:
admin -
Password:
umami
-
Username:
- IMPORTANT: Go straight to Settings -> Profile and change your admin password to protect your data!
- Navigate to Websites, click Add Website, and enter your domain name.
- Click Get Tracking Code, copy the lightweight script tag, and paste it into the
<head>section of your website.
<!-- Example Umami Tracking Script -->
<script async defer src="https://analytics.yourdomain.com/script.js" data-website-id="your-unique-website-id"></script>
Conclusion & Next Steps
You've successfully escaped the clutches of heavy GA4 scripts and complex compliance audits! Your self-hosted Umami dashboard is fully operational, fast, and entirely under your control.
By running this on Vultr High-Performance Cloud Compute, you guarantee maximum uptime and lightning-fast script delivery for your visitors for a fraction of the cost of commercial analytics plans.
Have questions or run into issues setting up Docker? Let us know in the comments below!
💬 Join Our Community
Want more self-hosting guides, cost-saving DevOps architectures, and open-source tutorials? Join our active developer group on Telegram: Join our channel here (Updates daily! 🚀)
Liked this resource? Join our daily Telegram channel for more developer tools and cloud insights: @Libretech2026
Top comments (0)