Special Offers: Up to 75% OFF on Hostinger & High-RAM Contabo Cloud VPS available this month.Compare Plans

How to Deploy Umami Analytics on Ubuntu 24.04 VPS with PostgreSQL & PM2

Viktor Chen
Viktor ChenSystems Performance Engineer
November 13, 2026
•
15 min read
•
4.9 / 5.0
Transparency Notice: This article contains affiliate links to hosting providers like Hostinger and Contabo. If you purchase through our links, we may earn a commission at zero extra cost to you. We only recommend products we personally benchmark and test. Read full disclosure.
How to Deploy Umami Analytics on Ubuntu 24.04 VPS with PostgreSQL & PM2

Hostinger vs. Contabo: Full Specifications Breakdown

Data verified from our lab benchmarks • Updated for 2026

Feature / Metric
HostingerEditor's Choice UI
ContaboMax RAM Value
Starting Price$2.99 / month (Web) | $4.99 / mo (VPS)$5.50 / month (Cloud VPS S)
vCPU Cores1 to 8 vCPU (Dedicated resources)4 to 12 vCPU (High Core Count)
RAM Memory4 GB to 32 GB6 GB to 64 GB (Gigantic RAM)
Storage Technology50 GB – 400 GB NVMe SSD50 GB NVMe or 300 GB SSD
Traffic / Bandwidth4 TB to 32 TB32 TB Outgoing + Unlimited In
Control Panel & UIhPanel (Ultra Modern & Easy)cPanel, Plesk, Webmin, or CLI
Customer Support24/7 Live Chat & AI Support (Multi-lingual)Email Ticket Support (German Business Hours)
Best ForBloggers, WordPress Sites & Devs wanting easy UIHeavy Database, Docker, Game Servers & SysAdmins
Money-Back Guarantee30-Day Money-Back Guarantee14-Day EU Statutory Cancellation
Official LinksVisit HostingerVisit Contabo

Why Google Analytics 4 is Hurting Your Website

Google Analytics 4 (GA4) has become a frustrating burden for webmasters and privacy-conscious businesses. Between confusing interface redesigns, data sampling thresholds, and complex regulatory crackdowns in the European Union (where Austrian, French, and Danish data protection authorities have ruled GA non-compliant with GDPR), running GA requires annoying cookie consent banners that degrade conversion rates.

Furthermore, because Google's tracking domains are globally flagged, over 30% to 45% of your tech-savvy visitors block GA completely via uBlock Origin, Brave Browser, or Pi-hole. You are flying blind.

Umami is an open-source, privacy-focused alternative written in Next.js and Prisma. It collects no personally identifiable information (PII), uses no cookies, complies fully with GDPR without annoying consent banners, and ships a tracking script weighing less than 2 KB.

Server Requirements on Hostinger or Contabo VPS

Umami is exceptionally resource-efficient. An entry-level Hostinger KVM 1 or Contabo Cloud VPS 1 running Ubuntu 24.04 LTS can effortlessly track over 5 million monthly pageviews while consuming under 500MB of RAM.

Step 1: Install Node.js 20 LTS and PostgreSQL 16

SSH into your VPS and install Node.js, Git, and PostgreSQL:

ssh root@YOUR_SERVER_IP
apt update && apt upgrade -y
apt install -y curl git build-essential ufw postgresql postgresql-contrib

# Install Node.js 20 LTS via NodeSource
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt install -y nodejs
npm install -g pm2

Step 2: Configure PostgreSQL Database

Switch to the PostgreSQL user and create a dedicated database and user for Umami:

sudo -u postgres psql

CREATE DATABASE umami;
CREATE USER umamiuser WITH ENCRYPTED PASSWORD 'StrongSecurePassword_7731!';
GRANT ALL PRIVILEGES ON DATABASE umami TO umamiuser;
ALTER DATABASE umami OWNER TO umamiuser;
\q

Step 3: Clone Umami and Build the Application

Clone the latest stable release of Umami from GitHub:

cd /var/www
git clone https://github.com/umami-software/umami.git
cd umami
npm install

Create the .env environment file:

nano .env

Add the database connection string and a random hash salt:

DATABASE_URL=postgresql://umamiuser:StrongSecurePassword_7731!@localhost:5432/umami
APP_SECRET=GenerateRandomString32CharactersLong!

Build the Next.js production bundle:

npm run build

Step 4: Manage the Process with PM2

Launch Umami with the PM2 process manager to ensure automatic restarts upon reboot:

pm2 start npm --name "umami" -- run start
pm2 save
pm2 startup

Run the output command provided by pm2 startup to register the systemd service.

Step 5: Nginx Reverse Proxy with SSL

Expose Umami securely over HTTPS via Nginx:

apt install -y nginx certbot python3-certbot-nginx

cat << 'EOF' > /etc/nginx/sites-available/umami.conf
server {
    server_name analytics.yourdomain.com;

    location / {
        proxy_pass http://127.0.0.1:3000;
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection 'upgrade';
        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;
    }
}
EOF

ln -s /etc/nginx/sites-available/umami.conf /etc/nginx/sites-enabled/
nginx -t && systemctl reload nginx
certbot --nginx -d analytics.yourdomain.com --non-interactive --agree-tos -m admin@yourdomain.com

Step 6: Adding the Tracking Tag to Your Website

Navigate to https://analytics.yourdomain.com. Log in with default credentials:

  • Username: admin
  • Password: umami

(Immediately change this default password under Settings > Profile!)

Click Add Website, input your site name and domain, and Umami generates your unique tracking snippet:

<script defer src="https://analytics.yourdomain.com/script.js" data-website-id="your-unique-uuid-here"></script>

Add this single script tag to your WordPress header, Next.js root layout, or HTML head. Because the script originates from your own first-party domain, browser ad-blockers will not block it, granting you 100% accurate traffic data with zero privacy liability.

Editorial Verdict: Pros & Cons

What We Love (Pros)

  • 100% GDPR, CCPA, and PECR compliant with zero invasive cookies or personal data tracking
  • Bypasses 95% of ad-blockers by hosting the tracking script on your own apex or subdomain
  • Featherlight tracking script: under 2KB compared to Google Analytics' heavy 45KB+ payload

Drawbacks (Cons)

  • Does not provide automated e-commerce user cohort lifetime value predictive modeling out-of-the-box
#Umami Analytics#Ubuntu 24.04#PostgreSQL#Self-Hosted#Privacy#Web Analytics
Viktor Chen

Written by Viktor Chen

Systems Performance Engineer

Alex and the ServerCraft engineering lab run routine benchmarks on over 25 web hosting providers, maintaining strict objectivity and reproducibility.

Recommended Next Reads