An open source analytics tool for flutter -- Aptabase
Posted onInTutorialViews: Word count in article: 3.6kReading time ≈3 mins.
When I develop app using flutter, I tried to use plausible as analytics tool. However, I found that plausible is more suitable for website, did not work well cross platforms. So I decided to use another anaylytics tool. And I found aptabase finally, which works perfectly in flutter.
How to install aptabase
Docker configuration
Log into your server as root.
1 2 3 4
mkdir aptabase git clone https://github.com/aptabase/self-hosting aptabase cd aptabase vim docker-compose.yml
services: # ClickHouse still lives in Docker aptabase_events_db: container_name:aptabase_events_db image:clickhouse/clickhouse-server:23.8.4.69-alpine restart:always volumes: -events-db-data:/var/lib/clickhouse environment: CLICKHOUSE_USER:aptabase CLICKHOUSE_PASSWORD:your_password ulimits: nofile: soft:262144 hard:262144
aptabase: container_name:aptabase_app image:ghcr.io/aptabase/aptabase:main restart:always depends_on: -aptabase_events_db ports: -"8000:8080" # Tell the container where to find Postgres on the **host** environment: BASE_URL:https://aptabase.example.com AUTH_SECRET:c4rI4x8kz5DgKJ1is5Eiu9bNncSQ6ROD# get a strong secret from https://randomkeygen.com/ DATABASE_URL:Server=host.docker.internal;Port=5432;UserId=aptabase;Password=your_password;Database=aptabase CLICKHOUSE_URL:Host=aptabase_events_db;Port=8123;Username=aptabase;Password=your_password # ── NEW: SMTP settings ────────────────────────────── SMTP_HOST:mail.example.com SMTP_PORT:"465"# 587 (STARTTLS) or 465 (implicit TLS) SMTP_USERNAME:aptabase@example.com SMTP_PASSWORD:your_password SMTP_FROM_ADDRESS:aptabase@example.com # Linux needs an explicit alias for host.docker.internal extra_hosts: -"host.docker.internal:host-gateway"
# Optional: gzip or Brotli static compression, client_max_body_size, etc. }
1 2
ln -s /etc/nginx/sites-available/aptabase.chinesefoodlab.com /etc/nginx/sites-enabled service nginx restart
Now you can visit your website to use aptabase. This is the link guide you how to integrate it with flutter: https://aptabase.com/for-flutter. The only disadvantage is that there is no disable registeration option in aptabase. An alternative way to disable registeration is to delete smtp configure in docker compose file temprarily.