• Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
logo logo
  • Home
  • Cloud VPS
    • Hong Kong VPS
    • US VPS
  • Dedicated Servers
    • Hong Kong Servers
    • US Servers
    • Singapore Servers
    • Japan Servers
  • Company
    • Contact Us
    • Blog
ENEN
  • 简体简体
  • 繁體繁體
Client Area

How to Deploy Umami Web Analytics on Hong Kong VPS: Open-Source Google Analytics Alternative (2026)

May 18, 2026

Umami is an increasingly popular open-source web analytics platform — simpler than Plausible, with a beautiful real-time dashboard and excellent performance characteristics. Like Plausible, it is privacy-focused, cookie-free, and critically: not blocked in mainland China when self-hosted on your own domain.

Compared to Plausible, Umami is lighter (no ClickHouse dependency), easier to set up, and provides real-time data in its dashboard. For teams that want simple self-hosted analytics without the operational complexity of ClickHouse, Umami on a Hong Kong VPS is an excellent choice.


Umami vs Plausible: Quick Comparison

FeatureUmamiPlausible
DatabasePostgreSQL or MySQLPostgreSQL + ClickHouse
Setup complexitySimpleModerate (two databases)
Real-time dashboard✅ Yes✅ Yes
Custom events✅ Yes✅ Yes
Multiple websites✅ Unlimited✅ Unlimited
RAM requirement~256 MB~512 MB+
Script size~2 KB~1 KB

Step 1: Deploy Umami with Docker Compose

mkdir -p /home/deploy/umami
cd /home/deploy/umami
nano docker-compose.yml
version: '3.8'
services:
  umami:
    image: ghcr.io/umami-software/umami:postgresql-latest
    container_name: umami
    restart: unless-stopped
    ports:
      - "127.0.0.1:3333:3000"
    environment:
      DATABASE_URL: postgresql://umami:${POSTGRES_PASSWORD}@db:5432/umami
      DATABASE_TYPE: postgresql
      APP_SECRET: ${APP_SECRET}
    depends_on:
      db:
        condition: service_healthy

  db:
    image: postgres:15-alpine
    container_name: umami_db
    restart: unless-stopped
    environment:
      POSTGRES_DB: umami
      POSTGRES_USER: umami
      POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
    volumes:
      - umami_db_data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U umami"]
      interval: 5s
      timeout: 5s
      retries: 5

volumes:
  umami_db_data:
nano .env
POSTGRES_PASSWORD=strong_postgres_password
APP_SECRET=$(openssl rand -hex 32)
chmod 600 .env
docker compose up -d
docker compose logs -f umami

Step 2: Configure Nginx

nano /etc/nginx/sites-available/umami
server {
    listen 443 ssl http2;
    server_name stats.yourdomain.com;

    ssl_certificate /etc/letsencrypt/live/stats.yourdomain.com/fullchain.pem;
    ssl_certificate_key /etc/letsencrypt/live/stats.yourdomain.com/privkey.pem;

    location / {
        proxy_pass http://127.0.0.1:3333;
        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;
    }
}
ln -s /etc/nginx/sites-available/umami /etc/nginx/sites-enabled/
certbot --nginx -d stats.yourdomain.com --email your@email.com --agree-tos --no-eff-email
nginx -t && systemctl reload nginx

Step 3: Initial Setup and Tracking

  1. Navigate to https://stats.yourdomain.com
  2. Default credentials: username admin, password umami — change immediately
  3. Add website → enter domain name → get tracking code
<!-- Add to your website's <head> section -->
<script async defer
  src="https://stats.yourdomain.com/script.js"
  data-website-id="YOUR_WEBSITE_ID">
</script>

Step 4: Track Custom Events

// Track button clicks
document.getElementById('buy-now').addEventListener('click', () => {
  umami.track('purchase-intent', { product: 'Hong Kong VPS', plan: 'basic' });
});

// Track form submissions
document.getElementById('contact-form').addEventListener('submit', () => {
  umami.track('form-submit', { form: 'contact' });
});

// Track page sections viewed
const observer = new IntersectionObserver((entries) => {
  entries.forEach(entry => {
    if (entry.isIntersecting) {
      umami.track('section-view', { section: entry.target.id });
    }
  });
});
document.querySelectorAll('[data-track-section]').forEach(el => observer.observe(el));

Conclusion

Self-hosted Umami on a Hong Kong VPS provides beautiful, real-time web analytics that works for Chinese visitors — solving the Google Analytics China blind spot with minimal server resources and simple setup. The PostgreSQL-only backend means you can deploy Umami on the same VPS as your main application without additional database complexity.

Add analytics to your Asia-Pacific stack on Server.HK’s Hong Kong VPS plans — Umami runs comfortably alongside your main application on a 2 GB RAM plan.


Frequently Asked Questions

Can I run Umami and Plausible on the same Hong Kong VPS?

Yes, but it is unnecessary — choose one analytics platform. If you are deciding between the two, Umami is simpler to set up and lighter on resources; Plausible has more advanced filtering capabilities and has been in production longer. Both serve the same core purpose of China-accessible self-hosted analytics.

Does Umami handle high traffic spikes?

Umami with PostgreSQL handles millions of monthly pageviews on modest hardware. The bottleneck is typically PostgreSQL write throughput for recording pageviews. For very high traffic (10+ million pageviews/month), consider tuning PostgreSQL or migrating the analytics database to a dedicated VPS while keeping Umami’s application on your main server.

Can I import historical Google Analytics data into Umami?

Umami does not support importing historical data from Google Analytics — it starts tracking from the day you install the script. For historical data, export from Google Analytics (available until its shutdown) and maintain the export separately for reference while Umami accumulates fresh data going forward.

Leave a Reply

You must be logged in to post a comment.

Recent Posts

  • How to Deploy Umami Web Analytics on Hong Kong VPS: Open-Source Google Analytics Alternative (2026)
  • Hong Kong VPS vs OVH: Which Is Better for Asia-Pacific Hosting in 2026?
  • How to Set Up MinIO Object Storage on Hong Kong VPS: Self-Hosted S3-Compatible Storage (2026)
  • How to Set Up OpenVPN on Hong Kong VPS: Business VPN Server for Remote Teams (2026)
  • How to Deploy Grafana and Prometheus Monitoring Stack on Hong Kong VPS (2026)

Recent Comments

  1. Hong Kong VPS Uptime and SLA: What 99.9% Uptime Really Means for Your Business (2026) - Server.HK on How to Monitor Your Hong Kong VPS: Uptime, Performance, and Alert Setup Guide (2026)
  2. Best Hong Kong VPS Providers in 2026: Compared by Speed, Routing, and Value - Server.HK on How to Migrate Your Website to a Hong Kong VPS: Zero-Downtime Transfer Guide (2026)
  3. vibramycin injection on How to Choose the Right Hong Kong VPS Plan: A Buyer’s Guide for 2026
  4. allopurinol for gout on CN2 GIA vs BGP vs CN2 GT: What’s the Real Difference for China Connectivity?
  5. antibiotics online purchase on How to Set Up a WordPress Site on a Hong Kong VPS with aaPanel (Step-by-Step 2026)

Knowledge Base

Access detailed guides, tutorials, and resources.

Live Chat

Get instant help 24/7 from our support team.

Send Ticket

Our team typically responds within 10 minutes.

logo
Alipay Cc-paypal Cc-stripe Cc-visa Cc-mastercard Bitcoin
Cloud VPS
  • Hong Kong VPS
  • US VPS
Dedicated Servers
  • Hong Kong Servers
  • US Servers
  • Singapore Servers
  • Japan Servers
More
  • Contact Us
  • Blog
  • Legal
© 2026 Server.HK | Hosting Limited, Hong Kong | Company Registration No. 77008912
Telegram
Telegram @ServerHKBot