selfhost.directory

The index of self-hostable projects — ranked, categorized and served with live updates.
Own your data and stop giving it to big tech.

Liwan logo

Self-host Liwan

liwan-v1.8.1

Privacy-first web analytics you host yourself

ReleaseOpen SourceApache-2.0
Updated12 hours ago
LanguageRust
Setup difficultyEasy
ThemeDark mode
Stars
218
Port
9042 (HTTP server)
Docker
ghcr.io/explodingcamera/liwan
Install with Docker
Liwan dashboard in dark mode showing traffic overviewLiwan dashboard in light mode showing traffic overview

What is Liwan?

Liwan is a self-hosted web analytics application for site owners who value visitor privacy. It delivers a live dashboard showing popular pages, traffic origins, and trends while automatically filtering bots. You can run it as a standalone binary on Linux or macOS, or as a Docker container; both include the dashboard and an embedded DuckDB database so no extra services are needed. Collection settings are granular: choose a visitor-grouping strategy, decide whether to store city-level or country-level geography, toggle UTM campaign fields, enable or disable session measurements, and set how long raw events are kept. Tracking can be added with a one-line browser snippet or sent entirely from your backend, working with any framework. Teams can authenticate via major identity platforms or any OIDC provider such as Keycloak, while local password accounts always remain an option. The codebase is Apache-2.0 licensed and receives regular updates.

Should you self-host Liwan?

Liwan scores 49/100 on selfhost.directory (how scoring works) and ranks #12 of 27 in Analytics. It has 218 GitHub stars.

It shipped 5 stable releases in the past year. The latest, liwan-v1.8.1, came out on 23 October 2026. New versions land roughly every 5 weeks.

Setup is easy: most people get it running in one sitting. An official Docker image is available. It is Apache-2.0-licensed and written mostly in Rust.

Its closest alternative on selfhost.directory is PostHog (81/100, 40 492 stars). It scores higher overall, so compare the two before you pick. See Liwan vs PostHog side by side.

Features

  • Bot Filtering
  • Configurable data collection
  • Data retention and pruning
  • Docker Compose Deployment
  • Drop Rules
  • Lightweight browser tracker
  • Privacy-first tracking
  • Real-time dashboard
  • Server-side event tracking
  • Single Sign-On (OIDC)
  • Systemd/OpenRC service
  • Team Management

Liwan README

How to install Liwan

Install Liwan with Docker

Environment variables
LIWAN_BASE_URL, LIWAN_TRUSTED_PROXIES

docker run -d --name liwan
-p 127.0.0.1:9042:9042
-v liwan-data:/data
-e LIWAN_BASE_URL=https://a.example.com
-e LIWAN_TRUSTED_PROXIES='*'
ghcr.io/explodingcamera/liwan:1.8

Bind to localhost and use a reverse proxy for public HTTPS access

How to configure Liwan

  • LIWAN_BASE_URLhttp://localhost:9042Public URL where your liwan instance will be reachable

    Public URL where your liwan instance will be reachable

  • LIWAN_DATA_DIRPlatform data directoryDirectory for persistent data storage

    Directory for persistent data storage

  • LIWAN_DISABLE_FAVICONSfalseDisable favicon fetching

    Disable favicon fetching

  • LIWAN_DUCKDB_MEMORY_LIMITEmptyMemory limit for DuckDB

    Memory limit for DuckDB

  • LIWAN_DUCKDB_THREADSCPU core countNumber of threads for DuckDB

    Number of threads for DuckDB

  • LIWAN_GEOIP_HEADERSEmptyTrusted proxy location headers to try in order

    Trusted proxy location headers to try in order

  • LIWAN_LIMITS_REPORT_MAX_CONCURRENCY8Maximum concurrent report queries

    Maximum concurrent report queries

  • LIWAN_LIMITS_REPORT_MAX_DATAPOINTS2000Maximum datapoints per report

    Maximum datapoints per report

  • LIWAN_LIMITS_REPORT_MAX_DIMENSION_RESULTS1000Maximum dimension results per report

    Maximum dimension results per report

  • LIWAN_LIMITS_REPORT_MAX_FILTERS20Maximum filters per report

    Maximum filters per report

  • LIWAN_LIMITS_REPORT_MAX_FILTER_VALUE_BYTES2048Maximum filter value size in bytes

    Maximum filter value size in bytes

  • LIWAN_LIMITS_REPORT_MAX_RANGE_DAYS3660Maximum date range for reports in days

    Maximum date range for reports in days

  • LIWAN_LIMITS_REPORT_TIMEOUT_SECONDS30Report query timeout in seconds

    Report query timeout in seconds

  • LIWAN_LISTEN0.0.0.0:9042Address and port to listen on

    Address and port to listen on

  • LIWAN_MAXMIND_ACCOUNT_IDEmptyMaxMind account ID for GeoIP database

    MaxMind account ID for GeoIP database

  • LIWAN_MAXMIND_DB_PATHEmptyPath to MaxMind database file

    Path to MaxMind database file

  • LIWAN_MAXMIND_EDITIONGeoLite2-CityMaxMind database edition

    MaxMind database edition

  • LIWAN_MAXMIND_LICENSE_KEYEmptyMaxMind license key for GeoIP database

    MaxMind license key for GeoIP database

  • LIWAN_SESSION_DURATION14 daysSession duration for visitor grouping

    Session duration for visitor grouping

  • LIWAN_TRUSTED_HEADERSX-Forwarded-ForClient IP headers to try in order

    Client IP headers to try in order

  • LIWAN_TRUSTED_PROXIES127.0.0.1/8, ::1/128Direct proxy addresses or networks allowed to supply trusted headers

    Direct proxy addresses or networks allowed to supply trusted headers

  • LIWAN_VISITOR_GROUP_ROTATION_HOUR4Hour in server's local timezone at which visitor-group salts rotate

    Hour in server's local timezone at which visitor-group salts rotate

Liwan releases & version history

More in Privacy

Rate this project

Click to rate — no account needed.

0 comments

Posting as guest
Loading comments…