📈 Setup Swetrix — Privacy-Focused, Cookie-Free Web Analytics
Deploy Swetrix on Ubuntu with Docker — an open-source, privacy-first web analytics platform with a polished dashboard, powered by ClickHouse for fast queries, with the frontend on port 8234.
📦 Resources & Setup Scripts
Grab the automated bash script from GitHub to follow along with the video.
Quick Install:
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/analytics/swetrix/swetrix-ubuntu.sh
chmod +x swetrix-ubuntu.sh
sudo bash swetrix-ubuntu.sh
Tutorial Steps
1 Download the Script
wget https://raw.githubusercontent.com/mhmdali94/Docker/main/analytics/swetrix/swetrix-ubuntu.sh
2 Make it Executable
chmod +x swetrix-ubuntu.sh
3 Run the Installer
The script installs Docker if needed and starts the full Swetrix stack — the frontend on port 8234, the API on 8235, plus ClickHouse for analytics data and Redis. It generates JWT secrets and an admin account (admin@example.com) with a random password.
sudo bash swetrix-ubuntu.sh
4 Open the Dashboard and Log In
Open the Swetrix frontend, log in with the generated admin@example.com account, then add your website and copy the tracking snippet:
http://<your-server-ip>:8234
Ports Used
| Port | Purpose |
|---|---|
| 8234 | Frontend / dashboard (host → container 3000) |
| 8235 | API (host → container 5005) — where tracking events are sent |
| admin@example.com | Generated password, printed after install — change it |
| ClickHouse + Redis | Internal — ClickHouse stores your analytics data |